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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@fails_on_1_8_7
|
|
2
|
+
Feature: Nested Steps in I18n
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Background:
|
|
6
|
+
Given a scenario with a step that looks like this in japanese:
|
|
7
|
+
"""gherkin
|
|
8
|
+
前提 two turtles
|
|
9
|
+
"""
|
|
10
|
+
And a step definition that looks like this:
|
|
11
|
+
"""ruby
|
|
12
|
+
# -*- coding: utf-8 -*-
|
|
13
|
+
前提 /a turtle/ do
|
|
14
|
+
puts "turtle!"
|
|
15
|
+
end
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
Scenario: Use #steps to call several steps at once
|
|
19
|
+
Given a step definition that looks like this:
|
|
20
|
+
"""ruby
|
|
21
|
+
# -*- coding: utf-8 -*-
|
|
22
|
+
前提 /two turtles/ do
|
|
23
|
+
steps %{
|
|
24
|
+
前提 a turtle
|
|
25
|
+
かつ a turtle
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
"""
|
|
29
|
+
When I run the feature with the progress formatter
|
|
30
|
+
Then the output should contain:
|
|
31
|
+
"""
|
|
32
|
+
turtle!
|
|
33
|
+
|
|
34
|
+
turtle!
|
|
35
|
+
|
|
36
|
+
"""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Feature: Pretty output formatter
|
|
2
|
+
|
|
3
|
+
Background:
|
|
4
|
+
Given a file named "features/scenario_outline_with_undefined_steps.feature" with:
|
|
5
|
+
"""
|
|
6
|
+
Feature:
|
|
7
|
+
|
|
8
|
+
Scenario Outline:
|
|
9
|
+
Given an undefined step
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
|foo|
|
|
13
|
+
|bar|
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
Scenario: an scenario outline, one undefined step, one random example, expand flag on
|
|
17
|
+
When I run `cucumber features/scenario_outline_with_undefined_steps.feature --format pretty --expand `
|
|
18
|
+
Then it should pass
|
|
19
|
+
|
|
20
|
+
Scenario: when using a profile the output should include 'Using the default profile...'
|
|
21
|
+
And a file named "cucumber.yml" with:
|
|
22
|
+
"""
|
|
23
|
+
default: -r features
|
|
24
|
+
"""
|
|
25
|
+
When I run `cucumber --profile default --format pretty`
|
|
26
|
+
Then it should pass
|
|
27
|
+
And the output should contain:
|
|
28
|
+
"""
|
|
29
|
+
Using the default profile...
|
|
30
|
+
"""
|
|
31
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Feature: Progress output formatter
|
|
2
|
+
|
|
3
|
+
Background:
|
|
4
|
+
Given a file named "features/scenario_outline_with_undefined_steps.feature" with:
|
|
5
|
+
"""
|
|
6
|
+
Feature:
|
|
7
|
+
|
|
8
|
+
Scenario Outline:
|
|
9
|
+
Given an undefined step
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
|foo|
|
|
13
|
+
|bar|
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
Scenario: an scenario outline, one undefined step, one random example, expand flag on
|
|
17
|
+
When I run `cucumber features/scenario_outline_with_undefined_steps.feature --format progress --expand `
|
|
18
|
+
Then it should pass
|
|
19
|
+
|
|
20
|
+
Scenario: when using a profile the output should include 'Using the default profile...'
|
|
21
|
+
And a file named "cucumber.yml" with:
|
|
22
|
+
"""
|
|
23
|
+
default: -r features
|
|
24
|
+
"""
|
|
25
|
+
When I run `cucumber --profile default --format progress`
|
|
26
|
+
Then it should pass
|
|
27
|
+
And the output should contain:
|
|
28
|
+
"""
|
|
29
|
+
Using the default profile...
|
|
30
|
+
"""
|
|
31
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@spawn
|
|
2
|
+
Feature: Raketask
|
|
3
|
+
In order to use cucumber's rake task
|
|
4
|
+
As a Cuker
|
|
5
|
+
I do not want to see rake's backtraces when it fails
|
|
6
|
+
Also I want to get zero exit status code on failures
|
|
7
|
+
And non-zero exit status code when is pases
|
|
8
|
+
|
|
9
|
+
Background:
|
|
10
|
+
Given a file named "features/passing_and_failing.feature" with:
|
|
11
|
+
"""
|
|
12
|
+
Feature: Sample
|
|
13
|
+
|
|
14
|
+
Scenario: Passing
|
|
15
|
+
Given passing
|
|
16
|
+
|
|
17
|
+
Scenario: Failing
|
|
18
|
+
Given failing
|
|
19
|
+
"""
|
|
20
|
+
Given a file named "features/step_definitions/steps.rb" with:
|
|
21
|
+
"""
|
|
22
|
+
Given(/^passing$/) do
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
Given /^failing$/ do
|
|
26
|
+
raise "FAIL"
|
|
27
|
+
end
|
|
28
|
+
"""
|
|
29
|
+
Given a file named "Rakefile" with:
|
|
30
|
+
"""
|
|
31
|
+
require 'cucumber/rake/task'
|
|
32
|
+
|
|
33
|
+
SAMPLE_FEATURE_FILE = 'features/passing_and_failing.feature'
|
|
34
|
+
|
|
35
|
+
Cucumber::Rake::Task.new(:pass) do |t|
|
|
36
|
+
t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:3"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
Cucumber::Rake::Task.new(:fail) do |t|
|
|
40
|
+
t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:6"
|
|
41
|
+
end
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
Scenario: Passing feature
|
|
45
|
+
When I run `bundle exec rake pass`
|
|
46
|
+
Then the exit status should be 0
|
|
47
|
+
|
|
48
|
+
Scenario: Failing feature
|
|
49
|
+
When I run `bundle exec rake fail`
|
|
50
|
+
Then the exit status should not be 0
|
|
51
|
+
And the output should not contain "rake aborted!"
|
|
@@ -27,7 +27,7 @@ Feature: Rerun formatter
|
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
Scenario: Handle examples with the rerun formatter
|
|
30
|
-
When I run cucumber
|
|
30
|
+
When I run `cucumber features/one_passing_one_failing.feature -r features -f rerun`
|
|
31
31
|
Then it should fail with:
|
|
32
32
|
"""
|
|
33
33
|
features/one_passing_one_failing.feature:9
|
|
@@ -12,6 +12,7 @@ Feature: Usage formatter
|
|
|
12
12
|
Given B
|
|
13
13
|
Scenario Outline: C
|
|
14
14
|
Given <x>
|
|
15
|
+
And B
|
|
15
16
|
Examples:
|
|
16
17
|
|x|
|
|
17
18
|
|C|
|
|
@@ -31,22 +32,24 @@ Feature: Usage formatter
|
|
|
31
32
|
When I run `cucumber -f usage --dry-run`
|
|
32
33
|
Then it should pass with exactly:
|
|
33
34
|
"""
|
|
34
|
-
|
|
35
|
+
---------
|
|
35
36
|
|
|
36
|
-
/A/
|
|
37
|
-
Given A
|
|
38
|
-
Given A
|
|
39
|
-
Given A
|
|
40
|
-
Given A
|
|
41
|
-
/B/
|
|
42
|
-
Given B
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
/A/ # features/step_definitions/steps.rb:1
|
|
38
|
+
Given A # features/f.feature:3
|
|
39
|
+
Given A # features/f.feature:3
|
|
40
|
+
Given A # features/f.feature:3
|
|
41
|
+
Given A # features/f.feature:13
|
|
42
|
+
/B/ # features/step_definitions/steps.rb:2
|
|
43
|
+
Given B # features/f.feature:5
|
|
44
|
+
And B # features/f.feature:8
|
|
45
|
+
/C/ # features/step_definitions/steps.rb:3
|
|
46
|
+
Given <x> # features/f.feature:7
|
|
47
|
+
Given C # features/f.feature:14
|
|
48
|
+
/D/ # features/step_definitions/steps.rb:4
|
|
46
49
|
NOT MATCHED BY ANY STEPS
|
|
47
50
|
|
|
48
51
|
3 scenarios (3 skipped)
|
|
49
|
-
|
|
52
|
+
8 steps (8 skipped)
|
|
50
53
|
0m0.012s
|
|
51
54
|
|
|
52
55
|
"""
|
|
@@ -55,7 +58,7 @@ Feature: Usage formatter
|
|
|
55
58
|
When I run `cucumber -f stepdefs --dry-run`
|
|
56
59
|
Then it should pass with exactly:
|
|
57
60
|
"""
|
|
58
|
-
|
|
61
|
+
---------
|
|
59
62
|
|
|
60
63
|
/A/ # features/step_definitions/steps.rb:1
|
|
61
64
|
/B/ # features/step_definitions/steps.rb:2
|
|
@@ -64,7 +67,7 @@ Feature: Usage formatter
|
|
|
64
67
|
NOT MATCHED BY ANY STEPS
|
|
65
68
|
|
|
66
69
|
3 scenarios (3 skipped)
|
|
67
|
-
|
|
70
|
+
8 steps (8 skipped)
|
|
68
71
|
0m0.012s
|
|
69
72
|
|
|
70
73
|
"""
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
When /^I run cucumber "(.+)"$/ do |cmd|
|
|
2
|
-
run_simple(unescape("cucumber #{cmd}"), false)
|
|
3
|
-
end
|
|
4
|
-
|
|
5
1
|
Then 'it should pass' do
|
|
6
2
|
assert_exit_status 0
|
|
7
3
|
end
|
|
@@ -43,6 +39,12 @@ Given /^a scenario with a step that looks like this:$/ do |string|
|
|
|
43
39
|
end
|
|
44
40
|
end
|
|
45
41
|
|
|
42
|
+
Given(/^a scenario with a step that looks like this in japanese:$/) do |string|
|
|
43
|
+
create_feature_ja do
|
|
44
|
+
create_scenario_ja { string }
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
46
48
|
Given /^a step definition that looks like this:$/ do |string|
|
|
47
49
|
create_step_definition { string }
|
|
48
50
|
end
|
data/features/support/env.rb
CHANGED
|
@@ -1,28 +1,55 @@
|
|
|
1
1
|
ENV['FORCE_COLOR'] = 'true'
|
|
2
|
+
|
|
3
|
+
require 'aruba'
|
|
2
4
|
require 'aruba/api'
|
|
3
5
|
require 'aruba/cucumber'
|
|
6
|
+
require 'aruba/in_process'
|
|
7
|
+
require 'aruba/spawn_process'
|
|
8
|
+
require 'cucumber/rspec/disable_option_parser'
|
|
9
|
+
require 'cucumber/cli/main'
|
|
4
10
|
|
|
5
11
|
# Monkey patch aruba to filter out some stuff
|
|
6
12
|
module Aruba::Api
|
|
7
13
|
alias __all_stdout all_stdout
|
|
8
|
-
|
|
14
|
+
|
|
9
15
|
def all_stdout
|
|
10
16
|
unrandom(__all_stdout)
|
|
11
17
|
end
|
|
12
18
|
|
|
19
|
+
alias __all_stderr all_stderr
|
|
20
|
+
def all_stderr
|
|
21
|
+
err = __all_stderr
|
|
22
|
+
if Cucumber::JRUBY
|
|
23
|
+
# TODO: this actually a workaround for cucumber/gherkin#238
|
|
24
|
+
err = err.gsub(/^.*java_package_module_template.rb:\d+ warning: `eval' should not be aliased.*\n/, '')
|
|
25
|
+
end
|
|
26
|
+
err
|
|
27
|
+
end
|
|
28
|
+
|
|
13
29
|
def unrandom(out)
|
|
14
30
|
out = out.gsub(/#{Dir.pwd}\/tmp\/aruba/, '.') # Remove absolute paths
|
|
31
|
+
out = out.gsub(/tmp\/aruba\//, '') # Fix aruba path
|
|
32
|
+
out = out.gsub(/^.*cucumber_process\.rb.*$\n/, '')
|
|
15
33
|
out = out.gsub(/^\d+m\d+\.\d+s$/, '0m0.012s') # Make duration predictable
|
|
16
34
|
out = out.gsub(/Coverage report generated for Cucumber Features to #{Dir.pwd}\/coverage.*\n$/, '') # Remove SimpleCov message
|
|
17
35
|
end
|
|
18
36
|
end
|
|
19
37
|
|
|
38
|
+
Before('@spawn') do
|
|
39
|
+
Aruba.process = Aruba::SpawnProcess
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Before('~@spawn') do
|
|
43
|
+
Aruba::InProcess.main_class = Cucumber::Cli::Main
|
|
44
|
+
Aruba.process = Aruba::InProcess
|
|
45
|
+
end
|
|
46
|
+
|
|
20
47
|
Before do
|
|
21
48
|
# Make sure bin/cucumber runs with SimpleCov enabled
|
|
22
49
|
# set_env('SIMPLECOV', 'true')
|
|
23
|
-
|
|
24
|
-
# Set a longer timeout for aruba
|
|
25
|
-
@aruba_timeout_seconds = 15
|
|
50
|
+
|
|
51
|
+
# Set a longer timeout for aruba, and a really long one if running on JRuby
|
|
52
|
+
@aruba_timeout_seconds = Cucumber::JRUBY ? 35 : 15
|
|
26
53
|
end
|
|
27
54
|
|
|
28
55
|
After do
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
1
2
|
module FeatureFactory
|
|
2
3
|
def create_feature(name = generate_feature_name)
|
|
3
4
|
gherkin = <<-GHERKIN
|
|
@@ -7,6 +8,15 @@ Feature: #{name}
|
|
|
7
8
|
write_file filename(name), gherkin
|
|
8
9
|
end
|
|
9
10
|
|
|
11
|
+
def create_feature_ja(name = generate_feature_name)
|
|
12
|
+
gherkin = <<-GHERKIN
|
|
13
|
+
# language: ja
|
|
14
|
+
機能: #{name}
|
|
15
|
+
#{yield}
|
|
16
|
+
GHERKIN
|
|
17
|
+
write_file filename(name), gherkin
|
|
18
|
+
end
|
|
19
|
+
|
|
10
20
|
def create_scenario(name = generate_scenario_name)
|
|
11
21
|
<<-GHERKIN
|
|
12
22
|
Scenario: #{name}
|
|
@@ -14,6 +24,13 @@ Feature: #{name}
|
|
|
14
24
|
GHERKIN
|
|
15
25
|
end
|
|
16
26
|
|
|
27
|
+
def create_scenario_ja(name = generate_scenario_name)
|
|
28
|
+
<<-GHERKIN
|
|
29
|
+
シナリオ: #{name}
|
|
30
|
+
#{yield}
|
|
31
|
+
GHERKIN
|
|
32
|
+
end
|
|
33
|
+
|
|
17
34
|
def create_step_definition
|
|
18
35
|
write_file generate_step_definition_filename, yield
|
|
19
36
|
end
|
|
@@ -1,217 +1,59 @@
|
|
|
1
|
-
Feature:
|
|
2
|
-
In order to conveniently run subsets of features
|
|
3
|
-
As a Cuker
|
|
4
|
-
I want to select features using logical AND/OR of tags
|
|
1
|
+
Feature: Tagged hooks
|
|
5
2
|
|
|
6
3
|
Background:
|
|
7
|
-
Given a file named "features/
|
|
4
|
+
Given a file named "features/step_definitions/steps.rb" with:
|
|
8
5
|
"""
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@one @three
|
|
12
|
-
Scenario: Example
|
|
13
|
-
Given passing
|
|
14
|
-
|
|
15
|
-
@one
|
|
16
|
-
Scenario: Another Example
|
|
17
|
-
Given passing
|
|
18
|
-
|
|
19
|
-
@three
|
|
20
|
-
Scenario: Yet another Example
|
|
21
|
-
Given passing
|
|
22
|
-
|
|
23
|
-
@ignore
|
|
24
|
-
Scenario: And yet another Example
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
Scenario: Before hooks ORing
|
|
28
|
-
Given a file named "features/support/hooks.rb" with:
|
|
29
|
-
"""
|
|
30
|
-
Before('@one,@three') do
|
|
31
|
-
raise 'boom'
|
|
32
|
-
end
|
|
33
|
-
"""
|
|
34
|
-
When I run `cucumber -q features/tagulicious.feature`
|
|
35
|
-
Then it should fail with:
|
|
36
|
-
"""
|
|
37
|
-
Feature: Sample
|
|
38
|
-
|
|
39
|
-
@one @three
|
|
40
|
-
Scenario: Example
|
|
41
|
-
boom (RuntimeError)
|
|
42
|
-
./features/support/hooks.rb:2:in `Before'
|
|
43
|
-
Given passing
|
|
44
|
-
|
|
45
|
-
@one
|
|
46
|
-
Scenario: Another Example
|
|
47
|
-
boom (RuntimeError)
|
|
48
|
-
./features/support/hooks.rb:2:in `Before'
|
|
49
|
-
Given passing
|
|
50
|
-
|
|
51
|
-
@three
|
|
52
|
-
Scenario: Yet another Example
|
|
53
|
-
boom (RuntimeError)
|
|
54
|
-
./features/support/hooks.rb:2:in `Before'
|
|
55
|
-
Given passing
|
|
56
|
-
|
|
57
|
-
@ignore
|
|
58
|
-
Scenario: And yet another Example
|
|
59
|
-
|
|
60
|
-
Failing Scenarios:
|
|
61
|
-
cucumber features/tagulicious.feature:4
|
|
62
|
-
cucumber features/tagulicious.feature:8
|
|
63
|
-
cucumber features/tagulicious.feature:12
|
|
64
|
-
|
|
65
|
-
4 scenarios (3 failed, 1 passed)
|
|
66
|
-
3 steps (3 undefined)
|
|
67
|
-
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
Scenario: Before hooks ANDing
|
|
71
|
-
Given a file named "features/support/hooks.rb" with:
|
|
72
|
-
"""
|
|
73
|
-
Before('@one','@three') do
|
|
74
|
-
raise 'boom'
|
|
75
|
-
end
|
|
76
|
-
"""
|
|
77
|
-
When I run `cucumber -q features/tagulicious.feature`
|
|
78
|
-
Then it should fail with:
|
|
79
|
-
"""
|
|
80
|
-
Feature: Sample
|
|
81
|
-
|
|
82
|
-
@one @three
|
|
83
|
-
Scenario: Example
|
|
84
|
-
boom (RuntimeError)
|
|
85
|
-
./features/support/hooks.rb:2:in `Before'
|
|
86
|
-
Given passing
|
|
87
|
-
|
|
88
|
-
@one
|
|
89
|
-
Scenario: Another Example
|
|
90
|
-
Given passing
|
|
91
|
-
|
|
92
|
-
@three
|
|
93
|
-
Scenario: Yet another Example
|
|
94
|
-
Given passing
|
|
95
|
-
|
|
96
|
-
@ignore
|
|
97
|
-
Scenario: And yet another Example
|
|
98
|
-
|
|
99
|
-
Failing Scenarios:
|
|
100
|
-
cucumber features/tagulicious.feature:4
|
|
101
|
-
|
|
102
|
-
4 scenarios (1 failed, 2 undefined, 1 passed)
|
|
103
|
-
3 steps (3 undefined)
|
|
104
|
-
|
|
6
|
+
Given /^this step works$/ do; end
|
|
105
7
|
"""
|
|
106
|
-
|
|
107
|
-
Scenario: Before hooks ANDing with a bad hook matching nothing
|
|
108
|
-
Given a file named "features/support/hooks.rb" with:
|
|
8
|
+
And a file named "features/support/hooks.rb" with:
|
|
109
9
|
"""
|
|
110
|
-
Before('
|
|
10
|
+
Before('~@no-boom') do
|
|
111
11
|
raise 'boom'
|
|
112
12
|
end
|
|
113
13
|
"""
|
|
114
|
-
|
|
115
|
-
Then it should pass with:
|
|
116
|
-
"""
|
|
117
|
-
Feature: Sample
|
|
118
|
-
|
|
119
|
-
@one @three
|
|
120
|
-
Scenario: Example
|
|
121
|
-
Given passing
|
|
122
|
-
|
|
123
|
-
@one
|
|
124
|
-
Scenario: Another Example
|
|
125
|
-
Given passing
|
|
126
|
-
|
|
127
|
-
@three
|
|
128
|
-
Scenario: Yet another Example
|
|
129
|
-
Given passing
|
|
130
|
-
|
|
131
|
-
@ignore
|
|
132
|
-
Scenario: And yet another Example
|
|
133
|
-
|
|
134
|
-
4 scenarios (3 undefined, 1 passed)
|
|
135
|
-
3 steps (3 undefined)
|
|
136
|
-
|
|
14
|
+
And a file named "features/f.feature" with:
|
|
137
15
|
"""
|
|
16
|
+
Feature: With and without hooks
|
|
17
|
+
Scenario: using hook
|
|
18
|
+
Given this step works
|
|
138
19
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
After('@one,@three') do
|
|
143
|
-
raise 'boom'
|
|
144
|
-
end
|
|
20
|
+
@no-boom
|
|
21
|
+
Scenario: omitting hook
|
|
22
|
+
Given this step works
|
|
145
23
|
"""
|
|
146
|
-
|
|
24
|
+
@spawn
|
|
25
|
+
Scenario: omit tagged hook
|
|
26
|
+
When I run `cucumber features/f.feature:2`
|
|
147
27
|
Then it should fail with:
|
|
148
28
|
"""
|
|
149
|
-
Feature:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
@one
|
|
158
|
-
Scenario: Another Example
|
|
159
|
-
Given passing
|
|
160
|
-
boom (RuntimeError)
|
|
161
|
-
./features/support/hooks.rb:2:in `After'
|
|
162
|
-
|
|
163
|
-
@three
|
|
164
|
-
Scenario: Yet another Example
|
|
165
|
-
Given passing
|
|
166
|
-
boom (RuntimeError)
|
|
167
|
-
./features/support/hooks.rb:2:in `After'
|
|
168
|
-
|
|
169
|
-
@ignore
|
|
170
|
-
Scenario: And yet another Example
|
|
171
|
-
|
|
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
|
+
|
|
172
36
|
Failing Scenarios:
|
|
173
|
-
cucumber features/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
4 scenarios (3 failed, 1 passed)
|
|
178
|
-
3 steps (3 undefined)
|
|
37
|
+
cucumber features/f.feature:2 # Scenario: using hook
|
|
38
|
+
|
|
39
|
+
1 scenario (1 failed)
|
|
40
|
+
1 step (1 skipped)
|
|
179
41
|
|
|
180
42
|
"""
|
|
181
43
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
end
|
|
188
|
-
"""
|
|
189
|
-
When I run `cucumber -q features/tagulicious.feature`
|
|
190
|
-
Then it should fail with:
|
|
191
|
-
"""
|
|
192
|
-
Feature: Sample
|
|
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
|
|
193
49
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
boom (RuntimeError)
|
|
198
|
-
./features/support/hooks.rb:2:in `After'
|
|
50
|
+
@no-boom
|
|
51
|
+
Scenario: omitting hook # features/f.feature:6
|
|
52
|
+
Given this step works # features/step_definitions/steps.rb:1
|
|
199
53
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Given passing
|
|
54
|
+
1 scenario (1 passed)
|
|
55
|
+
1 step (1 passed)
|
|
203
56
|
|
|
204
|
-
|
|
205
|
-
Scenario: Yet another Example
|
|
206
|
-
Given passing
|
|
207
|
-
|
|
208
|
-
@ignore
|
|
209
|
-
Scenario: And yet another Example
|
|
210
|
-
|
|
211
|
-
Failing Scenarios:
|
|
212
|
-
cucumber features/tagulicious.feature:4
|
|
57
|
+
"""
|
|
213
58
|
|
|
214
|
-
4 scenarios (1 failed, 2 undefined, 1 passed)
|
|
215
|
-
3 steps (3 undefined)
|
|
216
59
|
|
|
217
|
-
"""
|