Sha256: f84c49d343b8e7db4636442232c146944fb84db44c42ab8a5808fb9fc1a12191

Contents?: true

Size: 1.05 KB

Versions: 34

Compression:

Stored size: 1.05 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}\""
		  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

34 entries across 34 versions & 1 rubygems

Version Path
dev_tasks-0.0.68 lib/test.rb
dev_tasks-0.0.67 lib/test.rb
dev_tasks-0.0.66 lib/test.rb
dev_tasks-0.0.65 lib/test.rb
dev_tasks-0.0.64 lib/test.rb
dev_tasks-0.0.63 lib/test.rb
dev_tasks-0.0.62 lib/test.rb
dev_tasks-0.0.61 lib/test.rb
dev_tasks-0.0.60 lib/test.rb
dev_tasks-0.0.59 lib/test.rb
dev_tasks-0.0.58 lib/test.rb
dev_tasks-0.0.57 lib/test.rb
dev_tasks-0.0.56 lib/test.rb
dev_tasks-0.0.55 lib/test.rb
dev_tasks-0.0.54 lib/test.rb
dev_tasks-0.0.53 lib/test.rb
dev_tasks-0.0.52 lib/test.rb
dev_tasks-0.0.51 lib/test.rb
dev_tasks-0.0.50 lib/test.rb
dev_tasks-0.0.49 lib/test.rb