aslakhellesoy-cucumber 0.1.99.4 → 0.1.99.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -1
- data/Manifest.txt +2 -10
- data/cucumber.yml +1 -0
- data/examples/cs/README.textile +1 -0
- data/examples/cs/Rakefile +12 -0
- data/examples/cs/compile.bat +1 -0
- data/examples/cs/features/addition.feature +16 -0
- data/examples/cs/features/step_definitons/calculator_steps.rb +19 -0
- data/examples/cs/src/demo/Calculator.cs +20 -0
- data/examples/dos_line_endings/Rakefile +6 -0
- data/examples/dos_line_endings/features/dos_line_endings.feature +9 -0
- data/examples/i18n/README.textile +18 -0
- data/examples/i18n/Rakefile +32 -0
- data/examples/i18n/ar/Rakefile +6 -0
- data/examples/i18n/ar/features/addition.feature +17 -0
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +28 -0
- data/examples/i18n/ar/lib/calculator.rb +10 -0
- data/examples/i18n/da/Rakefile +6 -0
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/da/features/summering.feature +17 -0
- data/examples/i18n/da/lib/kalkulator.rb +11 -0
- data/examples/i18n/de/Rakefile +6 -0
- data/examples/i18n/de/features/addition.feature +16 -0
- data/examples/i18n/de/features/division.feature +9 -0
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/de/lib/calculator.rb +14 -0
- data/examples/i18n/en/Rakefile +6 -0
- data/examples/i18n/en/features/addition.feature +16 -0
- data/examples/i18n/en/features/division.feature +9 -0
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/en/lib/calculator.rb +14 -0
- data/examples/i18n/es/Rakefile +6 -0
- data/examples/i18n/es/features/adicion.feature +17 -0
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +24 -0
- data/examples/i18n/es/lib/calculador.rb +11 -0
- data/examples/i18n/et/Rakefile +6 -0
- data/examples/i18n/et/features/liitmine.feature +17 -0
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +24 -0
- data/examples/i18n/et/lib/kalkulaator.rb +10 -0
- data/examples/i18n/fi/Rakefile +6 -0
- data/examples/i18n/fi/features/jakolasku.feature +9 -0
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
- data/examples/i18n/fi/features/yhteenlasku.feature +16 -0
- data/examples/i18n/fi/lib/laskin.rb +14 -0
- data/examples/i18n/fr/Rakefile +6 -0
- data/examples/i18n/fr/features/addition.feature +15 -0
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +27 -0
- data/examples/i18n/fr/lib/calculatrice.rb +10 -0
- data/examples/i18n/id/Rakefile +6 -0
- data/examples/i18n/id/features/addition.feature +16 -0
- data/examples/i18n/id/features/division.feature +9 -0
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/id/lib/calculator.rb +14 -0
- data/examples/i18n/it/Rakefile +6 -0
- data/examples/i18n/it/features/somma.feature +10 -0
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +24 -0
- data/examples/i18n/it/lib/calcolatrice.rb +11 -0
- data/examples/i18n/ja/README.txt +5 -0
- data/examples/i18n/ja/Rakefile +6 -0
- data/examples/i18n/ja/features/addition.feature +16 -0
- data/examples/i18n/ja/features/division.feature +9 -0
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ja/lib/calculator.rb +14 -0
- data/examples/i18n/ko/Rakefile +6 -0
- data/examples/i18n/ko/features/addition.feature +16 -0
- data/examples/i18n/ko/features/division.feature +10 -0
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ko/lib/calculator.rb +14 -0
- data/examples/i18n/lt/Rakefile +6 -0
- data/examples/i18n/lt/features/addition.feature +17 -0
- data/examples/i18n/lt/features/division.feature +9 -0
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/lt/lib/calculator.rb +14 -0
- data/examples/i18n/no/Rakefile +6 -0
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/no/features/summering.feature +18 -0
- data/examples/i18n/no/lib/kalkulator.rb +11 -0
- data/examples/i18n/pt/Rakefile +6 -0
- data/examples/i18n/pt/features/adicao.feature +10 -0
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +24 -0
- data/examples/i18n/pt/lib/calculadora.rb +10 -0
- data/examples/i18n/ro/Rakefile +6 -0
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/ro/features/suma.feature +10 -0
- data/examples/i18n/ro/lib/calculator.rb +11 -0
- data/examples/i18n/se/Rakefile +6 -0
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +24 -0
- data/examples/i18n/se/features/summering.feature +17 -0
- data/examples/i18n/se/lib/kalkulator.rb +11 -0
- data/examples/i18n/zh-CN/Rakefile +6 -0
- data/examples/i18n/zh-CN/features/addition.feature +17 -0
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +26 -0
- data/examples/i18n/zh-CN/lib/calculator.rb +10 -0
- data/examples/java/README.textile +22 -0
- data/examples/java/Rakefile +12 -0
- data/examples/java/features/hello.feature +11 -0
- data/examples/java/features/step_definitons/hello_steps.rb +25 -0
- data/examples/java/features/step_definitons/tree_steps.rb +14 -0
- data/examples/java/features/tree.feature +9 -0
- data/examples/java/src/cucumber/demo/Hello.java +16 -0
- data/examples/jbehave/README.textile +17 -0
- data/examples/jbehave/features/support/env.rb +7 -0
- data/examples/jbehave/features/trading.feature +24 -0
- data/examples/jbehave/pom.xml +48 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +32 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +42 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +29 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +22 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +65 -0
- data/examples/selenium/Rakefile +6 -0
- data/examples/selenium/features/search.feature +9 -0
- data/examples/selenium/features/step_definitons/stories_steps.rb +40 -0
- data/examples/self_test/README.textile +6 -0
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
- data/examples/self_test/features/lots_of_undefined.feature +8 -0
- data/examples/self_test/features/outline_sample.feature +15 -0
- data/examples/self_test/features/sample.feature +16 -0
- data/examples/self_test/features/step_definitions/sample_steps.rb +25 -0
- data/examples/test_unit/Rakefile +6 -0
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +26 -0
- data/examples/test_unit/features/test_unit.feature +9 -0
- data/examples/tickets/Rakefile +11 -0
- data/examples/tickets/cucumber.yml +2 -0
- data/examples/tickets/features/lib/eatting_machine.rb +18 -0
- data/examples/tickets/features/lib/pantry.rb +20 -0
- data/examples/tickets/features/scenario_outline.feature +95 -0
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
- data/examples/tickets/features/step_definitons/tickets_steps.rb +60 -0
- data/examples/tickets/features/tickets.feature +28 -0
- data/examples/watir/README.textile +16 -0
- data/examples/watir/Rakefile +6 -0
- data/examples/watir/features/search.feature +9 -0
- data/examples/watir/features/step_definitons/search_steps.rb +24 -0
- data/examples/watir/features/support/env.rb +32 -0
- data/features/cucumber_cli.feature +331 -0
- data/features/cucumber_cli_outlines.feature +90 -0
- data/features/report_called_undefined_steps.feature +32 -0
- data/features/step_definitions/cucumber_steps.rb +31 -0
- data/features/step_definitions/extra_steps.rb +2 -0
- data/features/support/env.rb +7 -0
- data/gem_tasks/deployment.rake +11 -0
- data/gem_tasks/environment.rake +7 -0
- data/gem_tasks/features.rake +6 -0
- data/gem_tasks/fix_cr_lf.rake +10 -0
- data/gem_tasks/flog.rake +4 -0
- data/gem_tasks/gemspec.rake +10 -0
- data/gem_tasks/rspec.rake +35 -0
- data/gem_tasks/yard.rake +8 -0
- data/lib/autotest/cucumber.rb +6 -0
- data/lib/autotest/cucumber_mixin.rb +124 -0
- data/lib/autotest/cucumber_rails.rb +6 -0
- data/lib/autotest/cucumber_rails_rspec.rb +6 -0
- data/lib/autotest/cucumber_rspec.rb +6 -0
- data/lib/autotest/discover.rb +9 -0
- data/lib/cucumber.rb +72 -0
- data/lib/cucumber/ast.rb +27 -0
- data/lib/cucumber/ast/comment.rb +26 -0
- data/lib/cucumber/ast/examples.rb +22 -0
- data/lib/cucumber/ast/feature.rb +60 -0
- data/lib/cucumber/ast/features.rb +39 -0
- data/lib/cucumber/ast/filter.rb +22 -0
- data/lib/cucumber/ast/outline_table.rb +49 -0
- data/lib/cucumber/ast/py_string.rb +52 -0
- data/lib/cucumber/ast/scenario.rb +95 -0
- data/lib/cucumber/ast/scenario_outline.rb +83 -0
- data/lib/cucumber/ast/step.rb +139 -0
- data/lib/cucumber/ast/table.rb +214 -0
- data/lib/cucumber/ast/tags.rb +33 -0
- data/lib/cucumber/ast/visitor.rb +93 -0
- data/lib/cucumber/broadcaster.rb +15 -0
- data/lib/cucumber/cli.rb +414 -0
- data/lib/cucumber/core_ext/exception.rb +53 -0
- data/lib/cucumber/core_ext/instance_exec.rb +54 -0
- data/lib/cucumber/core_ext/proc.rb +33 -0
- data/lib/cucumber/core_ext/string.rb +48 -0
- data/lib/cucumber/formatter.rb +1 -0
- data/lib/cucumber/formatter/ansicolor.rb +106 -0
- data/lib/cucumber/formatter/console.rb +116 -0
- data/lib/cucumber/formatter/pretty.rb +158 -0
- data/lib/cucumber/formatter/profile.rb +77 -0
- data/lib/cucumber/formatter/progress.rb +68 -0
- data/lib/cucumber/formatter/rerun.rb +35 -0
- data/lib/cucumber/formatters/unicode.rb +2 -0
- data/lib/cucumber/jbehave.rb +104 -0
- data/lib/cucumber/languages.yml +314 -0
- data/lib/cucumber/parser.rb +24 -0
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +1351 -0
- data/lib/cucumber/parser/feature.tt +160 -0
- data/lib/cucumber/parser/i18n.tt +27 -0
- data/lib/cucumber/parser/table.rb +396 -0
- data/lib/cucumber/parser/table.tt +53 -0
- data/lib/cucumber/parser/treetop_ext.rb +67 -0
- data/lib/cucumber/platform.rb +18 -0
- data/lib/cucumber/rails/rspec.rb +5 -0
- data/lib/cucumber/rails/world.rb +73 -0
- data/lib/cucumber/rake/task.rb +106 -0
- data/lib/cucumber/step_definition.rb +87 -0
- data/lib/cucumber/step_mother.rb +164 -0
- data/lib/cucumber/version.rb +10 -0
- data/pretty.txt +486 -0
- data/rails_generators/cucumber/USAGE +11 -0
- data/rails_generators/cucumber/cucumber_generator.rb +31 -0
- data/rails_generators/cucumber/templates/cucumber +8 -0
- data/rails_generators/cucumber/templates/cucumber.rake +7 -0
- data/rails_generators/cucumber/templates/env.rb +16 -0
- data/rails_generators/cucumber/templates/paths.rb +12 -0
- data/rails_generators/cucumber/templates/webrat_steps.rb +99 -0
- data/rails_generators/feature/USAGE +12 -0
- data/rails_generators/feature/feature_generator.rb +36 -0
- data/rails_generators/feature/templates/feature.erb +31 -0
- data/rails_generators/feature/templates/steps.erb +24 -0
- data/spec/cucumber/ast/feature_factory.rb +54 -0
- data/spec/cucumber/ast/feature_spec.rb +60 -0
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +64 -0
- data/spec/cucumber/ast/scenario_spec.rb +82 -0
- data/spec/cucumber/ast/step_spec.rb +45 -0
- data/spec/cucumber/ast/table_spec.rb +81 -0
- data/spec/cucumber/broadcaster_spec.rb +14 -0
- data/spec/cucumber/cli_spec.rb +416 -0
- data/spec/cucumber/core_ext/proc_spec.rb +37 -0
- data/spec/cucumber/core_ext/string_spec.rb +42 -0
- data/spec/cucumber/formatter/ansicolor_spec.rb +35 -0
- data/spec/cucumber/formatter/html/cucumber.css +37 -0
- data/spec/cucumber/formatter/html/cucumber.js +13 -0
- data/spec/cucumber/formatter/html/index.html +45 -0
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
- data/spec/cucumber/formatters/profile_formatter_spec.rb +198 -0
- data/spec/cucumber/parser/feature_parser_spec.rb +247 -0
- data/spec/cucumber/parser/table_parser_spec.rb +48 -0
- data/spec/cucumber/rails/stubs/mini_rails.rb +18 -0
- data/spec/cucumber/rails/stubs/test_help.rb +1 -0
- data/spec/cucumber/rails/world_spec.rb +11 -0
- data/spec/cucumber/sell_cucumbers.feature +19 -0
- data/spec/cucumber/step_definition_spec.rb +62 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
- data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
- data/spec/cucumber/treetop_parser/fit_scenario.feature +8 -0
- data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
- data/spec/cucumber/treetop_parser/multiline_steps.feature +17 -0
- data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
- data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
- data/spec/cucumber/treetop_parser/spaces.feature +12 -0
- data/spec/cucumber/treetop_parser/test_dos.feature +25 -0
- data/spec/cucumber/treetop_parser/with_comments.feature +10 -0
- data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
- data/spec/cucumber/world/pending_spec.rb +47 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +21 -0
- metadata +7 -1
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec/expectations'
|
2
|
+
|
3
|
+
World do
|
4
|
+
Object.new
|
5
|
+
end
|
6
|
+
|
7
|
+
After do |scenario|
|
8
|
+
if scenario.status.index(:failed)
|
9
|
+
# Call the BDD police
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Given "be_empty" do
|
14
|
+
[1,2].should_not be_empty
|
15
|
+
end
|
16
|
+
|
17
|
+
Given "nested step is called" do
|
18
|
+
Given "I like mushroom", Cucumber::Ast::Table.new([
|
19
|
+
%w{sponge bob},
|
20
|
+
%w{is cool}
|
21
|
+
])
|
22
|
+
end
|
23
|
+
|
24
|
+
Given 'nested step is called using text table' do
|
25
|
+
Given "I like mushroom", table(%{
|
26
|
+
| sponge | bob |
|
27
|
+
| is | cool |
|
28
|
+
})
|
29
|
+
|
30
|
+
# Alternative syntax (file and line will be reported on parse error)
|
31
|
+
# Given "I like mushroom", table(<<-EOT, __FILE__, __LINE__)
|
32
|
+
# | sponge | bob |
|
33
|
+
# | is | cool
|
34
|
+
# EOT
|
35
|
+
end
|
36
|
+
|
37
|
+
Given "I like $what" do |what, table|
|
38
|
+
@magic = what
|
39
|
+
@tool = table.raw[0][0]
|
40
|
+
end
|
41
|
+
|
42
|
+
Then "nested step should be executed" do
|
43
|
+
@magic.should == 'mushroom'
|
44
|
+
@tool.should == 'sponge'
|
45
|
+
end
|
46
|
+
|
47
|
+
Given /^the following table$/ do |table|
|
48
|
+
@table = table
|
49
|
+
end
|
50
|
+
|
51
|
+
Then /^I should be (\w+) in (\w+)$/ do |key, value|
|
52
|
+
hash = @table.hashes[0]
|
53
|
+
hash[key].should == value
|
54
|
+
end
|
55
|
+
|
56
|
+
Then /^I shoule see a multiline string like$/ do |s|
|
57
|
+
s.should == %{A string
|
58
|
+
that spans
|
59
|
+
several lines}
|
60
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Cucumber
|
2
|
+
In order to have a happy user base
|
3
|
+
As a Cucumber user
|
4
|
+
I don't want no stinkin bugs
|
5
|
+
|
6
|
+
Scenario: RSpec be_*
|
7
|
+
Given be_empty
|
8
|
+
|
9
|
+
Scenario: Call step from step
|
10
|
+
Given nested step is called
|
11
|
+
Then nested step should be executed
|
12
|
+
|
13
|
+
Scenario: Call step from step using text table
|
14
|
+
Given nested step is called using text table
|
15
|
+
Then nested step should be executed
|
16
|
+
|
17
|
+
Scenario: Reading a table
|
18
|
+
Given the following table
|
19
|
+
| born | working |
|
20
|
+
| Oslo | London |
|
21
|
+
Then I should be working in London
|
22
|
+
And I should be born in Oslo
|
23
|
+
And I shoule see a multiline string like
|
24
|
+
"""
|
25
|
+
A string
|
26
|
+
that spans
|
27
|
+
several lines
|
28
|
+
"""
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Here you'll find examples for Watir, FireWatir, SafariWatir and Celerity.
|
2
|
+
All of these browser libraries have the same API, so the example code will
|
3
|
+
work with all of them.
|
4
|
+
|
5
|
+
Just run with:
|
6
|
+
|
7
|
+
rake features
|
8
|
+
|
9
|
+
This will use Watir/IE if you're on Windows, and SafariWatir/Safari if you're on OS X.
|
10
|
+
You can force the use of FireWatir/Firefox on any platform like this:
|
11
|
+
|
12
|
+
rake features FIREWATIR=true
|
13
|
+
|
14
|
+
And finally, you can use Celerity by running in JRuby:
|
15
|
+
|
16
|
+
jruby -S rake features
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Search
|
2
|
+
In order to learn more
|
3
|
+
As an information seeker
|
4
|
+
I want to find more information
|
5
|
+
|
6
|
+
Scenario: Find what I'm looking for
|
7
|
+
Given I am on the Google search page
|
8
|
+
When I search for "cucumber github"
|
9
|
+
Then I should see a link to "Ruby on Rails — cucumber — GitHub":http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Full Watir API: http://wtr.rubyforge.org/rdoc/
|
2
|
+
# Full RSpec API: http://rspec.rubyforge.org/
|
3
|
+
|
4
|
+
Given 'I am on the Google search page' do
|
5
|
+
@browser.goto 'http://www.google.com/'
|
6
|
+
end
|
7
|
+
|
8
|
+
When /I search for "(.*)"/ do |query|
|
9
|
+
@browser.text_field(:name, 'q').set(query)
|
10
|
+
@browser.button(:name, 'btnG').click
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /I should see a link to "(.*)":(.*)/ do |text, url|
|
14
|
+
link = @browser.link(:url, url)
|
15
|
+
link.should_not == nil
|
16
|
+
link.text.should == text
|
17
|
+
end
|
18
|
+
|
19
|
+
# To avoid step definitions that are tightly coupled to your user interface,
|
20
|
+
# consider creating classes for your pages - such as this:
|
21
|
+
# http://github.com/aslakhellesoy/cucumber/tree/v0.1.15/examples/watir/features/step_definitons/search_steps.rb
|
22
|
+
#
|
23
|
+
# You may keep the page classes along your steps, or even better, put them in separate files, e.g.
|
24
|
+
# support/pages/google_search.rb
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec/expectations'
|
2
|
+
|
3
|
+
if ENV['FIREWATIR']
|
4
|
+
require 'firewatir'
|
5
|
+
Browser = FireWatir::Firefox
|
6
|
+
else
|
7
|
+
case RUBY_PLATFORM
|
8
|
+
when /darwin/
|
9
|
+
require 'safariwatir'
|
10
|
+
Browser = Watir::Safari
|
11
|
+
when /win32|mingw/
|
12
|
+
require 'watir'
|
13
|
+
Browser = Watir::IE
|
14
|
+
when /java/
|
15
|
+
require 'celerity'
|
16
|
+
Browser = Celerity::Browser
|
17
|
+
else
|
18
|
+
raise "This platform is not supported (#{PLATFORM})"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# "before all"
|
23
|
+
browser = Browser.new
|
24
|
+
|
25
|
+
Before do
|
26
|
+
@browser = browser
|
27
|
+
end
|
28
|
+
|
29
|
+
# "after all"
|
30
|
+
at_exit do
|
31
|
+
browser.close
|
32
|
+
end
|
@@ -0,0 +1,331 @@
|
|
1
|
+
Feature: Cucumber command line
|
2
|
+
In order to write better software
|
3
|
+
Developers should be able to execute requirements as tests
|
4
|
+
|
5
|
+
Scenario: Run single scenario with missing step definition
|
6
|
+
When I run cucumber -q features/sample.feature:5
|
7
|
+
Then it should pass with
|
8
|
+
"""
|
9
|
+
@one
|
10
|
+
Feature: Sample
|
11
|
+
|
12
|
+
@two @three
|
13
|
+
Scenario: Missing
|
14
|
+
Given missing
|
15
|
+
|
16
|
+
1 scenario
|
17
|
+
1 undefined step
|
18
|
+
|
19
|
+
"""
|
20
|
+
|
21
|
+
Scenario: Fail with --strict
|
22
|
+
When I run cucumber -q features/sample.feature:5 --strict
|
23
|
+
Then it should fail with
|
24
|
+
"""
|
25
|
+
@one
|
26
|
+
Feature: Sample
|
27
|
+
|
28
|
+
@two @three
|
29
|
+
Scenario: Missing
|
30
|
+
Given missing
|
31
|
+
Undefined step: "missing" (Cucumber::StepMother::Undefined)
|
32
|
+
features/sample.feature:6:in `Given missing'
|
33
|
+
|
34
|
+
1 scenario
|
35
|
+
1 failed step
|
36
|
+
|
37
|
+
"""
|
38
|
+
|
39
|
+
Scenario: Specify 2 line numbers where one is a tag
|
40
|
+
When I run cucumber -q features/sample.feature:5:14
|
41
|
+
Then it should fail with
|
42
|
+
"""
|
43
|
+
@one
|
44
|
+
Feature: Sample
|
45
|
+
|
46
|
+
@two @three
|
47
|
+
Scenario: Missing
|
48
|
+
Given missing
|
49
|
+
|
50
|
+
@four
|
51
|
+
Scenario: Failing
|
52
|
+
Given failing
|
53
|
+
FAIL (RuntimeError)
|
54
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
55
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
56
|
+
features/sample.feature:16:in `Given failing'
|
57
|
+
|
58
|
+
2 scenarios
|
59
|
+
1 failed step
|
60
|
+
1 undefined step
|
61
|
+
|
62
|
+
"""
|
63
|
+
|
64
|
+
Scenario: Require missing step definition from elsewhere
|
65
|
+
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:5
|
66
|
+
Then it should pass with
|
67
|
+
"""
|
68
|
+
@one
|
69
|
+
Feature: Sample
|
70
|
+
|
71
|
+
@two @three
|
72
|
+
Scenario: Missing
|
73
|
+
Given missing
|
74
|
+
|
75
|
+
1 scenario
|
76
|
+
1 passed step
|
77
|
+
|
78
|
+
"""
|
79
|
+
|
80
|
+
Scenario: Specify the line number of a row
|
81
|
+
When I run cucumber -q features/sample.feature:12
|
82
|
+
Then it should pass with
|
83
|
+
"""
|
84
|
+
@one
|
85
|
+
Feature: Sample
|
86
|
+
|
87
|
+
@three
|
88
|
+
Scenario: Passing
|
89
|
+
Given passing
|
90
|
+
| a | b |
|
91
|
+
| c | d |
|
92
|
+
|
93
|
+
1 scenario
|
94
|
+
1 passed step
|
95
|
+
|
96
|
+
"""
|
97
|
+
|
98
|
+
Scenario: Run all with progress formatter
|
99
|
+
When I run cucumber -q --format progress features/sample.feature
|
100
|
+
Then it should fail with
|
101
|
+
"""
|
102
|
+
U.F
|
103
|
+
|
104
|
+
(::) failed steps (::)
|
105
|
+
|
106
|
+
FAIL (RuntimeError)
|
107
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
108
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
109
|
+
features/sample.feature:16:in `Given failing'
|
110
|
+
|
111
|
+
3 scenarios
|
112
|
+
1 failed step
|
113
|
+
1 undefined step
|
114
|
+
1 passed step
|
115
|
+
|
116
|
+
"""
|
117
|
+
|
118
|
+
Scenario: Run Norwegian
|
119
|
+
Given I am in i18n/no
|
120
|
+
When I run cucumber -q --language no features
|
121
|
+
Then it should pass with
|
122
|
+
"""
|
123
|
+
Egenskap: Summering
|
124
|
+
For å slippe å gjøre dumme feil
|
125
|
+
Som en regnskapsfører
|
126
|
+
Vil jeg kunne legge sammen
|
127
|
+
|
128
|
+
Scenario: to tall
|
129
|
+
Gitt at jeg har tastet inn 5
|
130
|
+
Og at jeg har tastet inn 7
|
131
|
+
Når jeg summerer
|
132
|
+
Så skal resultatet være 12
|
133
|
+
|
134
|
+
@iterasjon3
|
135
|
+
Scenario: tre tall
|
136
|
+
Gitt at jeg har tastet inn 5
|
137
|
+
Og at jeg har tastet inn 7
|
138
|
+
Og at jeg har tastet inn 1
|
139
|
+
Når jeg summerer
|
140
|
+
Så skal resultatet være 13
|
141
|
+
|
142
|
+
2 scenarios
|
143
|
+
9 passed steps
|
144
|
+
|
145
|
+
"""
|
146
|
+
|
147
|
+
Scenario: --dry-run
|
148
|
+
When I run cucumber --dry-run --no-snippets features
|
149
|
+
Then it should pass with
|
150
|
+
"""
|
151
|
+
Feature: Calling undefined step
|
152
|
+
|
153
|
+
Scenario: Call directly
|
154
|
+
Given a step definition that calls an undefined step
|
155
|
+
|
156
|
+
Scenario: Call via another
|
157
|
+
Given call step "a step definition that calls an undefined step"
|
158
|
+
|
159
|
+
Feature: Lots of undefined
|
160
|
+
|
161
|
+
Scenario: Implement me
|
162
|
+
Given it snows in Sahara
|
163
|
+
Given it's 40 degrees in Norway
|
164
|
+
And it's 40 degrees in Norway
|
165
|
+
When I stop procrastinating
|
166
|
+
And there is world peace
|
167
|
+
|
168
|
+
Feature: Outline Sample
|
169
|
+
|
170
|
+
Scenario: I have no steps
|
171
|
+
|
172
|
+
Scenario Outline: Test state
|
173
|
+
Given <state> without a table
|
174
|
+
Given <other_state> without a table
|
175
|
+
|
176
|
+
Examples: Rainbow colours
|
177
|
+
| state | other_state |
|
178
|
+
| missing | passing |
|
179
|
+
| passing | passing |
|
180
|
+
| failing | passing |
|
181
|
+
|
182
|
+
Examples: Only passing
|
183
|
+
| state | other_state |
|
184
|
+
| passing | passing |
|
185
|
+
|
186
|
+
@one
|
187
|
+
Feature: Sample
|
188
|
+
|
189
|
+
@two @three
|
190
|
+
Scenario: Missing
|
191
|
+
Given missing
|
192
|
+
|
193
|
+
@three
|
194
|
+
Scenario: Passing
|
195
|
+
Given passing
|
196
|
+
| a | b |
|
197
|
+
| c | d |
|
198
|
+
|
199
|
+
@four
|
200
|
+
Scenario: Failing
|
201
|
+
Given failing
|
202
|
+
|
203
|
+
11 scenarios
|
204
|
+
11 skipped steps
|
205
|
+
7 undefined steps
|
206
|
+
|
207
|
+
"""
|
208
|
+
|
209
|
+
Scenario: Multiple formatters and outputs
|
210
|
+
When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
|
211
|
+
And examples/self_test/tmp/progress.txt should contain
|
212
|
+
"""
|
213
|
+
UUUUU
|
214
|
+
|
215
|
+
1 scenario
|
216
|
+
5 undefined steps
|
217
|
+
|
218
|
+
"""
|
219
|
+
And examples/self_test/tmp/pretty.txt should match
|
220
|
+
"""
|
221
|
+
Feature: Lots of undefined
|
222
|
+
|
223
|
+
Scenario: Implement me
|
224
|
+
Given it snows in Sahara
|
225
|
+
Given it's 40 degrees in Norway
|
226
|
+
And it's 40 degrees in Norway
|
227
|
+
When I stop procrastinating
|
228
|
+
And there is world peace
|
229
|
+
|
230
|
+
1 scenario
|
231
|
+
5 undefined steps
|
232
|
+
|
233
|
+
"""
|
234
|
+
|
235
|
+
Scenario: Run scenario specified by name using --scenario
|
236
|
+
When I run cucumber --scenario Passing -q features
|
237
|
+
Then it should pass with
|
238
|
+
"""
|
239
|
+
@one
|
240
|
+
Feature: Sample
|
241
|
+
|
242
|
+
@three
|
243
|
+
Scenario: Passing
|
244
|
+
Given passing
|
245
|
+
| a | b |
|
246
|
+
| c | d |
|
247
|
+
|
248
|
+
1 scenario
|
249
|
+
1 passed step
|
250
|
+
|
251
|
+
"""
|
252
|
+
|
253
|
+
Scenario: Run with a tag that exists on 2 scenarios
|
254
|
+
When I run cucumber -q features --tags three
|
255
|
+
Then it should pass with
|
256
|
+
"""
|
257
|
+
@one
|
258
|
+
Feature: Sample
|
259
|
+
|
260
|
+
@two @three
|
261
|
+
Scenario: Missing
|
262
|
+
Given missing
|
263
|
+
|
264
|
+
@three
|
265
|
+
Scenario: Passing
|
266
|
+
Given passing
|
267
|
+
| a | b |
|
268
|
+
| c | d |
|
269
|
+
|
270
|
+
2 scenarios
|
271
|
+
1 undefined step
|
272
|
+
1 passed step
|
273
|
+
|
274
|
+
"""
|
275
|
+
|
276
|
+
Scenario: Run with a tag that exists on 1 feature
|
277
|
+
When I run cucumber -q features --tags one
|
278
|
+
Then it should fail with
|
279
|
+
"""
|
280
|
+
@one
|
281
|
+
Feature: Sample
|
282
|
+
|
283
|
+
@two @three
|
284
|
+
Scenario: Missing
|
285
|
+
Given missing
|
286
|
+
|
287
|
+
@three
|
288
|
+
Scenario: Passing
|
289
|
+
Given passing
|
290
|
+
| a | b |
|
291
|
+
| c | d |
|
292
|
+
|
293
|
+
@four
|
294
|
+
Scenario: Failing
|
295
|
+
Given failing
|
296
|
+
FAIL (RuntimeError)
|
297
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
298
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
299
|
+
features/sample.feature:16:in `Given failing'
|
300
|
+
|
301
|
+
3 scenarios
|
302
|
+
1 failed step
|
303
|
+
1 undefined step
|
304
|
+
1 passed step
|
305
|
+
|
306
|
+
"""
|
307
|
+
|
308
|
+
Scenario: Reformat files with --autoformat
|
309
|
+
When I run cucumber --autoformat tmp/formatted features
|
310
|
+
Then examples/self_test/tmp/formatted/features/sample.feature should contain
|
311
|
+
"""
|
312
|
+
@one
|
313
|
+
Feature: Sample
|
314
|
+
|
315
|
+
@two @three
|
316
|
+
Scenario: Missing
|
317
|
+
Given missing
|
318
|
+
|
319
|
+
@three
|
320
|
+
Scenario: Passing
|
321
|
+
Given passing
|
322
|
+
| a | b |
|
323
|
+
| c | d |
|
324
|
+
|
325
|
+
@four
|
326
|
+
Scenario: Failing
|
327
|
+
Given failing
|
328
|
+
|
329
|
+
|
330
|
+
"""
|
331
|
+
|