aslakhellesoy-cucumber 0.3.9.5 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,17 +1,28 @@
1
- == 0.3.10 (In Git)
1
+ == 0.3.10 2009-06-05
2
+
3
+ The Spork Release!
2
4
 
3
5
  This release has an exciting new feature - a new --drb switch! This magic switch lets you run your
4
6
  features much faster than before, because you can eliminate the startup time for your code. This is
5
- thanks to a brand new gem called Spork by Tim Harper and Ben Mabey. You can start Spork and have it
6
- preload your application in a separate process. Spork listens for DRb connections, and when you run
7
- cucumber with --drb they will run inside the Spork server instead. Spork provides two simple hooks
8
- for preloading your application - one for framework/stable code (Spork.prefork) and one for the code
9
- that *you* write and change often (Spork.each_run). This works great for Ruby on Rails, which can
10
- take a while to load, but Spork isn't tied to Rails.
7
+ thanks to a brand new gem called Spork by Tim Harper and Ben Mabey. (You can find out more about Spork
8
+ here: http://github.com/timcharper/spork/tree/master). You can start Spork and have it preload your
9
+ application in a separate process. Spork listens for DRb connections, and when you run cucumber with
10
+ --drb the features will run inside the Spork server instead. Spork provides two simple hooks for preloading
11
+ your application - one for framework/stable code (Spork.prefork) and one for the code that *you* write and
12
+ change often (Spork.each_run). Keep in mind that all World, Before, and other Cucumber hooks need to be
13
+ in the Spork.each_run block. Using Spork works great for Ruby on Rails, which can take a while to load,
14
+ but --drb and Spork aren't tied to Rails at all. The new --drb switch also works great alongside autotest
15
+ (just add --drb to your autotest profile in cucumber.yml), so now you can get even faster feedback.
11
16
 
12
17
  Cucumber's built-in cucumber generator now has a new --spork switch, so when you bootstrap your Rails
13
18
  application for cucumber, you can have spork configuration set up out of the box. (It's just a
14
- slightly different env.rb).
19
+ slightly different env.rb.)
20
+
21
+ Although Spork was in mind when the --drb switch was added it is important to realize that all that was added
22
+ to Cucumber was a DRb client. Any DRb server that adheres to this protocol can be used with Cucumber's --drb
23
+ switch. While Spork is geared towards removing the load time to give you a faster feedback loop you could
24
+ just as easily use this client with a server that distributes your features to run in parallel. Someone just
25
+ needs to write such a server. ;)
15
26
 
16
27
  This release also has some minor bugfixes related to RSpec and Rails interop.
17
28
 
@@ -22,7 +33,7 @@ This release also has some minor bugfixes related to RSpec and Rails interop.
22
33
 
23
34
  === New features
24
35
  * Spork support via --drb. (Ben Mabey)
25
- * Added a Ast::Feature#name method for convenience
36
+ * Added a Ast::Feature#name method for convenience. (Aslak Hellesøy)
26
37
 
27
38
  === Changed features
28
39
  * The HTML formatter wraps examples in a div, and distinguishes between Scenario and Scenario Outline. (Aslak Hellesøy)
@@ -61,9 +61,12 @@ Feature: DRb Server Integration
61
61
 
62
62
  When I run cucumber features/sample.feature --drb
63
63
  Then it should pass
64
- And the output should contain
64
+ And STDERR should match
65
65
  """
66
66
  No DRb server is running. Running features locally:
67
+ """
68
+ And the output should contain
69
+ """
67
70
  I'm loading all the heavy stuff...
68
71
  I'm loading the stuff just for this run...
69
72
  """
@@ -78,9 +81,12 @@ Feature: DRb Server Integration
78
81
 
79
82
  When I run cucumber --profile server
80
83
  Then it should pass
81
- And the output should contain
84
+ And STDERR should match
82
85
  """
83
86
  No DRb server is running. Running features locally:
87
+ """
88
+ And the output should contain
89
+ """
84
90
  I'm loading all the heavy stuff...
85
91
  I'm loading the stuff just for this run...
86
92
  """
@@ -568,7 +568,7 @@ I should have '&lt;count&gt;' cukes </span>
568
568
  <td class="val skipped" id="row_10_0">10</td>
569
569
  </tr>
570
570
  <tr>
571
- <td colspan="1" class="failed">
571
+ <td class="failed" colspan="1">
572
572
  <pre>
573
573
  FAIL (RuntimeError)
574
574
  ./features/step_definitions/sample_steps.rb:2:in `flunker'
@@ -974,7 +974,7 @@ yawn</span>
974
974
  <td class="val skipped" id="row_12_1">passing</td>
975
975
  </tr>
976
976
  <tr>
977
- <td colspan="2" class="failed">
977
+ <td class="failed" colspan="2">
978
978
  <pre>
979
979
  FAIL (RuntimeError)
980
980
  ./features/step_definitions/sample_steps.rb:2:in `flunker'
@@ -1163,7 +1163,7 @@ features/search_sample.feature:10:in `Given failing without a table'</pre>
1163
1163
  <td class="val failed" id="row_16_0">failing</td>
1164
1164
  </tr>
1165
1165
  <tr>
1166
- <td colspan="1" class="failed">
1166
+ <td class="failed" colspan="1">
1167
1167
  <pre>
1168
1168
  FAIL (RuntimeError)
1169
1169
  ./features/step_definitions/sample_steps.rb:2:in `flunker'
@@ -1244,7 +1244,7 @@ features/search_sample.feature:13:in `Given <state> without a table'
1244
1244
  <td class="val failed" id="row_32_0">failing</td>
1245
1245
  </tr>
1246
1246
  <tr>
1247
- <td colspan="1" class="failed">
1247
+ <td class="failed" colspan="1">
1248
1248
  <pre>
1249
1249
  FAIL (RuntimeError)
1250
1250
  ./features/step_definitions/sample_steps.rb:2:in `flunker'
@@ -58,5 +58,14 @@ Feature: JUnit output formatter
58
58
  """
59
59
  And "examples/junit/tmp/TEST-One_passing_scenario__one_failing_scenario.xml" should exist
60
60
  And "examples/junit/tmp/TEST-Pending_step.xml" should exist
61
-
62
-
61
+
62
+ Scenario: show correct error message if no --out is passed
63
+ When I run cucumber --format junit features
64
+ Then STDERR should not match
65
+ """
66
+ can't convert .* into String \(TypeError\)
67
+ """
68
+ And STDERR should match
69
+ """
70
+ You \*must\* specify \-\-out DIR for the junit formatter
71
+ """
@@ -97,9 +97,9 @@ end
97
97
 
98
98
  Then /^"([^\"]*)" should have the same contents as "([^\"]*)"$/ do |actual_file, expected_file|
99
99
  actual = IO.read(actual_file)
100
- # Comment out to replace expected file. Use with care! Remember to update duration afterwards.
101
- # File.open(expected_file, "w"){|io| io.write(actual)}
102
100
  actual = replace_duration(actual, '0m30.005s')
101
+ # Comment out to replace expected file. Use with care! Remember to update duration afterwards.
102
+ # File.open(expected_file, "w") {|io| io.write(actual)}
103
103
  actual.should == IO.read(expected_file)
104
104
  end
105
105
 
@@ -107,6 +107,10 @@ Then /^STDERR should match$/ do |text|
107
107
  last_stderr.should =~ /#{text}/
108
108
  end
109
109
 
110
+ Then /^STDERR should not match$/ do |text|
111
+ last_stderr.should_not =~ /#{text}/
112
+ end
113
+
110
114
  Then /^STDERR should be empty$/ do
111
115
  last_stderr.should == ""
112
116
  end
@@ -28,7 +28,7 @@ module Cucumber
28
28
 
29
29
  def initialize(args, out_stream = STDOUT, error_stream = STDERR)
30
30
  @args = args
31
- @out_stream = out_stream #== STDOUT ? Formatter::ColorIO.new : out_stream
31
+ @out_stream = out_stream == STDOUT ? Formatter::ColorIO.new : out_stream
32
32
  @error_stream = error_stream
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ module Cucumber
37
37
  if DRbClient.run(@args, @error_stream, @out_stream)
38
38
  return false
39
39
  else
40
- @out_stream.puts "No DRb server is running. Running features locally:"
40
+ @error_stream.puts "WARNING: No DRb server is running. Running features locally:"
41
41
  configuration.parse!(@args)
42
42
  end
43
43
  end
@@ -6,7 +6,7 @@ module Cucumber
6
6
  class ColorIO
7
7
  extend Forwardable
8
8
  def_delegators :@kernel, :puts, :print # win32console colours only work when sent to Kernel
9
- def_delegators :@stdout, :flush, :tty?
9
+ def_delegators :@stdout, :flush, :tty?, :write
10
10
 
11
11
  def initialize
12
12
  @kernel = Kernel
@@ -20,4 +20,4 @@ module Cucumber
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -11,10 +11,9 @@ module Cucumber
11
11
 
12
12
  def initialize(step_mother, io, options)
13
13
  super(step_mother)
14
+ raise "You *must* specify --out DIR for the junit formatter" unless String === io && File.directory?(io)
14
15
  @reportdir = io
15
16
  @options = options
16
- raise "You *must* specify --out DIR for the junit formatter" unless @reportdir
17
- raise "Use --out DIR (not --out FILE) for the junit formatter" if File === @reportdir
18
17
  end
19
18
 
20
19
  def visit_feature(feature)
@@ -2,8 +2,8 @@ module Cucumber #:nodoc:
2
2
  class VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 9
6
- PATCH = 5 # Set to nil for official release
5
+ TINY = 10
6
+ PATCH = nil # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -11,6 +11,7 @@ module Cucumber
11
11
  describe Main do
12
12
  before(:each) do
13
13
  @out = StringIO.new
14
+ @err = StringIO.new
14
15
  Kernel.stub!(:exit).and_return(nil)
15
16
  end
16
17
 
@@ -97,16 +98,15 @@ module Cucumber
97
98
  before(:each) do
98
99
  @configuration = mock('Configuration', :drb? => true, :null_object => true)
99
100
  Configuration.stub!(:new).and_return(@configuration)
100
- @error_stream = mock('standard error')
101
101
 
102
102
  @args = ['features']
103
103
 
104
- @cli = Main.new(@args, @out, @error_stream)
104
+ @cli = Main.new(@args, @out, @err)
105
105
  @step_mother = mock('StepMother', :null_object => true)
106
106
  end
107
107
 
108
108
  it "delegates the execution to the DRB client passing the args and streams" do
109
- DRbClient.should_receive(:run).with(@args, @error_stream, @out).and_return(true)
109
+ DRbClient.should_receive(:run).with(@args, @err, @out).and_return(true)
110
110
  @cli.execute!(@step_mother)
111
111
  end
112
112
 
@@ -121,7 +121,7 @@ module Cucumber
121
121
 
122
122
  it "alerts the user that execution will be performed locally" do
123
123
  @cli.execute!(@step_mother)
124
- @out.string.should include("No DRb server is running. Running features locally:")
124
+ @err.string.should include("WARNING: No DRb server is running. Running features locally:")
125
125
  end
126
126
 
127
127
  it "reparses the configuration since the --drb flag causes the initial parsing to short circuit" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9.5
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-04 00:00:00 -07:00
12
+ date: 2009-06-05 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency