cucumber 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -6
- data/CONTRIBUTING.md +3 -1
- data/Gemfile +1 -1
- data/History.md +17 -0
- data/README.md +3 -3
- data/bin/cucumber +1 -2
- data/cucumber.gemspec +2 -2
- data/examples/i18n/ht/features/adisyon.feature +7 -7
- data/features/docs/api/listen_for_events.feature +58 -0
- data/features/docs/cli/fail_fast.feature +46 -0
- data/features/docs/defining_steps/nested_steps_with_second_arg.feature +3 -22
- data/features/docs/extending_cucumber/custom_formatter.feature +40 -4
- data/features/docs/gherkin/doc_strings.feature +5 -5
- data/features/docs/gherkin/language_help.feature +15 -15
- data/features/docs/gherkin/using_descriptions.feature +0 -5
- data/lib/cucumber/cli/configuration.rb +10 -92
- data/lib/cucumber/cli/main.rb +1 -7
- data/lib/cucumber/cli/options.rb +47 -12
- data/lib/cucumber/configuration.rb +195 -7
- data/lib/cucumber/events.rb +20 -0
- data/lib/cucumber/events/after_test_case.rb +25 -0
- data/lib/cucumber/events/after_test_step.rb +30 -0
- data/lib/cucumber/events/before_test_case.rb +18 -0
- data/lib/cucumber/events/before_test_step.rb +23 -0
- data/lib/cucumber/events/bus.rb +86 -0
- data/lib/cucumber/events/step_match.rb +23 -0
- data/lib/cucumber/filters/prepare_world.rb +2 -2
- data/lib/cucumber/formatter/backtrace_filter.rb +9 -8
- data/lib/cucumber/formatter/console.rb +1 -1
- data/lib/cucumber/formatter/event_bus_report.rb +37 -0
- data/lib/cucumber/formatter/fail_fast.rb +18 -0
- data/lib/cucumber/formatter/html.rb +1 -1
- data/lib/cucumber/formatter/io.rb +3 -1
- data/lib/cucumber/formatter/json.rb +19 -1
- data/lib/cucumber/formatter/legacy_api/adapter.rb +5 -13
- data/lib/cucumber/formatter/legacy_api/ast.rb +2 -2
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +3 -1
- data/lib/cucumber/formatter/pretty.rb +5 -7
- data/lib/cucumber/formatter/progress.rb +1 -1
- data/lib/cucumber/formatter/rerun.rb +1 -1
- data/lib/cucumber/formatter/steps.rb +1 -1
- data/lib/cucumber/formatter/usage.rb +12 -8
- data/lib/cucumber/gherkin/data_table_parser.rb +23 -0
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +99 -0
- data/lib/cucumber/gherkin/formatter/argument.rb +17 -0
- data/lib/cucumber/gherkin/formatter/escaping.rb +17 -0
- data/lib/cucumber/gherkin/formatter/hashable.rb +27 -0
- data/lib/cucumber/gherkin/i18n.rb +15 -0
- data/lib/cucumber/gherkin/steps_parser.rb +41 -0
- data/lib/cucumber/language_support/language_methods.rb +6 -5
- data/lib/cucumber/multiline_argument.rb +0 -3
- data/lib/cucumber/multiline_argument/data_table.rb +6 -5
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -2
- data/lib/cucumber/platform.rb +1 -1
- data/lib/cucumber/rake/task.rb +2 -2
- data/lib/cucumber/rb_support/rb_hook.rb +1 -6
- data/lib/cucumber/rb_support/rb_language.rb +15 -5
- data/lib/cucumber/rb_support/rb_step_definition.rb +11 -17
- data/lib/cucumber/rb_support/rb_world.rb +6 -4
- data/lib/cucumber/rb_support/regexp_argument_matcher.rb +2 -2
- data/lib/cucumber/runtime.rb +36 -16
- data/lib/cucumber/runtime/support_code.rb +19 -15
- data/lib/cucumber/step_definition_light.rb +5 -5
- data/lib/cucumber/step_definitions.rb +2 -2
- data/lib/cucumber/step_match.rb +11 -2
- data/lib/cucumber/wire_support/wire_protocol/requests.rb +2 -2
- data/lib/cucumber/wire_support/wire_step_definition.rb +4 -2
- data/{spec → lib}/simplecov_setup.rb +0 -0
- data/spec/cucumber/cli/configuration_spec.rb +2 -104
- data/spec/cucumber/cli/main_spec.rb +0 -22
- data/spec/cucumber/cli/options_spec.rb +3 -1
- data/spec/cucumber/configuration_spec.rb +123 -0
- data/spec/cucumber/events/bus_spec.rb +94 -0
- data/spec/cucumber/formatter/event_bus_report_spec.rb +79 -0
- data/spec/cucumber/formatter/fail_fast_spec.rb +88 -0
- data/spec/cucumber/formatter/json_spec.rb +43 -1
- data/spec/cucumber/formatter/rerun_spec.rb +4 -20
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +29 -0
- data/spec/cucumber/runtime_spec.rb +2 -28
- data/spec/spec_helper.rb +1 -1
- data/spec/support/standard_step_actions.rb +18 -0
- metadata +37 -13
- data/lib/cucumber/core_ext/proc.rb +0 -36
- data/spec/cucumber/core_ext/proc_spec.rb +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4396d10625822b4e94db4edbb67438e3e4394dae
|
4
|
+
data.tar.gz: 45960cc6f1cf3e3189dfd4f4ab5ac27c8ff8e4a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac22570755b443d4f1cdb9a546d46f92283722d1cc799bb59274dd9cc476b0c609a471247ea7d1c7a2d8598d6d0d5e41c2efef49ce10b150e4337109d4cc998f
|
7
|
+
data.tar.gz: 125c07dddc5d0039333c677860a93820103871c9db3c3bba57d23496d4c07879208178c3a929d84c74bff15a14a4618cf7c12162c242d83e7b2533bc0261e357
|
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -60,7 +60,9 @@ Current release managers:
|
|
60
60
|
* [Aslak Hellesøy](https://rubygems.org/profiles/aslakhellesoy)
|
61
61
|
* [Oleg Sukhodolsky](https://rubygems.org/profiles/os97673)
|
62
62
|
* [Steve Tooke](https://rubygems.org/profiles/tooky)
|
63
|
+
* [Björn Rasmusson](https://rubygems.org/profiles/brasmusson)
|
63
64
|
|
64
|
-
To grant release karma, issue the following
|
65
|
+
To grant release karma, issue the following commands:
|
65
66
|
|
66
67
|
gem owner cucumber --add <NEW OWNER RUBYGEMS EMAIL>
|
68
|
+
gem owner cucumber-core --add <NEW OWNER RUBYGEMS EMAIL>
|
data/Gemfile
CHANGED
@@ -6,6 +6,6 @@ unless ENV['CUCUMBER_USE_RELEASED_CORE']
|
|
6
6
|
if File.exist?(core_path) && !ENV['CUCUMBER_USE_GIT_CORE']
|
7
7
|
gem 'cucumber-core', :path => core_path
|
8
8
|
else
|
9
|
-
gem 'cucumber-core', :git => "git://github.com/cucumber/cucumber-ruby-core.git"
|
9
|
+
gem 'cucumber-core', :git => "git://github.com/cucumber/cucumber-ruby-core.git", branch: "integrate-gherkin3-parser"
|
10
10
|
end
|
11
11
|
end
|
data/History.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v2.0.2...master)
|
2
2
|
|
3
|
+
### New Features
|
4
|
+
|
5
|
+
* Introduce EventBus ([903](https://github.com/cucumber/cucumber-ruby/pull/903) @mattwynne @tooky)
|
6
|
+
* Fail-fast CLI switch ([906](https://github.com/cucumber/cucumber-ruby/pull/906) @danascheider)
|
7
|
+
|
8
|
+
### Bugfixes
|
9
|
+
|
10
|
+
* When only an around hook is failing, let the Json Formatter include the around hook result ([909](https://github.com/cucumber/cucumber-ruby/issues/909) @brasmusson).
|
11
|
+
|
12
|
+
### Refactoring
|
13
|
+
|
14
|
+
* Coveralls badge switch to SVG ([897](https://github.com/cucumber/cucumber-ruby/pull/897) @nickmerwin)
|
15
|
+
* Moved simplecov_setup into lib folder ([896](https://github.com/cucumber/cucumber-ruby/pull/896) @tboerger)
|
16
|
+
* Pass DocString as String ([891](https://github.com/cucumber/cucumber-ruby/pull/891) @aslakhellesoy)
|
17
|
+
* Remove core_ext/proc.rb and use Proc#source_location instead ([888](https://github.com/cucumber/cucumber-ruby/pull/888) @brasmusson)
|
18
|
+
* Move behaviour from `Cucumber::Cli::Configuration` to `Cucumber::Configuration` (@tooky, @mattwynne)
|
19
|
+
* Integrate Gherkin3 parser ([884](https://github.com/cucumber/cucumber-ruby/pull/884) (@brassmusson)
|
3
20
|
|
4
21
|
## [v2.0.2](https://github.com/cucumber/cucumber-ruby/compare/v2.0.1...v2.0.2)
|
5
22
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Join the chat at https://gitter.im/cucumber/cucumber-ruby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/cucumber-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://secure.travis-ci.org/cucumber/cucumber-ruby.png)](http://travis-ci.org/cucumber/cucumber-ruby) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.png)](https://codeclimate.com/github/cucumber/cucumber-ruby) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.
|
1
|
+
[![Join the chat at https://gitter.im/cucumber/cucumber-ruby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/cucumber-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://secure.travis-ci.org/cucumber/cucumber-ruby.png)](http://travis-ci.org/cucumber/cucumber-ruby) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.png)](https://codeclimate.com/github/cucumber/cucumber-ruby) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master) [![Dependency Status](https://gemnasium.com/cucumber/cucumber-ruby.png)](https://gemnasium.com/cucumber/cucumber-ruby)
|
2
2
|
|
3
3
|
# Cucumber
|
4
4
|
|
@@ -12,10 +12,10 @@ Where to get more info:
|
|
12
12
|
|
13
13
|
* The main website: https://cucumber.io/
|
14
14
|
* Documentation: https://github.com/cucumber/cucumber/wiki
|
15
|
-
* Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber/
|
15
|
+
* Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber-ruby/
|
16
16
|
* Support forum: https://groups.google.com/group/cukes
|
17
17
|
* Developer chat: https://gitter.im/cucumber/cucumber-ruby
|
18
|
-
*
|
18
|
+
* User chat: https://gitter.im/cucumber/chat
|
19
19
|
|
20
20
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber.
|
21
21
|
|
data/bin/cucumber
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'simplecov_setup'
|
6
5
|
require 'cucumber/rspec/disable_option_parser'
|
7
6
|
require 'cucumber/cli/main'
|
8
7
|
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
|
data/cucumber.gemspec
CHANGED
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.platform = Gem::Platform::RUBY
|
15
15
|
s.required_ruby_version = ">= 1.9.3"
|
16
16
|
|
17
|
-
s.add_dependency 'cucumber-core', '~> 1.
|
17
|
+
s.add_dependency 'cucumber-core', '~> 1.3.0'
|
18
18
|
s.add_dependency 'builder', '>= 2.1.2'
|
19
19
|
s.add_dependency 'diff-lcs', '>= 1.1.3'
|
20
|
-
s.add_dependency '
|
20
|
+
s.add_dependency 'gherkin3', '~> 3.1.0'
|
21
21
|
s.add_dependency 'multi_json', '>= 1.7.5', '< 2.0'
|
22
22
|
s.add_dependency 'multi_test', '>= 0.1.2'
|
23
23
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# language: ht
|
2
|
-
Karakteristik: Adisyon
|
3
|
-
Nan lòd pou fè pou evite erè komik
|
4
|
-
Kòm yon moun sòt nan matematik
|
2
|
+
Karakteristik: Adisyon
|
3
|
+
Nan lòd pou fè pou evite erè komik
|
4
|
+
Kòm yon moun sòt nan matematik
|
5
5
|
Mwen ta vle yo dim sòm total nan antre de nimero
|
6
6
|
|
7
7
|
Plan Senaryo: ajoute de nimero
|
8
|
-
Sipoze mwen te antre <input_1> nan kalkilatris la
|
9
|
-
Epi mwen te antre <input_2> nan kalkilatris la
|
10
|
-
Lè
|
11
|
-
|
8
|
+
Sipoze mwen te antre <input_1> nan kalkilatris la
|
9
|
+
Epi mwen te antre <input_2> nan kalkilatris la
|
10
|
+
Lè mwen peze <button>
|
11
|
+
Lè sa a rezilta a ta dwe <output> sou ekran an
|
12
12
|
|
13
13
|
Egzanp:
|
14
14
|
| input_1 | input_2 | button | output |
|
@@ -0,0 +1,58 @@
|
|
1
|
+
Feature: Listen for events
|
2
|
+
|
3
|
+
Scenario: Step Matched Event
|
4
|
+
Given a file named "features/test.feature" with:
|
5
|
+
"""
|
6
|
+
Feature:
|
7
|
+
Scenario:
|
8
|
+
Given matching
|
9
|
+
"""
|
10
|
+
And a file named "features/step_definitions/steps.rb" with:
|
11
|
+
"""
|
12
|
+
Given(/matching/) do
|
13
|
+
end
|
14
|
+
"""
|
15
|
+
And a file named "features/support/my_listener.rb" with:
|
16
|
+
"""
|
17
|
+
AfterConfiguration do |config|
|
18
|
+
io = config.out_stream
|
19
|
+
config.on_event Cucumber::Events::StepMatch do |event|
|
20
|
+
io.puts "Success!"
|
21
|
+
io.puts "Event type: #{event.class}"
|
22
|
+
io.puts "Step name: #{event.test_step.name}"
|
23
|
+
io.puts "Source location: #{event.step_match.location}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
"""
|
27
|
+
When I run `cucumber`
|
28
|
+
Then it should pass with:
|
29
|
+
"""
|
30
|
+
Success!
|
31
|
+
Event type: Cucumber::Events::StepMatch
|
32
|
+
Step name: matching
|
33
|
+
Source location: features/step_definitions/steps.rb:1
|
34
|
+
"""
|
35
|
+
|
36
|
+
Scenario: After Test Step event
|
37
|
+
Given a file named "features/test.feature" with:
|
38
|
+
"""
|
39
|
+
Feature:
|
40
|
+
Scenario:
|
41
|
+
Given passing
|
42
|
+
"""
|
43
|
+
And the standard step definitions
|
44
|
+
And a file named "features/support/my_listener.rb" with:
|
45
|
+
"""
|
46
|
+
AfterConfiguration do |config|
|
47
|
+
io = config.out_stream
|
48
|
+
config.on_event Cucumber::Events::AfterTestStep do |event|
|
49
|
+
io.puts "YO"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
"""
|
53
|
+
When I run `cucumber`
|
54
|
+
Then it should pass with:
|
55
|
+
"""
|
56
|
+
YO
|
57
|
+
"""
|
58
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
@spawn
|
2
|
+
Feature: Fail fast
|
3
|
+
|
4
|
+
The --fail-fast flag causes Cucumber to exit immediately after the first
|
5
|
+
scenario fails.
|
6
|
+
|
7
|
+
Scenario: When a scenario fails
|
8
|
+
Given a file named "features/bad.feature" with:
|
9
|
+
"""
|
10
|
+
Feature: Bad
|
11
|
+
Scenario: Failing
|
12
|
+
Given this step fails
|
13
|
+
"""
|
14
|
+
And a file named "features/good.feature" with:
|
15
|
+
"""
|
16
|
+
Feature: Good
|
17
|
+
Scenario: Passing
|
18
|
+
Given this step passes
|
19
|
+
"""
|
20
|
+
And the standard step definitions
|
21
|
+
When I run `cucumber --fail-fast`
|
22
|
+
Then it should fail
|
23
|
+
And the output should contain:
|
24
|
+
"""
|
25
|
+
1 scenario (1 failed)
|
26
|
+
"""
|
27
|
+
|
28
|
+
Scenario: When all the scenarios pass
|
29
|
+
Given a file named "features/first.feature" with:
|
30
|
+
"""
|
31
|
+
Feature: first feature
|
32
|
+
Scenario: foo first
|
33
|
+
Given this step passes
|
34
|
+
Scenario: bar first
|
35
|
+
Given this step passes
|
36
|
+
"""
|
37
|
+
And a file named "features/second.feature" with:
|
38
|
+
"""
|
39
|
+
Feature: second
|
40
|
+
Scenario: foo second
|
41
|
+
Given this step passes
|
42
|
+
Scenario: bar second
|
43
|
+
Given this step passes
|
44
|
+
"""
|
45
|
+
When I run `cucumber --fail-fast`
|
46
|
+
Then it should pass
|
@@ -34,7 +34,7 @@ Feature: Nested Steps with either table or doc string
|
|
34
34
|
|
35
35
|
"""
|
36
36
|
|
37
|
-
Scenario: Use #step with
|
37
|
+
Scenario: Use #step with Doc String
|
38
38
|
Given a step definition that looks like this:
|
39
39
|
"""ruby
|
40
40
|
Given /two turtles/ do
|
@@ -44,30 +44,11 @@ Feature: Nested Steps with either table or doc string
|
|
44
44
|
And a step definition that looks like this:
|
45
45
|
"""ruby
|
46
46
|
Given /turtles:/ do |text|
|
47
|
-
puts text
|
47
|
+
puts "#{text}:#{text.class}"
|
48
48
|
end
|
49
49
|
"""
|
50
50
|
When I run the feature with the progress formatter
|
51
51
|
Then the output should contain:
|
52
52
|
"""
|
53
|
-
Sturm and Lioville
|
54
|
-
"""
|
55
|
-
|
56
|
-
Scenario: Use #step with docstring and content-type
|
57
|
-
Given a step definition that looks like this:
|
58
|
-
"""ruby
|
59
|
-
Given /two turtles/ do
|
60
|
-
step %{turtles:}, doc_string('Sturm and Lioville','math')
|
61
|
-
end
|
62
|
-
"""
|
63
|
-
And a step definition that looks like this:
|
64
|
-
"""ruby
|
65
|
-
Given /turtles:/ do |text|
|
66
|
-
puts text.content_type
|
67
|
-
end
|
68
|
-
"""
|
69
|
-
When I run the feature with the progress formatter
|
70
|
-
Then the output should contain:
|
71
|
-
"""
|
72
|
-
math
|
53
|
+
Sturm and Lioville:String
|
73
54
|
"""
|
@@ -9,13 +9,47 @@ Feature: Custom Formatter
|
|
9
9
|
"""
|
10
10
|
And the standard step definitions
|
11
11
|
|
12
|
-
Scenario:
|
12
|
+
Scenario: Subscribe to result events
|
13
|
+
|
14
|
+
This is the recommended way to format output.
|
15
|
+
|
13
16
|
Given a file named "features/support/custom_formatter.rb" with:
|
14
17
|
"""
|
15
18
|
module MyCustom
|
16
19
|
class Formatter
|
17
|
-
def initialize(
|
18
|
-
@io =
|
20
|
+
def initialize(config)
|
21
|
+
@io = config.out_stream
|
22
|
+
config.on_event Cucumber::Events::BeforeTestCase do |event|
|
23
|
+
print_test_case_name(event.test_case)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def print_test_case_name(test_case)
|
28
|
+
feature = test_case.source.first
|
29
|
+
scenario = test_case.source.last
|
30
|
+
@io.puts feature.short_name.upcase
|
31
|
+
@io.puts " #{scenario.name.upcase}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
"""
|
36
|
+
When I run `cucumber features/f.feature --format MyCustom::Formatter`
|
37
|
+
Then it should pass with exactly:
|
38
|
+
"""
|
39
|
+
I'LL USE MY OWN
|
40
|
+
JUST PRINT ME
|
41
|
+
|
42
|
+
"""
|
43
|
+
|
44
|
+
Scenario: Implement v2.0 formatter methods
|
45
|
+
Note that this method is likely to be deprecated in favour of events - see above.
|
46
|
+
|
47
|
+
Given a file named "features/support/custom_formatter.rb" with:
|
48
|
+
"""
|
49
|
+
module MyCustom
|
50
|
+
class Formatter
|
51
|
+
def initialize(config)
|
52
|
+
@io = config.out_stream
|
19
53
|
end
|
20
54
|
|
21
55
|
def before_test_case(test_case)
|
@@ -36,6 +70,8 @@ Feature: Custom Formatter
|
|
36
70
|
"""
|
37
71
|
|
38
72
|
Scenario: Use the legacy API
|
73
|
+
This is deprecated and should no longer be used.
|
74
|
+
|
39
75
|
Given a file named "features/support/custom_legacy_formatter.rb" with:
|
40
76
|
"""
|
41
77
|
module MyCustom
|
@@ -62,7 +98,7 @@ Feature: Custom Formatter
|
|
62
98
|
|
63
99
|
"""
|
64
100
|
|
65
|
-
Scenario: Use both
|
101
|
+
Scenario: Use both old and new
|
66
102
|
You can use a specific shim to opt-in to both APIs at once.
|
67
103
|
|
68
104
|
Given a file named "features/support/custom_mixed_formatter.rb" with:
|
@@ -53,22 +53,22 @@ Feature: Doc strings
|
|
53
53
|
Three
|
54
54
|
"""
|
55
55
|
|
56
|
-
Scenario: DocString
|
56
|
+
Scenario: DocString passed as String
|
57
57
|
Given a scenario with a step that looks like this:
|
58
58
|
"""gherkin
|
59
59
|
Given I have some code for you:
|
60
|
-
\"\"\"
|
61
|
-
|
60
|
+
\"\"\"
|
61
|
+
hello
|
62
62
|
\"\"\"
|
63
63
|
"""
|
64
64
|
And a step definition that looks like this:
|
65
65
|
"""ruby
|
66
66
|
Given /code/ do |text|
|
67
|
-
puts text.
|
67
|
+
puts text.class
|
68
68
|
end
|
69
69
|
"""
|
70
70
|
When I run the feature with the progress formatter
|
71
71
|
Then the output should contain:
|
72
72
|
"""
|
73
|
-
|
73
|
+
String
|
74
74
|
"""
|
@@ -14,21 +14,21 @@ Feature: Language help
|
|
14
14
|
When I run `cucumber --i18n pt help`
|
15
15
|
Then it should pass with:
|
16
16
|
"""
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
17
|
+
| feature | "Funcionalidade", "Característica", "Caracteristica" |
|
18
|
+
| background | "Contexto", "Cenário de Fundo", "Cenario de Fundo", "Fundo" |
|
19
|
+
| scenario | "Cenário", "Cenario" |
|
20
|
+
| scenario_outline | "Esquema do Cenário", "Esquema do Cenario", "Delineação do Cenário", "Delineacao do Cenario" |
|
21
|
+
| examples | "Exemplos", "Cenários", "Cenarios" |
|
22
|
+
| given | "* ", "Dado ", "Dada ", "Dados ", "Dadas " |
|
23
|
+
| when | "* ", "Quando " |
|
24
|
+
| then | "* ", "Então ", "Entao " |
|
25
|
+
| and | "* ", "E " |
|
26
|
+
| but | "* ", "Mas " |
|
27
|
+
| given (code) | "Dado", "Dada", "Dados", "Dadas" |
|
28
|
+
| when (code) | "Quando" |
|
29
|
+
| then (code) | "Então", "Entao" |
|
30
|
+
| and (code) | "E" |
|
31
|
+
| but (code) | "Mas" |
|
32
32
|
|
33
33
|
"""
|
34
34
|
|
@@ -54,28 +54,23 @@ Feature: Using descriptions to give features context
|
|
54
54
|
Then it should pass with exactly:
|
55
55
|
"""
|
56
56
|
Feature: descriptions everywhere
|
57
|
-
|
58
57
|
We can put a useful description here of the feature, which can
|
59
58
|
span multiple lines.
|
60
59
|
|
61
60
|
Background:
|
62
|
-
|
63
61
|
We can also put in descriptions showing what the background is
|
64
62
|
doing.
|
65
63
|
Given this step passes
|
66
64
|
|
67
65
|
Scenario: I'm a scenario with a description
|
68
|
-
|
69
66
|
You can also put descriptions in front of individual scenarios.
|
70
67
|
Given this step passes
|
71
68
|
|
72
69
|
Scenario Outline: I'm a scenario outline with a description
|
73
|
-
|
74
70
|
Scenario outlines can have descriptions.
|
75
71
|
Given this step <state>
|
76
72
|
|
77
73
|
Examples: Examples
|
78
|
-
|
79
74
|
Specific examples for an outline are allowed to have
|
80
75
|
descriptions, too.
|
81
76
|
| state |
|