albacore 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -14,14 +14,14 @@ module AttrMethods
14
14
  end
15
15
  end
16
16
  end
17
-
17
+
18
18
  def attr_hash(*names)
19
19
  names.each do |n|
20
- self.send :define_method, n do |value|
20
+ self.send :define_method, n do |*value|
21
21
  if value.nil? || value.empty?
22
22
  instance_variable_get "@#{n}"
23
23
  else
24
- instance_variable_set "@#{n}", value
24
+ instance_variable_set "@#{n}", value[0]
25
25
  end
26
26
  end
27
27
  self.send :define_method, "#{n}=" do |value|
@@ -20,8 +20,8 @@ module RunCommand
20
20
  return false unless valid_command_exists
21
21
  end
22
22
 
23
- combine_parameters = @parameters.collect
24
- combine_parameters.push(command_parameters) unless command_parameters.nil?
23
+ combine_parameters = Array.new(@parameters)
24
+ combine_parameters << command_parameters unless command_parameters.nil?
25
25
 
26
26
  command = "\"#{@path_to_command}\" #{combine_parameters.join(' ')}"
27
27
  @logger.debug "Executing #{command_name}: #{command}"
@@ -31,7 +31,7 @@ class XUnitTestRunner
31
31
  end
32
32
 
33
33
  def execute()
34
- @assemblies = [] unless !@assemblies.nil?
34
+ @assemblies = [] if @assemblies.nil?
35
35
  @assemblies << @assembly unless @assembly.nil?
36
36
  fail_with_message 'At least one assembly is required for assemblies attr' if @assemblies.length==0
37
37
  failure_message = 'XUnit Failed. See Build Log For Detail'
@@ -1,21 +1,21 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/exec'
3
3
 
4
- @@nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
5
-
6
4
  describe Exec, "when executing a command with parameters" do
7
5
  before :all do
6
+ @nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
7
+
8
8
  @cmd = Exec.new
9
9
  @cmd.log_level = :verbose
10
10
  @cmd.extend(SystemPatch)
11
11
  @cmd.extend(FailPatch)
12
- @cmd.path_to_command = @@nunit
12
+ @cmd.path_to_command = @nunit
13
13
  @cmd.parameters "--help"
14
14
  @cmd.execute
15
15
  end
16
16
 
17
17
  it "should run the command with the parameters" do
18
- @cmd.system_command.should include("\"#{@@nunit}\" --help")
18
+ @cmd.system_command.should include("\"#{@nunit}\" --help")
19
19
  end
20
20
 
21
21
  it "should specify the parameters only once" do
@@ -433,8 +433,8 @@ describe NCoverReport, "when filtering on Assembly coverage data" do
433
433
  @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
434
434
 
435
435
  @ncover.filters(
436
- NCover::AssemblyFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
437
- NCover::AssemblyFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
436
+ NCover::AssemblyFilter.new(:filter_type => :exclude, :filter => "nunit.*"),
437
+ NCover::AssemblyFilter.new(:filter_type => :include, :filter => "TestSolution.*")
438
438
  )
439
439
 
440
440
  @ncover.run
@@ -471,8 +471,8 @@ describe NCoverReport, "when filtering on Namespace coverage data" do
471
471
  @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
472
472
 
473
473
  @ncover.filters(
474
- NCover::NamespaceFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
475
- NCover::NamespaceFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
474
+ NCover::NamespaceFilter.new(:filter_type => :exclude, :filter => "nunit.*"),
475
+ NCover::NamespaceFilter.new(:filter_type => :include, :filter => "TestSolution.*")
476
476
  )
477
477
 
478
478
  @ncover.run
@@ -509,8 +509,8 @@ describe NCoverReport, "when filtering on Class coverage data" do
509
509
  @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
510
510
 
511
511
  @ncover.filters(
512
- NCover::ClassFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
513
- NCover::ClassFilter.new(:filter_type => :include, :filter => ["Bar"])
512
+ NCover::ClassFilter.new(:filter_type => :exclude, :filter => "Foo"),
513
+ NCover::ClassFilter.new(:filter_type => :include, :filter => "Bar")
514
514
  )
515
515
 
516
516
  @ncover.run
@@ -547,8 +547,8 @@ describe NCoverReport, "when filtering on Method coverage data" do
547
547
  @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
548
548
 
549
549
  @ncover.filters(
550
- NCover::MethodFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
551
- NCover::MethodFilter.new(:filter_type => :include, :filter => ["Bar"])
550
+ NCover::MethodFilter.new(:filter_type => :exclude, :filter => "Foo"),
551
+ NCover::MethodFilter.new(:filter_type => :include, :filter => "Bar")
552
552
  )
553
553
 
554
554
  @ncover.run
@@ -585,8 +585,8 @@ describe NCoverReport, "when filtering on Document coverage data" do
585
585
  @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
586
586
 
587
587
  @ncover.filters(
588
- NCover::DocumentFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
589
- NCover::DocumentFilter.new(:filter_type => :include, :filter => ["Bar"])
588
+ NCover::DocumentFilter.new(:filter_type => :exclude, :filter => "Foo"),
589
+ NCover::DocumentFilter.new(:filter_type => :include, :filter => "Bar")
590
590
  )
591
591
 
592
592
  @ncover.run
@@ -1,45 +1,53 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/nunittestrunner'
3
3
 
4
- @@nunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
5
- @@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
6
- @@failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
7
- @@output_option = "/out=nunit.results.html"
4
+ shared_examples_for "nunit paths" do
5
+ before :all do
6
+ @nunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
7
+ @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
8
+ @failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
9
+ @output_option = "/out=nunit.results.html"
10
+ end
11
+ end
8
12
 
9
13
  describe NUnitTestRunner, "the command parameters for an nunit runner" do
14
+ it_should_behave_like "nunit paths"
15
+
10
16
  before :all do
11
- nunit = NUnitTestRunner.new(@@nunitpath)
12
- nunit.assemblies @@test_assembly, @@failing_test_assembly
13
- nunit.options @@output_option
17
+ nunit = NUnitTestRunner.new(@nunitpath)
18
+ nunit.assemblies @test_assembly, @failing_test_assembly
19
+ nunit.options @output_option
14
20
 
15
21
  @command_parameters = nunit.get_command_parameters
16
22
  end
17
23
 
18
24
  it "should not include the path to the command" do
19
- @command_parameters.should_not include(@@nunitpath)
25
+ @command_parameters.should_not include(@nunitpath)
20
26
  end
21
27
 
22
28
  it "should include the list of assemblies" do
23
- @command_parameters.should include("\"#{@@test_assembly}\" \"#{@@failing_test_assembly}\"")
29
+ @command_parameters.should include("\"#{@test_assembly}\" \"#{@failing_test_assembly}\"")
24
30
  end
25
31
 
26
32
  it "should include the list of options" do
27
- @command_parameters.should include(@@output_option)
33
+ @command_parameters.should include(@output_option)
28
34
  end
29
35
  end
30
36
 
31
37
  describe NUnitTestRunner, "the command line string for an nunit runner" do
38
+ it_should_behave_like "nunit paths"
39
+
32
40
  before :all do
33
- nunit = NUnitTestRunner.new(@@nunitpath)
34
- nunit.assemblies @@test_assembly
35
- nunit.options @@output_option
41
+ nunit = NUnitTestRunner.new(@nunitpath)
42
+ nunit.assemblies @test_assembly
43
+ nunit.options @output_option
36
44
 
37
45
  @command_line = nunit.get_command_line
38
46
  @command_parameters = nunit.get_command_parameters.join(" ")
39
47
  end
40
48
 
41
49
  it "should start with the path to the command" do
42
- @command_line.split(" ").first.should == @@nunitpath
50
+ @command_line.split(" ").first.should == @nunitpath
43
51
  end
44
52
 
45
53
  it "should include the command parameters" do
@@ -49,10 +57,12 @@ end
49
57
 
50
58
 
51
59
  describe NUnitTestRunner, "when configured correctly" do
60
+ it_should_behave_like "nunit paths"
61
+
52
62
  before :all do
53
- nunit = NUnitTestRunner.new(@@nunitpath)
63
+ nunit = NUnitTestRunner.new(@nunitpath)
54
64
  nunit.extend(FailPatch)
55
- nunit.assemblies @@test_assembly
65
+ nunit.assemblies @test_assembly
56
66
  nunit.options '/noshadow'
57
67
 
58
68
  nunit.execute
@@ -61,4 +71,4 @@ describe NUnitTestRunner, "when configured correctly" do
61
71
  it "should execute" do
62
72
  $task_failed.should be_false
63
73
  end
64
- end
74
+ end
@@ -1,42 +1,48 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/xunittestrunner'
3
3
 
4
- @@xunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'XUnit-v1.5', 'xunit.console.exe')
5
- @@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'xunit', 'assemblies', 'TestSolution.XUnitTests.dll')
6
- @@output_option = "/out=xunit.results.html"
7
- @@working_dir =File.join(File.dirname(__FILE__), 'support','xunit')
8
- @@html_output = File.join(@@working_dir,'TestSolution.XUnitTests.dll.html')
4
+ shared_examples_for "xunit paths" do
5
+ before :all do
6
+ @xunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'XUnit-v1.5', 'xunit.console.exe')
7
+ @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'xunit', 'assemblies', 'TestSolution.XUnitTests.dll')
8
+ @output_option = "/out=xunit.results.html"
9
+ @working_dir =File.join(File.dirname(__FILE__), 'support','xunit')
10
+ @html_output = File.join(@working_dir,'TestSolution.XUnitTests.dll.html')
11
+ end
12
+ end
9
13
 
10
14
  describe XUnitTestRunner, "the command parameters for an xunit runner" do
15
+ it_should_behave_like "xunit paths"
11
16
  before :all do
12
- xunit = XUnitTestRunner.new(@@xunitpath)
13
- xunit.assembly = @@test_assembly
14
- xunit.options @@output_option
17
+ xunit = XUnitTestRunner.new(@xunitpath)
18
+ xunit.assembly = @test_assembly
19
+ xunit.options @output_option
15
20
 
16
21
  @command_parameters = xunit.get_command_parameters
17
22
  end
18
23
 
19
24
  it "should not include the path to the command" do
20
- @command_parameters.should_not include(@@xunitpath)
25
+ @command_parameters.should_not include(@xunitpath)
21
26
  end
22
27
 
23
28
  it "should include the list of options" do
24
- @command_parameters.should include(@@output_option)
29
+ @command_parameters.should include(@output_option)
25
30
  end
26
31
  end
27
32
 
28
33
  describe XUnitTestRunner, "the command line string for an xunit runner" do
34
+ it_should_behave_like "xunit paths"
29
35
  before :all do
30
- xunit = XUnitTestRunner.new(@@xunitpath)
31
- xunit.assembly = @@test_assembly
32
- xunit.options @@output_option
36
+ xunit = XUnitTestRunner.new(@xunitpath)
37
+ xunit.assembly = @test_assembly
38
+ xunit.options @output_option
33
39
 
34
40
  @command_line = xunit.get_command_line
35
41
  @command_parameters = xunit.get_command_parameters.join(" ")
36
42
  end
37
43
 
38
44
  it "should start with the path to the command" do
39
- @command_line.split(" ").first.should == @@xunitpath
45
+ @command_line.split(" ").first.should == @xunitpath
40
46
  end
41
47
 
42
48
  it "should include the command parameters" do
@@ -45,9 +51,10 @@ describe XUnitTestRunner, "the command line string for an xunit runner" do
45
51
  end
46
52
 
47
53
  describe XUnitTestRunner, "when configured correctly" do
54
+ it_should_behave_like "xunit paths"
48
55
  before :all do
49
- xunit = XUnitTestRunner.new(@@xunitpath)
50
- xunit.assembly = @@test_assembly
56
+ xunit = XUnitTestRunner.new(@xunitpath)
57
+ xunit.assembly = @test_assembly
51
58
  xunit.options '/noshadow'
52
59
  xunit.extend(FailPatch)
53
60
  xunit.log_level = :verbose
@@ -61,9 +68,10 @@ describe XUnitTestRunner, "when configured correctly" do
61
68
  end
62
69
 
63
70
  describe XUnitTestRunner, "when multiple assemblies are passed to xunit runner" do
71
+ it_should_behave_like "xunit paths"
64
72
  before :all do
65
- xunit = XUnitTestRunner.new(@@xunitpath)
66
- xunit.assemblies = @@test_assembly, @@test_assembly
73
+ xunit = XUnitTestRunner.new(@xunitpath)
74
+ xunit.assemblies = @test_assembly, @test_assembly
67
75
  xunit.options '/noshadow'
68
76
  xunit.extend(FailPatch)
69
77
  xunit.log_level = :verbose
@@ -77,8 +85,9 @@ describe XUnitTestRunner, "when multiple assemblies are passed to xunit runner"
77
85
  end
78
86
 
79
87
  describe XUnitTestRunner, "when zero assemblies are passed to xunit runner" do
88
+ it_should_behave_like "xunit paths"
80
89
  before :all do
81
- xunit = XUnitTestRunner.new(@@xunitpath)
90
+ xunit = XUnitTestRunner.new(@xunitpath)
82
91
  xunit.options '/noshadow'
83
92
  xunit.extend(FailPatch)
84
93
 
@@ -91,11 +100,12 @@ describe XUnitTestRunner, "when zero assemblies are passed to xunit runner" do
91
100
  end
92
101
 
93
102
  describe XUnitTestRunner, "when html_output is specified" do
103
+ it_should_behave_like "xunit paths"
94
104
  before :each do
95
- FileUtils.mkdir @@working_dir
96
- xunit = XUnitTestRunner.new(@@xunitpath)
97
- xunit.assemblies = @@test_assembly
98
- xunit.html_output = File.dirname(@@html_output)
105
+ FileUtils.mkdir @working_dir
106
+ xunit = XUnitTestRunner.new(@xunitpath)
107
+ xunit.assembly = @test_assembly
108
+ xunit.html_output = File.dirname(@html_output)
99
109
  xunit.extend(FailPatch)
100
110
 
101
111
  xunit.execute
@@ -106,27 +116,28 @@ describe XUnitTestRunner, "when html_output is specified" do
106
116
  end
107
117
 
108
118
  it "should write output html" do
109
- File.exist?(@@html_output).should be_true
119
+ File.exist?(@html_output).should be_true
110
120
  end
111
121
 
112
122
  after:each do
113
- FileUtils.rm_r @@working_dir if File.exist? @@working_dir
123
+ FileUtils.rm_r @working_dir if File.exist? @working_dir
114
124
  end
115
125
  end
116
126
 
117
127
  describe XUnitTestRunner, "when html_output is not a directory" do
128
+ it_should_behave_like "xunit paths"
118
129
  before :each do
119
- FileUtils.mkdir @@working_dir
120
- strio = StringIO.new
121
- xunit = XUnitTestRunner.new(@@xunitpath)
122
- xunit.log_level = :verbose
130
+ FileUtils.mkdir @working_dir
131
+ strio = StringIO.new
132
+ xunit = XUnitTestRunner.new(@xunitpath)
133
+ xunit.log_level = :verbose
123
134
  xunit.log_device = strio
124
- xunit.assemblies = @@test_assembly
125
- xunit.html_output = @@html_output
135
+ xunit.assembly = @test_assembly
136
+ xunit.html_output = @html_output
126
137
  xunit.extend(FailPatch)
127
138
 
128
139
  xunit.execute
129
- @log_data = strio.string
140
+ @log_data = strio.string
130
141
  end
131
142
 
132
143
  it "should fail" do
@@ -134,10 +145,10 @@ describe XUnitTestRunner, "when html_output is not a directory" do
134
145
  end
135
146
 
136
147
  it "should log a message" do
137
- @log_data.should include('Directory is required for html_output')
148
+ @log_data.should include('Directory is required for html_output')
138
149
  end
139
150
 
140
151
  after:each do
141
- FileUtils.rm_r @@working_dir if File.exist? @@working_dir
152
+ FileUtils.rm_r @working_dir if File.exist? @working_dir
142
153
  end
143
154
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Derick Bailey
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-05-06 00:00:00 -05:00
19
+ date: 2010-05-18 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency