Sha256: 66080e3f00c02c6f9189da80327a008eb9c0066b7a874c4567ed2440e1fdc916
Contents?: true
Size: 1.91 KB
Versions: 1
Compression:
Stored size: 1.91 KB
Contents
require 'active_support/core_ext/object/blank' module Physique class TestConfig self.extend Albacore::ConfigDSL # Path to test runner executable attr_path :exe # Path to test runner executable attr_writer :files # The test runner to use attr_writer :runner # Additional parameters to pass to the test runner attr_writer :parameters def opts Map.new({ exe: @exe, runner: @runner, files: @files, parameters: @parameters }).apply({ runner: :nunit }) end end class TestsTasksBuilder < TasksBuilder def build_tasks add_test_tasks end def add_test_tasks options = solution.test defaults = default_runner_config options files = options.files || defaults[:files] desc 'Run unit tests' if defaults && !files.blank? test_runner :test => :compile do |tests| tests.files = files tests.exe = options.exe || locate_tool(defaults[:exe]) defaults[:parameters].each do |p| tests.parameters.add(p) end end else task :test => :compile do puts 'No test assemblies were detected' end end end private def default_runner_config(options) configuration = solution.compile.configuration package_dir = solution.nuget.restore_location defaults = { nunit: { files: FileList["**/*.Tests/bin/#{configuration}/*.Tests.dll"], exe: "#{package_dir}/NUnit.Runners.*/tools/nunit-console.exe", parameters: %w(/labels /trace=Verbose)}, nspec: { files: FileList["**/*.Specs/bin/#{configuration}/*.Specs.dll"], exe: "#{package_dir}/nspec.*/tools/NSpecRunner.exe", parameters: []}} defaults[options.runner] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
physique-0.3.10 | lib/physique/task_builders/test.rb |