Sha256: fb4ec981800e441fea25eda1cec1f514ad460d10f1de532963da7286a9f53ad5

Contents?: true

Size: 1.08 KB

Versions: 69

Compression:

Stored size: 1.08 KB

Contents

class Test < Array

  def initialize
    # 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

69 entries across 69 versions & 1 rubygems

Version Path
dev_tasks-0.0.101 lib/test.rb
dev_tasks-0.0.100 lib/test.rb
dev_tasks-0.0.99 lib/test.rb
dev_tasks-0.0.98 lib/test.rb
dev_tasks-0.0.97 lib/test.rb
dev_tasks-0.0.96 lib/test.rb
dev_tasks-0.0.94 lib/test.rb
dev_tasks-0.0.93 lib/test.rb
dev_tasks-0.0.92 lib/test.rb
dev_tasks-0.0.91 lib/test.rb
dev_tasks-0.0.90 lib/test.rb
dev_tasks-0.0.89 lib/test.rb
dev_tasks-0.0.88 lib/test.rb
dev_tasks-0.0.87 lib/test.rb
dev_tasks-0.0.86 lib/test.rb
dev_tasks-0.0.85 lib/test.rb
dev_tasks-0.0.84 lib/test.rb
dev_tasks-0.0.83 lib/test.rb
dev_tasks-0.0.82 lib/test.rb
dev_tasks-0.0.81 lib/test.rb