Sha256: 0216fdb6c4f5d16ffd20943331d4013d3f98a7f95d95681d734d35a14015b0fe
Contents?: true
Size: 1.28 KB
Versions: 1
Compression:
Stored size: 1.28 KB
Contents
require_relative('./commandarray.rb') class Test < CommandArray def update # rspec tests, 'rspec --pattern="**/*.spec"' if(Dir.glob("**/*spec.rb").length > 0) self.add 'rspec' end # nunit tests, 'nunit-console.exe "C::\\Projects\\MyProjects\\bin\\Release\\MyLib.Test.dll"' if File.exist? Test.nunit_console Dir.glob("*.csproj").each{|p| text = File.read(p) if(text.include?("nunit.framework.dll")) # extract AssemblyName of form: <AssemblyName>MyLibrary.Test</AssemblyName> assemblyName=text[/<AssemblyName>([\w\.]+)</,1] outputPath=text[/Release[.\w\W]+<OutputPath>([\w\.\\]+)</,1] if(!assemblyName.nil? && !outputPath.nil?) nunit_dll = "#{Rake.application.original_dir}\\#{outputPath}\\#{assemblyName}.dll".gsub("\\\\","\\").gsub('/','\\') if(outputPath.include?('x86')) self.add "\"#{Test.nunit_console_x86}\" \"#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\"" else self.add "\"#{Test.nunit_console}\" \"#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\"" end end end } end end def self.nunit_console "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe" end def self.nunit_console_x86 "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console-x86.exe" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dev_tasks-0.0.162 | lib/test.rb |