Sha256: 2b6de9216dd90f8ff87d59c9de5c73792e24008302a0756288b7d23c06fbb9b3

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

class Test < Array

  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('/','\\')
			#puts "nunit_dll: " + nunit_dll
			self.add "\"#{Test.nunit_console}\" \"#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
		  end
		end
	  }
	end
  end

  def add command
    self << command if(!include?(command))
  end

  def self.nunit_console
    "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dev_tasks-0.0.155 lib/test.rb
dev_tasks-0.0.154 lib/test.rb
dev_tasks-0.0.153 lib/test.rb
dev_tasks-0.0.152 lib/test.rb
dev_tasks-0.0.151 lib/test.rb
dev_tasks-0.0.150 lib/test.rb
dev_tasks-0.0.149 lib/test.rb
dev_tasks-0.0.148 lib/test.rb
dev_tasks-0.0.147 lib/test.rb
dev_tasks-0.0.146 lib/test.rb
dev_tasks-0.0.145 lib/test.rb
dev_tasks-0.0.144 lib/test.rb
dev_tasks-0.0.143 lib/test.rb
dev_tasks-0.0.142 lib/test.rb