cucumber 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. data/History.txt +27 -0
  2. data/VERSION.yml +3 -2
  3. data/cucumber.gemspec +11 -5
  4. data/examples/watir/features/support/screenshots.rb +1 -2
  5. data/features/call_many_steps.feature +124 -0
  6. data/features/default_snippets.feature +2 -2
  7. data/features/expand.feature +13 -2
  8. data/features/language_help.feature +1 -1
  9. data/features/report_called_undefined_steps.feature +1 -1
  10. data/features/snippet.feature +2 -2
  11. data/features/support/env.rb +3 -5
  12. data/features/tag_logic.feature +32 -0
  13. data/features/wire_protocol.feature +7 -7
  14. data/lib/cucumber.rb +6 -0
  15. data/lib/cucumber/ast/background.rb +1 -1
  16. data/lib/cucumber/ast/comment.rb +1 -1
  17. data/lib/cucumber/ast/examples.rb +1 -1
  18. data/lib/cucumber/ast/feature.rb +1 -1
  19. data/lib/cucumber/ast/feature_element.rb +2 -3
  20. data/lib/cucumber/ast/features.rb +1 -1
  21. data/lib/cucumber/ast/outline_table.rb +17 -4
  22. data/lib/cucumber/ast/py_string.rb +3 -1
  23. data/lib/cucumber/ast/scenario.rb +3 -1
  24. data/lib/cucumber/ast/scenario_outline.rb +2 -2
  25. data/lib/cucumber/ast/step.rb +1 -1
  26. data/lib/cucumber/ast/step_collection.rb +1 -1
  27. data/lib/cucumber/ast/step_invocation.rb +2 -1
  28. data/lib/cucumber/ast/table.rb +3 -3
  29. data/lib/cucumber/ast/tags.rb +18 -11
  30. data/lib/cucumber/ast/tree_walker.rb +16 -0
  31. data/lib/cucumber/cli/main.rb +3 -2
  32. data/lib/cucumber/cli/options.rb +4 -6
  33. data/lib/cucumber/cli/profile_loader.rb +4 -0
  34. data/lib/cucumber/filter.rb +2 -2
  35. data/lib/cucumber/formatter/ansicolor.rb +8 -0
  36. data/lib/cucumber/formatter/pretty.rb +3 -4
  37. data/lib/cucumber/language_support/language_methods.rb +4 -3
  38. data/lib/cucumber/languages.yml +1 -1
  39. data/lib/cucumber/parser.rb +2 -0
  40. data/lib/cucumber/parser/common.rb +170 -0
  41. data/lib/cucumber/parser/common.tt +21 -0
  42. data/lib/cucumber/parser/feature.rb +7 -291
  43. data/lib/cucumber/parser/feature.tt +7 -43
  44. data/lib/cucumber/parser/i18n.tt +2 -0
  45. data/lib/cucumber/parser/natural_language.rb +9 -0
  46. data/lib/cucumber/parser/py_string.rb +276 -0
  47. data/lib/cucumber/parser/py_string.tt +45 -0
  48. data/lib/cucumber/parser/table.rb +5 -120
  49. data/lib/cucumber/parser/table.tt +2 -13
  50. data/lib/cucumber/platform.rb +3 -2
  51. data/lib/cucumber/rails/active_record.rb +2 -21
  52. data/lib/cucumber/rails/world.rb +2 -1
  53. data/lib/cucumber/rb_support/rb_hook.rb +2 -1
  54. data/lib/cucumber/rb_support/rb_language.rb +8 -6
  55. data/lib/cucumber/rb_support/rb_step_definition.rb +4 -0
  56. data/lib/cucumber/rb_support/rb_world.rb +16 -37
  57. data/lib/cucumber/step_mother.rb +86 -2
  58. data/lib/cucumber/wire_support/wire_language.rb +2 -2
  59. data/lib/cucumber/wire_support/wire_protocol.rb +1 -1
  60. data/rails_generators/cucumber/cucumber_generator.rb +3 -1
  61. data/rails_generators/cucumber/templates/cucumber.rake +4 -2
  62. data/rails_generators/cucumber/templates/webrat_steps.rb +28 -28
  63. data/spec/cucumber/ast/background_spec.rb +2 -1
  64. data/spec/cucumber/ast/scenario_spec.rb +3 -1
  65. data/spec/cucumber/formatter/console_spec.rb +1 -1
  66. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +14 -5
  67. data/spec/cucumber/step_mother_spec.rb +1 -1
  68. data/spec/cucumber/world/pending_spec.rb +1 -1
  69. metadata +8 -3
@@ -42,7 +42,8 @@ module Cucumber
42
42
  line=99,
43
43
  keyword="",
44
44
  name="",
45
- steps=[])
45
+ steps=[]
46
+ )
46
47
  background.feature = @feature
47
48
  @visitor.visit_background(background)
48
49
  $x.should == 2
@@ -32,7 +32,9 @@ module Cucumber
32
32
  steps=[
33
33
  Step.new(7, "Given", "this is missing"),
34
34
  Step.new(8, "Given", "y is 5")
35
- ])
35
+ ]
36
+ )
37
+ scenario.feature = mock('feature', :null_object => true)
36
38
  @visitor.visit_feature_element(scenario)
37
39
 
38
40
  $y.should == nil
@@ -13,7 +13,7 @@ module Cucumber
13
13
  it "should not raise an error when there are no tags" do
14
14
  @tag_occurrences = nil
15
15
 
16
- lambda{print_tag_limit_warnings(:tag_names => {'@wip', 2})}.should_not raise_error
16
+ lambda{print_tag_limit_warnings(:tag_names => {'@wip' => 2})}.should_not raise_error
17
17
  end
18
18
  end
19
19
  end
@@ -13,7 +13,7 @@ module Cucumber
13
13
  @rb = @step_mother.load_programming_language('rb')
14
14
  @dsl = Object.new
15
15
  @dsl.extend RbSupport::RbDsl
16
- @step_mother.before(nil)
16
+ @step_mother.before(mock('scenario', :null_object => true))
17
17
 
18
18
  $inside = nil
19
19
  end
@@ -62,6 +62,15 @@ module Cucumber
62
62
  end.should raise_error(Pending, "Do me!")
63
63
  end
64
64
 
65
+ it "should raise ArityMismatchError when the number of capture groups differs from the number of step arguments" do
66
+ @dsl.Given /No group: \w+/ do |arg|
67
+ end
68
+
69
+ lambda do
70
+ @step_mother.step_match("No group: arg").invoke(nil)
71
+ end.should raise_error(ArityMismatchError)
72
+ end
73
+
65
74
  it "should allow announce" do
66
75
  v = mock('visitor')
67
76
  v.should_receive(:announce).with('wasup')
@@ -89,7 +98,7 @@ module Cucumber
89
98
  it "should recognise quotes in name and make according regexp" do
90
99
  @rb.snippet_text('Given', 'A "first" arg', nil).should == unindented(%{
91
100
  Given /^A "([^\\"]*)" arg$/ do |arg1|
92
- pending
101
+ pending # express the regexp above with the code you wish you had
93
102
  end
94
103
  })
95
104
  end
@@ -97,7 +106,7 @@ module Cucumber
97
106
  it "should recognise several quoted words in name and make according regexp and args" do
98
107
  @rb.snippet_text('Given', 'A "first" and "second" arg', nil).should == unindented(%{
99
108
  Given /^A "([^\\"]*)" and "([^\\"]*)" arg$/ do |arg1, arg2|
100
- pending
109
+ pending # express the regexp above with the code you wish you had
101
110
  end
102
111
  })
103
112
  end
@@ -105,7 +114,7 @@ module Cucumber
105
114
  it "should not use quote group when there are no quotes" do
106
115
  @rb.snippet_text('Given', 'A first arg', nil).should == unindented(%{
107
116
  Given /^A first arg$/ do
108
- pending
117
+ pending # express the regexp above with the code you wish you had
109
118
  end
110
119
  })
111
120
  end
@@ -114,7 +123,7 @@ module Cucumber
114
123
  @rb.snippet_text('Given', 'A "first" arg', Cucumber::Ast::Table).should == unindented(%{
115
124
  Given /^A "([^\\"]*)" arg$/ do |arg1, table|
116
125
  # table is a Cucumber::Ast::Table
117
- pending
126
+ pending # express the regexp above with the code you wish you had
118
127
  end
119
128
  })
120
129
  end
@@ -128,7 +128,7 @@ spec/cucumber/step_mother_spec.rb:48:in `/Three cute (.*)/'
128
128
 
129
129
  it "should implicitly extend world with modules" do
130
130
  @dsl.World(ModuleOne, ModuleTwo)
131
- @step_mother.before(nil)
131
+ @step_mother.before(mock('scenario', :null_object => true))
132
132
  class << @rb.current_world
133
133
  included_modules.index(ModuleOne).should_not == nil
134
134
  included_modules.index(ModuleTwo).should_not == nil
@@ -6,7 +6,7 @@ module Cucumber
6
6
 
7
7
  before(:each) do
8
8
  l = RbSupport::RbLanguage.new(StepMother.new)
9
- l.begin_rb_scenario
9
+ l.begin_rb_scenario(mock('scenario', :null_object => true))
10
10
  @world = l.current_world
11
11
  end
12
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
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-10-28 00:00:00 +01:00
12
+ date: 2009-11-13 00:00:00 +01:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -412,6 +412,7 @@ files:
412
412
  - features/bug_371.feature
413
413
  - features/bug_464.feature
414
414
  - features/bug_475.feature
415
+ - features/call_many_steps.feature
415
416
  - features/cucumber_cli.feature
416
417
  - features/cucumber_cli_diff_disabled.feature
417
418
  - features/cucumber_cli_outlines.feature
@@ -523,10 +524,14 @@ files:
523
524
  - lib/cucumber/language_support/language_methods.rb
524
525
  - lib/cucumber/languages.yml
525
526
  - lib/cucumber/parser.rb
527
+ - lib/cucumber/parser/common.rb
528
+ - lib/cucumber/parser/common.tt
526
529
  - lib/cucumber/parser/feature.rb
527
530
  - lib/cucumber/parser/feature.tt
528
531
  - lib/cucumber/parser/i18n.tt
529
532
  - lib/cucumber/parser/natural_language.rb
533
+ - lib/cucumber/parser/py_string.rb
534
+ - lib/cucumber/parser/py_string.tt
530
535
  - lib/cucumber/parser/table.rb
531
536
  - lib/cucumber/parser/table.tt
532
537
  - lib/cucumber/parser/treetop_ext.rb
@@ -638,7 +643,7 @@ post_install_message: |+
638
643
 
639
644
  (::) U P G R A D I N G (::)
640
645
 
641
- Thank you for installing cucumber-0.4.3.
646
+ Thank you for installing cucumber-0.4.4.
642
647
  Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
643
648
  for important information about this release. Happy cuking!
644
649