cucumber 1.2.5 → 1.3.0
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.
- checksums.yaml +14 -6
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +1 -0
- data/.yardopts +1 -0
- data/CONTRIBUTING.md +2 -2
- data/History.md +38 -2
- data/bin/cucumber +2 -11
- data/cucumber.gemspec +3 -3
- data/cucumber.yml +5 -1
- data/examples/test_unit/Gemfile +4 -0
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +1 -4
- data/examples/watir/README.textile +2 -2
- data/examples/watir/features/support/env.rb +10 -7
- data/features/.cucumber/stepdefs.json +747 -1354
- data/features/assertions.feature +6 -2
- data/features/background.feature +3 -0
- data/features/backtraces.feature +3 -3
- data/features/before_hook.feature +43 -0
- data/features/bootstrap.feature +14 -2
- data/features/custom_formatter.feature +1 -1
- data/features/drb_server_integration.feature +3 -3
- data/features/formatter_callbacks.feature +2 -2
- data/features/formatter_step_file_colon_line.feature +1 -1
- data/features/html_formatter.feature +52 -1
- data/features/json_formatter.feature +93 -7
- data/features/load_path.feature +14 -0
- data/features/nested_steps.feature +75 -3
- data/features/nested_steps_i18n.feature +36 -0
- data/features/pretty_formatter.feature +31 -0
- data/features/progress_formatter.feature +31 -0
- data/features/raketask.feature +51 -0
- data/features/rerun_formatter.feature +1 -1
- data/features/stats_formatters.feature +17 -14
- data/features/step_definitions/cucumber_steps.rb +6 -4
- data/features/support/env.rb +31 -4
- data/features/support/feature_factory.rb +17 -0
- data/features/tagged_hooks.feature +37 -195
- data/features/transforms.feature +15 -15
- data/gem_tasks/cucumber.rake +2 -0
- data/gem_tasks/yard.rake +10 -6
- data/legacy_features/README.md +14 -0
- data/legacy_features/language_help.feature +3 -1
- data/legacy_features/report_called_undefined_steps.feature +1 -0
- data/legacy_features/snippets_when_using_star_keyword.feature +1 -0
- data/legacy_features/support/env.rb +4 -0
- data/lib/cucumber/ast/background.rb +35 -35
- data/lib/cucumber/ast/empty_background.rb +33 -0
- data/lib/cucumber/ast/examples.rb +5 -2
- data/lib/cucumber/ast/feature.rb +24 -35
- data/lib/cucumber/ast/features.rb +4 -1
- data/lib/cucumber/ast/has_steps.rb +9 -17
- data/lib/cucumber/ast/location.rb +41 -0
- data/lib/cucumber/ast/scenario.rb +37 -50
- data/lib/cucumber/ast/scenario_outline.rb +62 -49
- data/lib/cucumber/ast/step.rb +23 -27
- data/lib/cucumber/ast/step_collection.rb +16 -0
- data/lib/cucumber/ast/step_invocation.rb +4 -1
- data/lib/cucumber/ast/tree_walker.rb +7 -0
- data/lib/cucumber/cli/configuration.rb +15 -3
- data/lib/cucumber/cli/main.rb +24 -11
- data/lib/cucumber/cli/options.rb +24 -16
- data/lib/cucumber/configuration.rb +4 -0
- data/lib/cucumber/core_ext/disable_mini_and_test_unit_autorun.rb +10 -34
- data/lib/cucumber/core_ext/instance_exec.rb +4 -1
- data/lib/cucumber/core_ext/proc.rb +2 -0
- data/lib/cucumber/feature_file.rb +5 -12
- data/lib/cucumber/formatter/console.rb +10 -0
- data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +4 -4
- data/lib/cucumber/formatter/html.rb +7 -42
- data/lib/cucumber/formatter/interceptor.rb +4 -0
- data/lib/cucumber/formatter/json_pretty.rb +0 -4
- data/lib/cucumber/formatter/junit.rb +8 -2
- data/lib/cucumber/formatter/pretty.rb +5 -1
- data/lib/cucumber/formatter/progress.rb +4 -0
- data/lib/cucumber/formatter/unicode.rb +12 -25
- data/lib/cucumber/formatter/usage.rb +7 -2
- data/lib/cucumber/js_support/js_snippets.rb +1 -1
- data/lib/cucumber/load_path.rb +13 -0
- data/lib/cucumber/parser/gherkin_builder.rb +237 -81
- data/lib/cucumber/platform.rb +1 -1
- data/lib/cucumber/py_support/py_language.rb +1 -1
- data/lib/cucumber/rake/task.rb +5 -1
- data/lib/cucumber/rb_support/rb_language.rb +20 -19
- data/lib/cucumber/rb_support/rb_world.rb +63 -21
- data/lib/cucumber/rb_support/snippet.rb +108 -0
- data/lib/cucumber/runtime.rb +1 -0
- data/lib/cucumber/runtime/support_code.rb +2 -2
- data/lib/cucumber/unit.rb +11 -0
- data/lib/cucumber/wire_support/wire_language.rb +1 -1
- data/spec/cucumber/ast/background_spec.rb +13 -6
- data/spec/cucumber/ast/feature_factory.rb +20 -10
- data/spec/cucumber/ast/features_spec.rb +51 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +13 -7
- data/spec/cucumber/ast/step_spec.rb +6 -4
- data/spec/cucumber/cli/configuration_spec.rb +34 -1
- data/spec/cucumber/cli/main_spec.rb +36 -26
- data/spec/cucumber/cli/options_spec.rb +28 -19
- data/spec/cucumber/core_ext/proc_spec.rb +13 -1
- data/spec/cucumber/formatter/interceptor_spec.rb +8 -0
- data/spec/cucumber/formatter/junit_spec.rb +33 -0
- data/spec/cucumber/formatter/pretty_spec.rb +391 -0
- data/spec/cucumber/rb_support/rb_language_spec.rb +21 -50
- data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +2 -4
- data/spec/cucumber/rb_support/snippet_spec.rb +128 -0
- data/spec/cucumber/step_match_spec.rb +2 -6
- metadata +62 -113
- data/.rvmrc +0 -1
- data/features/hooks.feature +0 -59
- data/legacy_features/call_steps_from_stepdefs.feature +0 -154
data/.rvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rvm gemset use cucumber --create
|
data/features/hooks.feature
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
Feature: Tagged hooks
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given a file named "features/step_definitions/steps.rb" with:
|
|
5
|
-
"""
|
|
6
|
-
Given /^this step works$/ do; end
|
|
7
|
-
"""
|
|
8
|
-
And a file named "features/support/hooks.rb" with:
|
|
9
|
-
"""
|
|
10
|
-
Before('~@no-boom') do
|
|
11
|
-
raise 'boom'
|
|
12
|
-
end
|
|
13
|
-
"""
|
|
14
|
-
And a file named "features/f.feature" with:
|
|
15
|
-
"""
|
|
16
|
-
Feature: With and without hooks
|
|
17
|
-
Scenario: using hook
|
|
18
|
-
Given this step works
|
|
19
|
-
|
|
20
|
-
@no-boom
|
|
21
|
-
Scenario: omitting hook
|
|
22
|
-
Given this step works
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
Scenario: omit tagged hook
|
|
26
|
-
When I run `cucumber features/f.feature:2`
|
|
27
|
-
Then it should fail with:
|
|
28
|
-
"""
|
|
29
|
-
Feature: With and without hooks
|
|
30
|
-
|
|
31
|
-
Scenario: using hook # features/f.feature:2
|
|
32
|
-
boom (RuntimeError)
|
|
33
|
-
./features/support/hooks.rb:2:in `Before'
|
|
34
|
-
Given this step works # features/step_definitions/steps.rb:1
|
|
35
|
-
|
|
36
|
-
Failing Scenarios:
|
|
37
|
-
cucumber features/f.feature:2 # Scenario: using hook
|
|
38
|
-
|
|
39
|
-
1 scenario (1 failed)
|
|
40
|
-
1 step (1 skipped)
|
|
41
|
-
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
Scenario: omit tagged hook
|
|
45
|
-
When I run `cucumber features/f.feature:6`
|
|
46
|
-
Then it should pass with:
|
|
47
|
-
"""
|
|
48
|
-
Feature: With and without hooks
|
|
49
|
-
|
|
50
|
-
@no-boom
|
|
51
|
-
Scenario: omitting hook # features/f.feature:6
|
|
52
|
-
Given this step works # features/step_definitions/steps.rb:1
|
|
53
|
-
|
|
54
|
-
1 scenario (1 passed)
|
|
55
|
-
1 step (1 passed)
|
|
56
|
-
|
|
57
|
-
"""
|
|
58
|
-
|
|
59
|
-
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
Feature: http://gist.github.com/221223
|
|
2
|
-
In order to make it easier to extract several steps from
|
|
3
|
-
a feature file to a step definition I want to be able to
|
|
4
|
-
copy and paste.
|
|
5
|
-
|
|
6
|
-
Background:
|
|
7
|
-
Given a standard Cucumber project directory structure
|
|
8
|
-
And a file named "features/f.feature" with:
|
|
9
|
-
"""
|
|
10
|
-
Feature: Test
|
|
11
|
-
|
|
12
|
-
Scenario: Multiline string
|
|
13
|
-
Given a multiline string:
|
|
14
|
-
\"\"\"
|
|
15
|
-
hello
|
|
16
|
-
world
|
|
17
|
-
\"\"\"
|
|
18
|
-
|
|
19
|
-
Scenario: Call a multiline string
|
|
20
|
-
Given I call a multiline string with MAMA
|
|
21
|
-
|
|
22
|
-
Scenario: Call a table
|
|
23
|
-
Given I call a table with MAMA
|
|
24
|
-
|
|
25
|
-
Scenario: Call a multiline string using keyword
|
|
26
|
-
Given I use keyword to call a multiline string with BANG
|
|
27
|
-
"""
|
|
28
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
29
|
-
"""
|
|
30
|
-
And /^a multiline string:$/ do |s| x=1
|
|
31
|
-
raise "I got multiline:\n#{s}"
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
Given /^a table:$/ do |t| x=1
|
|
35
|
-
raise "I got table:\n#{t.raw.inspect}"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
Given /^I call a multiline string with (.*)$/ do |s| x=1
|
|
39
|
-
steps %Q{
|
|
40
|
-
And a multiline string:
|
|
41
|
-
\"\"\"
|
|
42
|
-
hello
|
|
43
|
-
#{s}
|
|
44
|
-
\"\"\"
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Given /^I use keyword to call a multiline string with (.*)$/ do |s| x=1
|
|
49
|
-
step 'a multiline string:', "Hello\n#{s}"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
Given /^I call a table with (.*)$/ do |s| x=1
|
|
53
|
-
steps %Q{
|
|
54
|
-
Given a table:
|
|
55
|
-
|a|b|
|
|
56
|
-
|c|#{s}|
|
|
57
|
-
}
|
|
58
|
-
end
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
Scenario: Multiline string
|
|
62
|
-
When I run cucumber features/f.feature:3
|
|
63
|
-
Then STDERR should be empty
|
|
64
|
-
And it should fail with
|
|
65
|
-
"""
|
|
66
|
-
Feature: Test
|
|
67
|
-
|
|
68
|
-
Scenario: Multiline string # features/f.feature:3
|
|
69
|
-
Given a multiline string: # features/step_definitions/steps.rb:1
|
|
70
|
-
\"\"\"
|
|
71
|
-
hello
|
|
72
|
-
world
|
|
73
|
-
\"\"\"
|
|
74
|
-
I got multiline:
|
|
75
|
-
hello
|
|
76
|
-
world (RuntimeError)
|
|
77
|
-
./features/step_definitions/steps.rb:2:in `/^a multiline string:$/'
|
|
78
|
-
features/f.feature:4:in `Given a multiline string:'
|
|
79
|
-
|
|
80
|
-
Failing Scenarios:
|
|
81
|
-
cucumber features/f.feature:3 # Scenario: Multiline string
|
|
82
|
-
|
|
83
|
-
1 scenario (1 failed)
|
|
84
|
-
1 step (1 failed)
|
|
85
|
-
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
Scenario: Call multiline string
|
|
89
|
-
When I run cucumber features/f.feature:10
|
|
90
|
-
Then STDERR should be empty
|
|
91
|
-
And it should fail with
|
|
92
|
-
"""
|
|
93
|
-
Feature: Test
|
|
94
|
-
|
|
95
|
-
Scenario: Call a multiline string # features/f.feature:10
|
|
96
|
-
Given I call a multiline string with MAMA # features/step_definitions/steps.rb:9
|
|
97
|
-
I got multiline:
|
|
98
|
-
hello
|
|
99
|
-
MAMA (RuntimeError)
|
|
100
|
-
./features/step_definitions/steps.rb:2:in `/^a multiline string:$/'
|
|
101
|
-
features/f.feature:11:in `Given I call a multiline string with MAMA'
|
|
102
|
-
|
|
103
|
-
Failing Scenarios:
|
|
104
|
-
cucumber features/f.feature:10 # Scenario: Call a multiline string
|
|
105
|
-
|
|
106
|
-
1 scenario (1 failed)
|
|
107
|
-
1 step (1 failed)
|
|
108
|
-
|
|
109
|
-
"""
|
|
110
|
-
|
|
111
|
-
Scenario: Call table
|
|
112
|
-
When I run cucumber features/f.feature:13
|
|
113
|
-
Then STDERR should be empty
|
|
114
|
-
And it should fail with
|
|
115
|
-
"""
|
|
116
|
-
Feature: Test
|
|
117
|
-
|
|
118
|
-
Scenario: Call a table # features/f.feature:13
|
|
119
|
-
Given I call a table with MAMA # features/step_definitions/steps.rb:23
|
|
120
|
-
I got table:
|
|
121
|
-
[["a", "b"], ["c", "MAMA"]] (RuntimeError)
|
|
122
|
-
./features/step_definitions/steps.rb:6:in `/^a table:$/'
|
|
123
|
-
features/f.feature:14:in `Given I call a table with MAMA'
|
|
124
|
-
|
|
125
|
-
Failing Scenarios:
|
|
126
|
-
cucumber features/f.feature:13 # Scenario: Call a table
|
|
127
|
-
|
|
128
|
-
1 scenario (1 failed)
|
|
129
|
-
1 step (1 failed)
|
|
130
|
-
|
|
131
|
-
"""
|
|
132
|
-
|
|
133
|
-
Scenario: Call multiline string with keyword
|
|
134
|
-
When I run cucumber features/f.feature:16
|
|
135
|
-
Then STDERR should be empty
|
|
136
|
-
And it should fail with
|
|
137
|
-
"""
|
|
138
|
-
Feature: Test
|
|
139
|
-
|
|
140
|
-
Scenario: Call a multiline string using keyword # features/f.feature:16
|
|
141
|
-
Given I use keyword to call a multiline string with BANG # features/step_definitions/steps.rb:19
|
|
142
|
-
I got multiline:
|
|
143
|
-
Hello
|
|
144
|
-
BANG (RuntimeError)
|
|
145
|
-
./features/step_definitions/steps.rb:2:in `/^a multiline string:$/'
|
|
146
|
-
features/f.feature:17:in `Given I use keyword to call a multiline string with BANG'
|
|
147
|
-
|
|
148
|
-
Failing Scenarios:
|
|
149
|
-
cucumber features/f.feature:16 # Scenario: Call a multiline string using keyword
|
|
150
|
-
|
|
151
|
-
1 scenario (1 failed)
|
|
152
|
-
1 step (1 failed)
|
|
153
|
-
|
|
154
|
-
"""
|