Sha256: 0510a8dff72587b60659638ece34a6d742a70d14b16b0c37b21932669485fedc

Contents?: true

Size: 1.07 KB

Versions: 24

Compression:

Stored size: 1.07 KB

Contents

class Test < Array

  def initialize
    # rspec tests, 'rspec --pattern="**/*.spec"'
	if(Dir.glob("**/*spec.rb").length > 0)
	  self.add 'rspec --pattern="**/*.spec"'
	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}\""
		  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

24 entries across 24 versions & 1 rubygems

Version Path
dev_tasks-0.0.33 lib/test.rb
dev_tasks-0.0.32 lib/test.rb
dev_tasks-0.0.31 lib/test.rb
dev_tasks-0.0.30 lib/test.rb
dev_tasks-0.0.29 lib/test.rb
dev_tasks-0.0.28 lib/test.rb
dev_tasks-0.0.27 lib/test.rb
dev_tasks-0.0.26 lib/test.rb
dev_tasks-0.0.25 lib/test.rb
dev_tasks-0.0.24 lib/test.rb
dev_tasks-0.0.23 lib/test.rb
dev_tasks-0.0.22 lib/test.rb
dev_tasks-0.0.21 lib/test.rb
dev_tasks-0.0.20 lib/test.rb
dev_tasks-0.0.19 lib/test.rb
dev_tasks-0.0.18 lib/test.rb
dev_tasks-0.0.17 lib/test.rb
dev_tasks-0.0.16 lib/test.rb
dev_tasks-0.0.15 lib/test.rb
dev_tasks-0.0.14 lib/test.rb