Permalink
Browse files

Features written using Ruby where breaking due to missing a line number

  • Loading branch information...
1 parent 361e278 commit 167068245a53629cd3ede6cc9d7353aabc3f6907 Joseph Wilk committed Nov 15, 2008
Showing with 13 additions and 1 deletion.
  1. +1 −0 History.txt
  2. +2 −1 lib/cucumber/tree/feature.rb
  3. +10 −0 spec/cucumber/tree/feature_spec.rb
View
@@ -6,6 +6,7 @@ Blurb
* Try to load webrat gem if it's not installed as a plugin (Aslak Hellesøy)
=== Bugfixes
+* Features written using Ruby where breaking due to missing a line number (#91 Joseph Wilk)
=== Removed features
* Step definition without a block being treated as pending (#64 Joseph Wilk)
@@ -34,7 +34,8 @@ def padding_length
end
def Scenario(name, &proc)
- add_scenario(name, &proc)
+ _, line, _ = *caller[0].split(':')
+ add_scenario(name, line, &proc)
end
def Table(matrix = [], &proc)
@@ -3,10 +3,20 @@
module Cucumber
module Tree
describe Feature do
+
it "should have padding_length 2 when alone" do
feature = Feature.new('header')
feature.padding_length.should == 2
end
+
+ it "should create a new scenario for a feature" do
+ feature = Feature.new('header')
+
+ Scenario.should_receive(:new).with(feature, 'test scenario', "17")
+
+ feature.Scenario('test scenario') {}
+ end
+
end
end
end

0 comments on commit 1670682

Please sign in to comment.