albacore 2.0.0.rc.10 → 2.0.0.rc.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -225,6 +225,7 @@ end
225
225
  test_runner :tests do |tests|
226
226
  tests.files = FileList['**/*.Tests/bin/Release/*.Tests.dll'] # dll files with test
227
227
  tests.exe = 'src/packages/NUnit.Runners.2.5.3/tools/nunit-console.exe' # executable to run tests with
228
+ tests.add_parameter '/TestResults=Lallaa.xml' # you may add parameters to the execution
228
229
  tests.copy_local # when running from network share
229
230
  end
230
231
  ```
@@ -8,21 +8,6 @@ require 'albacore/cross_platform_cmd'
8
8
 
9
9
  module Albacore
10
10
  module TestRunner
11
- class Cmd
12
- include CrossPlatformCmd
13
- def initialize work_dir, executable, parameters, file
14
- @work_dir, @executable = work_dir, executable
15
- @parameters = parameters.to_a.unshift(file)
16
- end
17
-
18
- def execute
19
- system @executable,
20
- @parameters,
21
- :work_dir => @work_dir,
22
- :clr_command => true
23
- end
24
- end
25
-
26
11
  # the configuration object for the test runner
27
12
  class Config
28
13
  include CmdConfig
@@ -41,7 +26,8 @@ module Albacore
41
26
  Map.new(
42
27
  :files => files,
43
28
  :copy_local => @copy_local,
44
- :exe => @exe)
29
+ :exe => @exe,
30
+ :parameters => @parameters)
45
31
  end
46
32
 
47
33
  # mark that it should be possible to copy the test files local
@@ -61,6 +47,22 @@ module Albacore
61
47
  end
62
48
  end
63
49
 
50
+ class Cmd
51
+ include CrossPlatformCmd
52
+ def initialize work_dir, executable, parameters, file
53
+ @work_dir, @executable = work_dir, executable
54
+ @parameters = parameters.to_a.unshift(file)
55
+ end
56
+
57
+ def execute
58
+ system @executable,
59
+ @parameters,
60
+ :work_dir => @work_dir,
61
+ :clr_command => true
62
+ end
63
+ end
64
+
65
+
64
66
  class Task
65
67
  include Logging
66
68
 
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.0.0.rc.10"
2
+ VERSION = "2.0.0.rc.11"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'albacore/task_types/test_runner'
2
+ require 'support/sh_interceptor'
2
3
  require 'map'
3
4
 
4
5
  describe ::Albacore::TestRunner::Config do
@@ -18,14 +19,60 @@ describe ::Albacore::TestRunner::Config do
18
19
  should respond_to :exe=
19
20
  end
20
21
  end
22
+ describe ::Albacore::TestRunner::Config do
23
+ subject do
24
+ ::Albacore::TestRunner::Config.new
25
+ end
26
+
27
+ before :each do
28
+ subject.add_parameter '/TestResults=/b/c/d/e.xml'
29
+ end
30
+
31
+ it 'should have the appropriate parameter in #opts.get(:parameters)' do
32
+ subject.opts.get(:parameters).should include('/TestResults=/b/c/d/e.xml')
33
+ end
34
+ end
35
+
36
+ describe 'the order of which parameters are passed', ::Albacore::TestRunner::Config do
37
+ subject do
38
+ cmd = ::Albacore::TestRunner::Config.new
39
+ cmd.files = 'file.dll'
40
+ cmd.exe = 'test-runner.exe'
41
+ cmd.add_parameter '/TestResults=abc.xml'
42
+ cmd
43
+ end
44
+
45
+ let :params do
46
+ subject.opts.get(:parameters)
47
+ end
48
+
49
+ it 'should first pass the flags' do
50
+ params.first.should eq('/TestResults=abc.xml')
51
+ end
52
+
53
+ it 'should pass the file as a :files' do
54
+ subject.opts.get(:files).should eq(['file.dll'])
55
+ end
56
+ end
21
57
 
22
58
  describe ::Albacore::TestRunner::Cmd do
23
59
  subject do
24
- ::Albacore::TestRunner::Cmd.new 'work_dir', 'run-tests.exe', %w[params go here], 'lib.tests.dll'
60
+ cmd = ::Albacore::TestRunner::Cmd.new 'work_dir', 'run-tests.exe', %w[params go here], 'lib.tests.dll'
61
+ cmd.extend ShInterceptor
62
+ cmd
25
63
  end
64
+
26
65
  it do
27
66
  should respond_to :execute
28
67
  end
68
+
69
+ it 'should include the parameters when executing' do
70
+ subject.execute
71
+
72
+ # the intersection of actual parameters with expected should eq expected
73
+ (subject.parameters - (subject.parameters - %w|params go here|)).
74
+ should eq(%w|params go here|)
75
+ end
29
76
  end
30
77
 
31
78
  describe ::Albacore::TestRunner::Task do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc.10
4
+ version: 2.0.0.rc.11
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-02 00:00:00.000000000 Z
13
+ date: 2014-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -317,7 +317,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
317
317
  version: '0'
318
318
  segments:
319
319
  - 0
320
- hash: 996579621817901824
320
+ hash: 2914469606549085872
321
321
  required_rubygems_version: !ruby/object:Gem::Requirement
322
322
  none: false
323
323
  requirements: