cucumber 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -1
- data/Caliper.yml +4 -0
- data/History.txt +1557 -0
- data/LICENSE +1 -1
- data/README.rdoc +26 -0
- data/Rakefile +51 -5
- data/VERSION.yml +5 -0
- data/bin/cucumber +1 -7
- data/cucumber.gemspec +77 -3
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/he/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +7 -4
- data/examples/i18n/ro/features/suma.feature +11 -0
- data/examples/i18n/ru/features/division.feature +2 -2
- data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +3 -3
- data/examples/sinatra/features/support/env.rb +5 -2
- data/examples/v8/features/fibonacci.feature +1 -1
- data/examples/watir/features/step_definitions/search_steps.rb +1 -1
- data/features/announce.feature +164 -0
- data/features/around_hooks.feature +232 -0
- data/features/background.feature +95 -284
- data/features/bug_371.feature +32 -0
- data/features/bug_464.feature +16 -0
- data/features/bug_475.feature +42 -0
- data/features/bug_585_tab_indentation.feature +22 -0
- data/features/bug_600.feature +67 -0
- data/features/call_steps_from_stepdefs.feature +154 -0
- data/features/cucumber_cli.feature +591 -0
- data/features/cucumber_cli_outlines.feature +117 -0
- data/features/custom_formatter.feature +73 -3
- data/features/default_snippets.feature +42 -0
- data/features/diffing.feature +25 -0
- data/features/drb_server_integration.feature +174 -0
- data/features/exception_in_after_block.feature +127 -0
- data/features/exception_in_after_step_block.feature +104 -0
- data/features/exception_in_before_block.feature +98 -0
- data/features/exclude_files.feature +20 -0
- data/features/expand.feature +60 -0
- data/features/html_formatter.feature +8 -0
- data/features/html_formatter/a.html +582 -0
- data/features/json_formatter.feature +245 -160
- data/features/junit_formatter.feature +88 -0
- data/features/language_from_header.feature +30 -0
- data/features/language_help.feature +78 -0
- data/features/listener_debugger_formatter.feature +42 -0
- data/features/multiline_names.feature +44 -0
- data/features/negative_tagged_hooks.feature +60 -0
- data/features/post_configuration_hook.feature +37 -0
- data/features/profiles.feature +126 -0
- data/features/rake_task.feature +152 -0
- data/features/report_called_undefined_steps.feature +34 -0
- data/features/rerun_formatter.feature +45 -0
- data/features/simplest.feature +11 -0
- data/features/snippet.feature +23 -0
- data/features/snippets_when_using_star_keyword.feature +36 -0
- data/features/step_definitions/cucumber_steps.rb +153 -7
- data/features/step_definitions/extra_steps.rb +2 -0
- data/features/step_definitions/simplest_steps.rb +3 -0
- data/features/step_definitions/wire_steps.rb +32 -0
- data/features/support/env.rb +140 -18
- data/features/support/env.rb.simplest +7 -0
- data/features/support/fake_wire_server.rb +77 -0
- data/features/table_diffing.feature +45 -0
- data/features/table_mapping.feature +34 -0
- data/features/tag_logic.feature +258 -0
- data/features/transform.feature +245 -0
- data/features/unicode_table.feature +35 -0
- data/features/usage_and_stepdefs_formatter.feature +169 -0
- data/features/wire_protocol.feature +332 -0
- data/features/wire_protocol_table_diffing.feature +119 -0
- data/features/wire_protocol_tags.feature +87 -0
- data/features/wire_protocol_timeouts.feature +63 -0
- data/features/work_in_progress.feature +156 -0
- data/fixtures/json/features/pystring.feature +8 -0
- data/fixtures/junit/features/pending.feature +1 -3
- data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
- data/fixtures/self_test/features/background/background_with_name.feature +7 -0
- data/fixtures/self_test/features/background/failing_background.feature +12 -0
- data/fixtures/self_test/features/background/failing_background_after_success.feature +11 -0
- data/fixtures/self_test/features/background/multiline_args_background.feature +32 -0
- data/fixtures/self_test/features/background/passing_background.feature +10 -0
- data/fixtures/self_test/features/background/pending_background.feature +10 -0
- data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +16 -0
- data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +16 -0
- data/fixtures/self_test/features/support/env.rb +0 -8
- data/fixtures/tickets/features.html +1 -1
- data/gem_tasks/examples.rake +1 -1
- data/gem_tasks/features.rake +14 -0
- data/gem_tasks/sdoc.rake +12 -0
- data/lib/cucumber.rb +0 -12
- data/lib/cucumber/ast.rb +1 -1
- data/lib/cucumber/ast/background.rb +5 -21
- data/lib/cucumber/ast/examples.rb +4 -12
- data/lib/cucumber/ast/feature.rb +5 -13
- data/lib/cucumber/ast/feature_element.rb +4 -9
- data/lib/cucumber/ast/outline_table.rb +4 -4
- data/lib/cucumber/ast/py_string.rb +80 -0
- data/lib/cucumber/ast/scenario.rb +5 -7
- data/lib/cucumber/ast/scenario_outline.rb +15 -23
- data/lib/cucumber/ast/step.rb +0 -5
- data/lib/cucumber/ast/step_invocation.rb +15 -21
- data/lib/cucumber/ast/table.rb +8 -14
- data/lib/cucumber/ast/tree_walker.rb +48 -10
- data/lib/cucumber/cli/configuration.rb +8 -33
- data/lib/cucumber/cli/main.rb +35 -20
- data/lib/cucumber/cli/options.rb +7 -8
- data/lib/cucumber/cli/profile_loader.rb +0 -2
- data/lib/cucumber/core_ext/proc.rb +1 -2
- data/lib/cucumber/feature_file.rb +15 -47
- data/lib/cucumber/formatter/ansicolor.rb +5 -3
- data/lib/cucumber/formatter/color_io.rb +23 -0
- data/lib/cucumber/formatter/console.rb +23 -27
- data/lib/cucumber/formatter/cucumber.css +17 -34
- data/lib/cucumber/formatter/cucumber.sass +182 -173
- data/lib/cucumber/formatter/html.rb +11 -46
- data/lib/cucumber/formatter/io.rb +4 -2
- data/lib/cucumber/formatter/json.rb +152 -15
- data/lib/cucumber/formatter/json_pretty.rb +6 -5
- data/lib/cucumber/formatter/junit.rb +22 -28
- data/lib/cucumber/formatter/pdf.rb +6 -6
- data/lib/cucumber/formatter/pretty.rb +5 -5
- data/lib/cucumber/formatter/rerun.rb +11 -22
- data/lib/cucumber/formatter/tag_cloud.rb +35 -0
- data/lib/cucumber/formatter/unicode.rb +20 -41
- data/lib/cucumber/js_support/js_dsl.js +4 -4
- data/lib/cucumber/js_support/js_language.rb +5 -9
- data/lib/cucumber/js_support/js_snippets.rb +2 -2
- data/lib/cucumber/language_support.rb +2 -2
- data/lib/cucumber/parser/gherkin_builder.rb +30 -35
- data/lib/cucumber/platform.rb +8 -8
- data/lib/cucumber/py_support/py_language.rb +2 -2
- data/lib/cucumber/rake/task.rb +31 -74
- data/lib/cucumber/rb_support/rb_dsl.rb +0 -1
- data/lib/cucumber/rb_support/rb_language.rb +8 -10
- data/lib/cucumber/rb_support/rb_step_definition.rb +0 -8
- data/lib/cucumber/rb_support/rb_transform.rb +0 -17
- data/lib/cucumber/rb_support/rb_world.rb +18 -26
- data/lib/cucumber/rspec/doubles.rb +3 -3
- data/lib/cucumber/step_match.rb +2 -6
- data/lib/cucumber/step_mother.rb +427 -6
- data/lib/cucumber/wire_support/configuration.rb +1 -4
- data/lib/cucumber/wire_support/wire_language.rb +10 -3
- data/spec/cucumber/ast/background_spec.rb +6 -68
- data/spec/cucumber/ast/feature_factory.rb +4 -5
- data/spec/cucumber/ast/feature_spec.rb +4 -4
- data/spec/cucumber/ast/outline_table_spec.rb +1 -1
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +11 -15
- data/spec/cucumber/ast/scenario_spec.rb +4 -4
- data/spec/cucumber/ast/step_spec.rb +3 -3
- data/spec/cucumber/ast/table_spec.rb +2 -38
- data/spec/cucumber/ast/tree_walker_spec.rb +2 -2
- data/spec/cucumber/broadcaster_spec.rb +1 -1
- data/spec/cucumber/cli/configuration_spec.rb +6 -32
- data/spec/cucumber/cli/drb_client_spec.rb +3 -2
- data/spec/cucumber/cli/main_spec.rb +43 -43
- data/spec/cucumber/cli/options_spec.rb +1 -28
- data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
- data/spec/cucumber/core_ext/proc_spec.rb +1 -1
- data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
- data/spec/cucumber/formatter/color_io_spec.rb +29 -0
- data/spec/cucumber/formatter/duration_spec.rb +1 -1
- data/spec/cucumber/formatter/html_spec.rb +5 -3
- data/spec/cucumber/formatter/junit_spec.rb +2 -16
- data/spec/cucumber/formatter/progress_spec.rb +1 -1
- data/spec/cucumber/formatter/spec_helper.rb +12 -11
- data/spec/cucumber/rb_support/rb_language_spec.rb +28 -241
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +28 -33
- data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
- data/spec/cucumber/step_match_spec.rb +9 -11
- data/spec/cucumber/step_mother_spec.rb +302 -0
- data/spec/cucumber/wire_support/configuration_spec.rb +1 -1
- data/spec/cucumber/wire_support/connection_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
- data/spec/cucumber/world/pending_spec.rb +2 -2
- data/spec/spec_helper.rb +20 -13
- metadata +78 -4
@@ -0,0 +1,16 @@
|
|
1
|
+
Feature: Passing background with scenario outlines sample
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given '10' cukes
|
5
|
+
|
6
|
+
Scenario Outline: passing background
|
7
|
+
Then I should have '<count>' cukes
|
8
|
+
Examples:
|
9
|
+
|count|
|
10
|
+
| 10 |
|
11
|
+
|
12
|
+
Scenario Outline: another passing background
|
13
|
+
Then I should have '<count>' cukes
|
14
|
+
Examples:
|
15
|
+
|count|
|
16
|
+
| 10 |
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'base64'
|
2
1
|
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
|
3
2
|
$KCODE = 'u' unless Cucumber::RUBY_1_9
|
4
3
|
|
@@ -17,10 +16,3 @@ end
|
|
17
16
|
After('@background_tagged_before_on_outline') do
|
18
17
|
@cukes.should == '888'
|
19
18
|
end
|
20
|
-
|
21
|
-
After do
|
22
|
-
png = IO.read(File.join(File.dirname(__FILE__), 'bubble_256x256.png'))
|
23
|
-
encoded_img = Base64.encode64(png).gsub(/\n/, '')
|
24
|
-
embed("data:image/png;base64,#{encoded_img}", 'image/png')
|
25
|
-
end
|
26
|
-
|
@@ -135,4 +135,4 @@
|
|
135
135
|
./features/step_definitons/tickets_steps.rb:57:in `/^I have a pending step$/'
|
136
136
|
features/241.feature:10:in `Given I have a pending step'</pre></li><li class="step skipped" id="features_241_feature_11"><div><span class="keyword">When</span> <span class="step val">I run this feature with the progress format</span></div></li><li class="step skipped" id="features_241_feature_12"><div><span class="keyword">Then</span> <span class="step val">I should get a no method error for 'backtrace_line'</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match</span></h2><p class="narrative"></p><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">See "No Record(s) Found" for Zero Existing</span></h3><ol><li class="step passed" id="features_246_feature_4"><div><span class="keyword">Given</span> <span class="step val">no <span class="param">public holiday</span> exists in the system</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: pending method causes failure in Scenario Outlines</span></h2><p class="narrative"></p><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">blah</span></h3><ol><li class="step skipped" id="features_248_feature_4"><div><span class="keyword">Given</span> <span class="step val">this is pending until we fix it</span></div></li><li class="step skipped" id="features_248_feature_5"><div><span class="keyword">Given</span> <span class="step val">context with <Stuff></span></div></li><li class="step skipped" id="features_248_feature_6"><div><span class="keyword">When</span> <span class="step val">action</span></div></li><li class="step skipped" id="features_248_feature_7"><div><span class="keyword">Then</span> <span class="step val">outcome with <Blah></span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_10"><th class="val skipped_param" id="row_10_0">Stuff</th><th class="val skipped_param" id="row_10_1">Blah</th></tr><tr id="row_11"><td class="val skipped" id="row_11_0">Cheese</td><td class="val skipped" id="row_11_1">Pepper Jack</td></tr><tr><td class="failed" colspan="2"><pre>TODO (Cucumber::Pending)
|
137
137
|
./features/step_definitons/248_steps.rb:2:in `/^this is pending until we fix it$/'
|
138
|
-
features/248.feature:4:in `Given this is pending until we fix it'</pre></td></tr></table></div></div></div><div class="feature"><h2><span class="val">Feature: Background</span></h2><p class="narrative">In for background to work properly<br/>As a user<br/>I want it to run transactionally and only once when I call an individual scenario<br/></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li class="step passed" id="features_270_back_feature_7"><div><span class="keyword">Given</span> <span class="step val">plop</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Barping</span></h3><ol><li class="step passed" id="features_270_back_feature_10"><div><span class="keyword">When</span> <span class="step val">I barp</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Wibbling</span></h3><ol><li class="step passed" id="features_270_back_feature_14"><div><span class="keyword">When</span> <span class="step val">I wibble</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: pystring indentaion testcase</span></h2><p class="narrative"></p><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">example of correct indentation</span></h3><ol><li class="step passed" id="features_279_doc_string_indent_feature_4"><div><span class="keyword">Given</span> <span class="step val">multiline string</span></div><pre class="val"> I'm a cucumber and I'm ok
I sleep all night and test all day</pre></li><li class="step passed" id="features_279_doc_string_indent_feature_9"><div><span class="keyword">Then</span> <span class="step val">string is</span></div><pre class="val"> I'm a cucumber and I'm ok
I sleep all night and test all day</pre></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">example of wrong indentation</span></h3><ol><li class="step passed" id="features_279_doc_string_indent_feature_16"><div><span class="keyword">Given</span> <span class="step val">I am in <span class="param">tickets/features/279</span></span></div></li><li class="step passed" id="features_279_doc_string_indent_feature_17"><div><span class="keyword">When</span> <span class="step val">I run cucumber <span class="param">-q wrong.feature_</span></span></div></li><li class="step passed" id="features_279_doc_string_indent_feature_18"><div><span class="keyword">Then</span> <span class="step val">it should <span class="param">fail</span> with</span></div><pre class="val"></pre></li><li class="step passed" id="features_279_doc_string_indent_feature_22"><div><span class="keyword">And</span> <span class="step val">STDERR should match</span></div><pre class="val">wrong.feature_:8:10: Parse error</pre></li></ol></div></div><div class="feature"><h2><span class="val">Feature https://rspec.lighthouseapp.com/projects/16211/tickets/301</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val">A background</span></h3><ol><li class="step passed" id="features_301_filter_background_tagged_hooks_feature_3"><div><span class="keyword">Given</span> <span class="step val">whatever</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">VB is not cool</span></h3><ol><li class="step passed" id="features_301_filter_background_tagged_hooks_feature_6"><div><span class="keyword">Then</span> <span class="step val">VB should not be cool</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: woo yeah</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li class="step undefined" id="features_306_only_background_feature_4"><div><span class="keyword">Given</span> <span class="step val">passing step without a table</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: Outlines</span></h2><p class="narrative">In order to re-use scenario table values<br/>As a citizen of Cucumbia<br/>I want to explicitly mark the parameters in a scenario outline<br/></p><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">controlling order</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_7"><div><span class="keyword">Given</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_8"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_9"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_12"><th class="val skipped_param" id="row_12_0">left</th><th class="val skipped_param" id="row_12_1">start</th><th class="val skipped_param" id="row_12_2">eat</th></tr><tr id="row_13"><td class="val passed" id="row_13_0">7</td><td class="val passed" id="row_13_1">12</td><td class="val passed" id="row_13_2">5</td></tr><tr id="row_14"><td class="val passed" id="row_14_0">15</td><td class="val passed" id="row_14_1">20</td><td class="val passed" id="row_14_2">5</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">reusing place holder</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_17"><div><span class="keyword">Given</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_18"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_19"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_20"><div><span class="keyword">And</span> <span class="step val">I should have <eat> cucumbers in my belly</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Lots of cukes</span></h4><table><tr id="row_23"><th class="val skipped_param" id="row_23_0">start</th><th class="val skipped_param" id="row_23_1">eat</th><th class="val skipped_param" id="row_23_2">left</th></tr><tr id="row_24"><td class="val passed" id="row_24_0">12</td><td class="val passed" id="row_24_1">5</td><td class="val passed" id="row_24_2">7</td></tr><tr id="row_25"><td class="val passed" id="row_25_0">20</td><td class="val passed" id="row_25_1">5</td><td class="val passed" id="row_25_2">15</td></tr></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Ridiculous amounts of cukes</span></h4><table><tr id="row_28"><th class="val skipped_param" id="row_28_0">start</th><th class="val skipped_param" id="row_28_1">eat</th><th class="val skipped_param" id="row_28_2">left</th></tr><tr id="row_29"><td class="val passed" id="row_29_0">120</td><td class="val passed" id="row_29_1">50</td><td class="val passed" id="row_29_2">70</td></tr><tr id="row_30"><td class="val passed" id="row_30_0">200</td><td class="val passed" id="row_30_1">50</td><td class="val passed" id="row_30_2">150</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">no placeholders</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_33"><div><span class="keyword">Given</span> <span class="step val">there are 12 cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_34"><div><span class="keyword">When</span> <span class="step val">I eat 5 cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_35"><div><span class="keyword">Then</span> <span class="step val">I should have 7 cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_38"><th class="val skipped_param" id="row_38_0">start</th><th class="val skipped_param" id="row_38_1">eat</th><th class="val skipped_param" id="row_38_2">left</th></tr><tr id="row_39"><td class="val" id="row_39_0">12</td><td class="val" id="row_39_1">5</td><td class="val" id="row_39_2">7</td></tr><tr id="row_40"><td class="val" id="row_40_0">20</td><td class="val" id="row_40_1">5</td><td class="val" id="row_40_2">15</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">using '<' and '>' not as placeholder</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_43"><div><span class="keyword">Given</span> <span class="step val">the belly space is < 12 and > 6</span></div></li><li class="step skipped" id="features_scenario_outline_feature_44"><div><span class="keyword">And</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_45"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_46"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_49"><th class="val skipped_param" id="row_49_0">start</th><th class="val skipped_param" id="row_49_1">eat</th><th class="val skipped_param" id="row_49_2">left</th></tr><tr id="row_50"><td class="val passed" id="row_50_0">12</td><td class="val passed" id="row_50_1">5</td><td class="val passed" id="row_50_2">7</td></tr><tr id="row_51"><td class="val passed" id="row_51_0">20</td><td class="val passed" id="row_51_1">5</td><td class="val passed" id="row_51_2">15</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">with step tables</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_54"><div><span class="keyword">Given</span> <span class="step val">I have the following fruits in my pantry</span></div><table><tr id="row_55"><td class="val" id="row_55_0">name</td><td class="val" id="row_55_1">quantity</td></tr><tr id="row_56"><td class="val" id="row_56_0">cucumbers</td><td class="val" id="row_56_1">10</td></tr><tr id="row_57"><td class="val" id="row_57_0">strawberrys</td><td class="val" id="row_57_1">5</td></tr><tr id="row_58"><td class="val" id="row_58_0">apricots</td><td class="val" id="row_58_1">7</td></tr></table></li><li class="step skipped" id="features_scenario_outline_feature_60"><div><span class="keyword">When</span> <span class="step val">I eat <number> <fruits> from the pantry</span></div></li><li class="step skipped" id="features_scenario_outline_feature_61"><div><span class="keyword">Then</span> <span class="step val">I should have <left> <fruits> in the pantry</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_64"><th class="val skipped_param" id="row_64_0">number</th><th class="val skipped_param" id="row_64_1">fruits</th><th class="val skipped_param" id="row_64_2">left</th></tr><tr id="row_65"><td class="val passed" id="row_65_0">2</td><td class="val passed" id="row_65_1">cucumbers</td><td class="val passed" id="row_65_2">8</td></tr><tr id="row_66"><td class="val passed" id="row_66_0">4</td><td class="val passed" id="row_66_1">strawberrys</td><td class="val passed" id="row_66_2">1</td></tr><tr id="row_67"><td class="val passed" id="row_67_0">2</td><td class="val passed" id="row_67_1">apricots</td><td class="val passed" id="row_67_2">5</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">placeholder in a multiline string</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_70"><div><span class="keyword">Given</span> <span class="step val">my shopping list</span></div><pre class="val"> Must buy some <fruits></pre></li><li class="step skipped" id="features_scenario_outline_feature_74"><div><span class="keyword">Then</span> <span class="step val">my shopping list should equal</span></div><pre class="val"> Must buy some cucumbers</pre></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_80"><th class="val skipped_param" id="row_80_0">fruits</th></tr><tr id="row_81"><td class="val passed" id="row_81_0">cucumbers</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">placeholder in step table</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_84"><div><span class="keyword">Given</span> <span class="step val">I have the following fruits in my pantry</span></div><table><tr id="row_85"><td class="val" id="row_85_0">name</td><td class="val" id="row_85_1">quantity</td></tr><tr id="row_86"><td class="val" id="row_86_0">cucumbers</td><td class="val" id="row_86_1"><quant_cukes></td></tr><tr id="row_87"><td class="val" id="row_87_0">strawberrys</td><td class="val" id="row_87_1"><quant_straw></td></tr></table></li><li class="step skipped" id="features_scenario_outline_feature_89"><div><span class="keyword">When</span> <span class="step val">I eat <number> <fruits> from the pantry</span></div></li><li class="step skipped" id="features_scenario_outline_feature_90"><div><span class="keyword">Then</span> <span class="step val">I should have <left> <fruits> in the pantry</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_93"><th class="val skipped_param" id="row_93_0">quant_cukes</th><th class="val skipped_param" id="row_93_1">quant_straw</th><th class="val skipped_param" id="row_93_2">number</th><th class="val skipped_param" id="row_93_3">fruits</th><th class="val skipped_param" id="row_93_4">left</th></tr><tr id="row_94"><td class="val passed" id="row_94_0">10</td><td class="val passed" id="row_94_1">5</td><td class="val passed" id="row_94_2">2</td><td class="val passed" id="row_94_3">cucumbers</td><td class="val passed" id="row_94_4">8</td></tr><tr id="row_95"><td class="val passed" id="row_95_0">5</td><td class="val passed" id="row_95_1">5</td><td class="val passed" id="row_95_2">4</td><td class="val passed" id="row_95_3">strawberrys</td><td class="val passed" id="row_95_4">1</td></tr></table></div></div></div><div class="feature"><h2><span class="val">Feature: Cucumber</span></h2><p class="narrative">In order to have a happy user base<br/>As a Cucumber user<br/>I don't want no stinkin bugs<br/></p><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">RSpec be_*</span></h3><ol><li class="step passed" id="features_tickets_feature_7"><div><span class="keyword">Given</span> <span class="step val">be_empty</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Call step from step</span></h3><ol><li class="step passed" id="features_tickets_feature_10"><div><span class="keyword">Given</span> <span class="step val">nested step is called</span></div></li><li class="step passed" id="features_tickets_feature_11"><div><span class="keyword">Then</span> <span class="step val">nested step should be executed</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Call step from step using text table</span></h3><ol><li class="step passed" id="features_tickets_feature_14"><div><span class="keyword">Given</span> <span class="step val">nested step is called using text table</span></div></li><li class="step passed" id="features_tickets_feature_15"><div><span class="keyword">Then</span> <span class="step val">nested step should be executed</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Reading a table</span></h3><ol><li class="step passed" id="features_tickets_feature_18"><div><span class="keyword">Given</span> <span class="step val">the following table</span></div><table><tr id="row_19"><td class="val" id="row_19_0">born</td><td class="val" id="row_19_1">working</td></tr><tr id="row_20"><td class="val" id="row_20_0">Oslo</td><td class="val" id="row_20_1">London</td></tr></table></li><li class="step passed" id="features_tickets_feature_21"><div><span class="keyword">Then</span> <span class="step val">I should be <span class="param">working</span> in <span class="param">London</span></span></div></li><li class="step passed" id="features_tickets_feature_22"><div><span class="keyword">And</span> <span class="step val">I should be <span class="param">born</span> in <span class="param">Oslo</span></span></div></li><li class="step passed" id="features_tickets_feature_23"><div><span class="keyword">And</span> <span class="step val">I should see a multiline string like</span></div><pre class="val">A string
that spans
several lines</pre></li></ol></div></div><div class="summary">43 scenarios (12 undefined, 2 pending, 29 passed)</div><div class="summary">173 steps (5 skipped, 89 undefined, 2 pending, 77 passed)</div><div class="duration">0m0.701s</div></div></body></html>
|
138
|
+
features/248.feature:4:in `Given this is pending until we fix it'</pre></td></tr></table></div></div></div><div class="feature"><h2><span class="val">Feature: Background</span></h2><p class="narrative">In for background to work properly<br/>As a user<br/>I want it to run transactionally and only once when I call an individual scenario<br/></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li class="step passed" id="features_270_back_feature_7"><div><span class="keyword">Given</span> <span class="step val">plop</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Barping</span></h3><ol><li class="step passed" id="features_270_back_feature_10"><div><span class="keyword">When</span> <span class="step val">I barp</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Wibbling</span></h3><ol><li class="step passed" id="features_270_back_feature_14"><div><span class="keyword">When</span> <span class="step val">I wibble</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: pystring indentaion testcase</span></h2><p class="narrative"></p><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">example of correct indentation</span></h3><ol><li class="step passed" id="features_279_py_string_indent_feature_4"><div><span class="keyword">Given</span> <span class="step val">multiline string</span></div><pre class="val"> I'm a cucumber and I'm ok
I sleep all night and test all day</pre></li><li class="step passed" id="features_279_py_string_indent_feature_9"><div><span class="keyword">Then</span> <span class="step val">string is</span></div><pre class="val"> I'm a cucumber and I'm ok
I sleep all night and test all day</pre></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">example of wrong indentation</span></h3><ol><li class="step passed" id="features_279_py_string_indent_feature_16"><div><span class="keyword">Given</span> <span class="step val">I am in <span class="param">tickets/features/279</span></span></div></li><li class="step passed" id="features_279_py_string_indent_feature_17"><div><span class="keyword">When</span> <span class="step val">I run cucumber <span class="param">-q wrong.feature_</span></span></div></li><li class="step passed" id="features_279_py_string_indent_feature_18"><div><span class="keyword">Then</span> <span class="step val">it should <span class="param">fail</span> with</span></div><pre class="val"></pre></li><li class="step passed" id="features_279_py_string_indent_feature_22"><div><span class="keyword">And</span> <span class="step val">STDERR should match</span></div><pre class="val">wrong.feature_:8:10: Parse error</pre></li></ol></div></div><div class="feature"><h2><span class="val">Feature https://rspec.lighthouseapp.com/projects/16211/tickets/301</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val">A background</span></h3><ol><li class="step passed" id="features_301_filter_background_tagged_hooks_feature_3"><div><span class="keyword">Given</span> <span class="step val">whatever</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">VB is not cool</span></h3><ol><li class="step passed" id="features_301_filter_background_tagged_hooks_feature_6"><div><span class="keyword">Then</span> <span class="step val">VB should not be cool</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: woo yeah</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li class="step undefined" id="features_306_only_background_feature_4"><div><span class="keyword">Given</span> <span class="step val">passing step without a table</span></div></li></ol></div></div><div class="feature"><h2><span class="val">Feature: Outlines</span></h2><p class="narrative">In order to re-use scenario table values<br/>As a citizen of Cucumbia<br/>I want to explicitly mark the parameters in a scenario outline<br/></p><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">controlling order</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_7"><div><span class="keyword">Given</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_8"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_9"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_12"><th class="val skipped_param" id="row_12_0">left</th><th class="val skipped_param" id="row_12_1">start</th><th class="val skipped_param" id="row_12_2">eat</th></tr><tr id="row_13"><td class="val passed" id="row_13_0">7</td><td class="val passed" id="row_13_1">12</td><td class="val passed" id="row_13_2">5</td></tr><tr id="row_14"><td class="val passed" id="row_14_0">15</td><td class="val passed" id="row_14_1">20</td><td class="val passed" id="row_14_2">5</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">reusing place holder</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_17"><div><span class="keyword">Given</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_18"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_19"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_20"><div><span class="keyword">And</span> <span class="step val">I should have <eat> cucumbers in my belly</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Lots of cukes</span></h4><table><tr id="row_23"><th class="val skipped_param" id="row_23_0">start</th><th class="val skipped_param" id="row_23_1">eat</th><th class="val skipped_param" id="row_23_2">left</th></tr><tr id="row_24"><td class="val passed" id="row_24_0">12</td><td class="val passed" id="row_24_1">5</td><td class="val passed" id="row_24_2">7</td></tr><tr id="row_25"><td class="val passed" id="row_25_0">20</td><td class="val passed" id="row_25_1">5</td><td class="val passed" id="row_25_2">15</td></tr></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Ridiculous amounts of cukes</span></h4><table><tr id="row_28"><th class="val skipped_param" id="row_28_0">start</th><th class="val skipped_param" id="row_28_1">eat</th><th class="val skipped_param" id="row_28_2">left</th></tr><tr id="row_29"><td class="val passed" id="row_29_0">120</td><td class="val passed" id="row_29_1">50</td><td class="val passed" id="row_29_2">70</td></tr><tr id="row_30"><td class="val passed" id="row_30_0">200</td><td class="val passed" id="row_30_1">50</td><td class="val passed" id="row_30_2">150</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">no placeholders</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_33"><div><span class="keyword">Given</span> <span class="step val">there are 12 cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_34"><div><span class="keyword">When</span> <span class="step val">I eat 5 cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_35"><div><span class="keyword">Then</span> <span class="step val">I should have 7 cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_38"><th class="val skipped_param" id="row_38_0">start</th><th class="val skipped_param" id="row_38_1">eat</th><th class="val skipped_param" id="row_38_2">left</th></tr><tr id="row_39"><td class="val" id="row_39_0">12</td><td class="val" id="row_39_1">5</td><td class="val" id="row_39_2">7</td></tr><tr id="row_40"><td class="val" id="row_40_0">20</td><td class="val" id="row_40_1">5</td><td class="val" id="row_40_2">15</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">using '<' and '>' not as placeholder</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_43"><div><span class="keyword">Given</span> <span class="step val">the belly space is < 12 and > 6</span></div></li><li class="step skipped" id="features_scenario_outline_feature_44"><div><span class="keyword">And</span> <span class="step val">there are <start> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_45"><div><span class="keyword">When</span> <span class="step val">I eat <eat> cucumbers</span></div></li><li class="step skipped" id="features_scenario_outline_feature_46"><div><span class="keyword">Then</span> <span class="step val">I should have <left> cucumbers</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_49"><th class="val skipped_param" id="row_49_0">start</th><th class="val skipped_param" id="row_49_1">eat</th><th class="val skipped_param" id="row_49_2">left</th></tr><tr id="row_50"><td class="val passed" id="row_50_0">12</td><td class="val passed" id="row_50_1">5</td><td class="val passed" id="row_50_2">7</td></tr><tr id="row_51"><td class="val passed" id="row_51_0">20</td><td class="val passed" id="row_51_1">5</td><td class="val passed" id="row_51_2">15</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">with step tables</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_54"><div><span class="keyword">Given</span> <span class="step val">I have the following fruits in my pantry</span></div><table><tr id="row_55"><td class="val" id="row_55_0">name</td><td class="val" id="row_55_1">quantity</td></tr><tr id="row_56"><td class="val" id="row_56_0">cucumbers</td><td class="val" id="row_56_1">10</td></tr><tr id="row_57"><td class="val" id="row_57_0">strawberrys</td><td class="val" id="row_57_1">5</td></tr><tr id="row_58"><td class="val" id="row_58_0">apricots</td><td class="val" id="row_58_1">7</td></tr></table></li><li class="step skipped" id="features_scenario_outline_feature_60"><div><span class="keyword">When</span> <span class="step val">I eat <number> <fruits> from the pantry</span></div></li><li class="step skipped" id="features_scenario_outline_feature_61"><div><span class="keyword">Then</span> <span class="step val">I should have <left> <fruits> in the pantry</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_64"><th class="val skipped_param" id="row_64_0">number</th><th class="val skipped_param" id="row_64_1">fruits</th><th class="val skipped_param" id="row_64_2">left</th></tr><tr id="row_65"><td class="val passed" id="row_65_0">2</td><td class="val passed" id="row_65_1">cucumbers</td><td class="val passed" id="row_65_2">8</td></tr><tr id="row_66"><td class="val passed" id="row_66_0">4</td><td class="val passed" id="row_66_1">strawberrys</td><td class="val passed" id="row_66_2">1</td></tr><tr id="row_67"><td class="val passed" id="row_67_0">2</td><td class="val passed" id="row_67_1">apricots</td><td class="val passed" id="row_67_2">5</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">placeholder in a multiline string</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_70"><div><span class="keyword">Given</span> <span class="step val">my shopping list</span></div><pre class="val"> Must buy some <fruits></pre></li><li class="step skipped" id="features_scenario_outline_feature_74"><div><span class="keyword">Then</span> <span class="step val">my shopping list should equal</span></div><pre class="val"> Must buy some cucumbers</pre></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_80"><th class="val skipped_param" id="row_80_0">fruits</th></tr><tr id="row_81"><td class="val passed" id="row_81_0">cucumbers</td></tr></table></div></div><div class="scenario outline"><h3><span class="keyword">Scenario Outline:</span> <span class="val">placeholder in step table</span></h3><ol><li class="step skipped" id="features_scenario_outline_feature_84"><div><span class="keyword">Given</span> <span class="step val">I have the following fruits in my pantry</span></div><table><tr id="row_85"><td class="val" id="row_85_0">name</td><td class="val" id="row_85_1">quantity</td></tr><tr id="row_86"><td class="val" id="row_86_0">cucumbers</td><td class="val" id="row_86_1"><quant_cukes></td></tr><tr id="row_87"><td class="val" id="row_87_0">strawberrys</td><td class="val" id="row_87_1"><quant_straw></td></tr></table></li><li class="step skipped" id="features_scenario_outline_feature_89"><div><span class="keyword">When</span> <span class="step val">I eat <number> <fruits> from the pantry</span></div></li><li class="step skipped" id="features_scenario_outline_feature_90"><div><span class="keyword">Then</span> <span class="step val">I should have <left> <fruits> in the pantry</span></div></li></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr id="row_93"><th class="val skipped_param" id="row_93_0">quant_cukes</th><th class="val skipped_param" id="row_93_1">quant_straw</th><th class="val skipped_param" id="row_93_2">number</th><th class="val skipped_param" id="row_93_3">fruits</th><th class="val skipped_param" id="row_93_4">left</th></tr><tr id="row_94"><td class="val passed" id="row_94_0">10</td><td class="val passed" id="row_94_1">5</td><td class="val passed" id="row_94_2">2</td><td class="val passed" id="row_94_3">cucumbers</td><td class="val passed" id="row_94_4">8</td></tr><tr id="row_95"><td class="val passed" id="row_95_0">5</td><td class="val passed" id="row_95_1">5</td><td class="val passed" id="row_95_2">4</td><td class="val passed" id="row_95_3">strawberrys</td><td class="val passed" id="row_95_4">1</td></tr></table></div></div></div><div class="feature"><h2><span class="val">Feature: Cucumber</span></h2><p class="narrative">In order to have a happy user base<br/>As a Cucumber user<br/>I don't want no stinkin bugs<br/></p><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">RSpec be_*</span></h3><ol><li class="step passed" id="features_tickets_feature_7"><div><span class="keyword">Given</span> <span class="step val">be_empty</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Call step from step</span></h3><ol><li class="step passed" id="features_tickets_feature_10"><div><span class="keyword">Given</span> <span class="step val">nested step is called</span></div></li><li class="step passed" id="features_tickets_feature_11"><div><span class="keyword">Then</span> <span class="step val">nested step should be executed</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Call step from step using text table</span></h3><ol><li class="step passed" id="features_tickets_feature_14"><div><span class="keyword">Given</span> <span class="step val">nested step is called using text table</span></div></li><li class="step passed" id="features_tickets_feature_15"><div><span class="keyword">Then</span> <span class="step val">nested step should be executed</span></div></li></ol></div><div class="scenario"><h3><span class="keyword">Scenario:</span> <span class="val">Reading a table</span></h3><ol><li class="step passed" id="features_tickets_feature_18"><div><span class="keyword">Given</span> <span class="step val">the following table</span></div><table><tr id="row_19"><td class="val" id="row_19_0">born</td><td class="val" id="row_19_1">working</td></tr><tr id="row_20"><td class="val" id="row_20_0">Oslo</td><td class="val" id="row_20_1">London</td></tr></table></li><li class="step passed" id="features_tickets_feature_21"><div><span class="keyword">Then</span> <span class="step val">I should be <span class="param">working</span> in <span class="param">London</span></span></div></li><li class="step passed" id="features_tickets_feature_22"><div><span class="keyword">And</span> <span class="step val">I should be <span class="param">born</span> in <span class="param">Oslo</span></span></div></li><li class="step passed" id="features_tickets_feature_23"><div><span class="keyword">And</span> <span class="step val">I should see a multiline string like</span></div><pre class="val">A string
that spans
several lines</pre></li></ol></div></div><div class="summary">43 scenarios (12 undefined, 2 pending, 29 passed)</div><div class="summary">173 steps (5 skipped, 89 undefined, 2 pending, 77 passed)</div><div class="duration">0m0.701s</div></div></body></html>
|
data/gem_tasks/examples.rake
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
desc 'Run all exmples'
|
2
2
|
task :examples do
|
3
3
|
Dir['examples/*'].each do |example_dir|
|
4
|
-
next if !File.directory?(example_dir) || %w{examples/i18n examples/
|
4
|
+
next if !File.directory?(example_dir) || %w{examples/i18n examples/python examples/ruby2python}.index(example_dir)
|
5
5
|
puts "Running #{example_dir}"
|
6
6
|
Dir.chdir(example_dir) do
|
7
7
|
raise "No Rakefile in #{Dir.pwd}" unless File.file?('Rakefile')
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
require 'cucumber/platform'
|
4
|
+
|
5
|
+
Cucumber::Rake::Task.new do |t|
|
6
|
+
if(Cucumber::JRUBY)
|
7
|
+
t.profile = Cucumber::WINDOWS ? 'jruby_win' : 'jruby'
|
8
|
+
elsif(Cucumber::WINDOWS_MRI)
|
9
|
+
t.profile = 'windows_mri'
|
10
|
+
elsif(Cucumber::RUBY_1_9)
|
11
|
+
t.profile = 'ruby_1_9'
|
12
|
+
end
|
13
|
+
t.rcov = ENV['RCOV']
|
14
|
+
end
|
data/gem_tasks/sdoc.rake
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
begin
|
2
|
+
require 'rake/rdoctask'
|
3
|
+
require 'sdoc' # and use your RDoc task the same way you used it before
|
4
|
+
|
5
|
+
Rake::RDocTask.new(:sdoc) do |rdoc|
|
6
|
+
rdoc.rdoc_dir = 'doc/sdoc'
|
7
|
+
rdoc.title = "Cucumber"
|
8
|
+
rdoc.options += %w{--fmt shtml -N --webcvs=http://github.com/aslakhellesoy/cucumber/blob/v0.3.96/%s --title "Cucumber API" --threads 4 --main README --exclude cucumber/parser lib}
|
9
|
+
rdoc.template = 'direct' # lighter template used on railsapi.com
|
10
|
+
end
|
11
|
+
rescue LoadError => ignore
|
12
|
+
end
|
data/lib/cucumber.rb
CHANGED
@@ -7,21 +7,9 @@ require 'cucumber/parser'
|
|
7
7
|
require 'cucumber/step_mother'
|
8
8
|
require 'cucumber/cli/main'
|
9
9
|
require 'cucumber/broadcaster'
|
10
|
-
require 'cucumber/step_definitions'
|
11
10
|
|
12
11
|
module Cucumber
|
13
12
|
class << self
|
14
13
|
attr_accessor :wants_to_quit
|
15
|
-
|
16
|
-
def logger
|
17
|
-
return @log if @log
|
18
|
-
@log = Logger.new(STDOUT)
|
19
|
-
@log.level = Logger::INFO
|
20
|
-
@log
|
21
|
-
end
|
22
|
-
|
23
|
-
def logger=(logger)
|
24
|
-
@log = logger
|
25
|
-
end
|
26
14
|
end
|
27
15
|
end
|
data/lib/cucumber/ast.rb
CHANGED
@@ -9,7 +9,7 @@ require 'cucumber/ast/step_collection'
|
|
9
9
|
require 'cucumber/ast/step'
|
10
10
|
require 'cucumber/ast/table'
|
11
11
|
require 'cucumber/ast/tags'
|
12
|
-
require 'cucumber/ast/
|
12
|
+
require 'cucumber/ast/py_string'
|
13
13
|
require 'cucumber/ast/outline_table'
|
14
14
|
require 'cucumber/ast/examples'
|
15
15
|
require 'cucumber/ast/visitor'
|
@@ -1,15 +1,13 @@
|
|
1
1
|
require 'cucumber/ast/feature_element'
|
2
|
-
require 'cucumber/ast/names'
|
3
2
|
|
4
3
|
module Cucumber
|
5
4
|
module Ast
|
6
5
|
class Background #:nodoc:
|
7
6
|
include FeatureElement
|
8
|
-
include Names
|
9
7
|
attr_reader :feature_elements
|
10
8
|
|
11
|
-
def initialize(comment, line, keyword,
|
12
|
-
@comment, @line, @keyword, @
|
9
|
+
def initialize(comment, line, keyword, name, raw_steps)
|
10
|
+
@comment, @line, @keyword, @name, @raw_steps = comment, line, keyword, name, raw_steps
|
13
11
|
@feature_elements = []
|
14
12
|
end
|
15
13
|
|
@@ -34,18 +32,16 @@ module Cucumber
|
|
34
32
|
return if Cucumber.wants_to_quit
|
35
33
|
init
|
36
34
|
visitor.visit_comment(@comment) unless @comment.empty?
|
37
|
-
visitor.visit_background_name(@keyword, name, file_colon_line(@line), source_indent(first_line_length))
|
35
|
+
visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
|
38
36
|
with_visitor(hook_context, visitor) do
|
39
37
|
visitor.step_mother.before(hook_context)
|
40
|
-
skip_invoke! if failed?
|
41
38
|
visitor.visit_steps(@step_invocations)
|
42
|
-
@failed = @step_invocations.detect{|step_invocation| step_invocation.exception
|
39
|
+
@failed = @step_invocations.detect{|step_invocation| step_invocation.exception}
|
43
40
|
visitor.step_mother.after(hook_context) if @failed || @feature_elements.empty?
|
44
41
|
end
|
45
42
|
end
|
46
43
|
|
47
44
|
def with_visitor(scenario, visitor)
|
48
|
-
@current_visitor = visitor
|
49
45
|
init
|
50
46
|
if self != scenario && scenario.respond_to?(:with_visitor)
|
51
47
|
scenario.with_visitor(visitor) do
|
@@ -66,10 +62,6 @@ module Cucumber
|
|
66
62
|
end
|
67
63
|
end
|
68
64
|
|
69
|
-
def skip_invoke!
|
70
|
-
@step_invocations.each{|step_invocation| step_invocation.skip_invoke!}
|
71
|
-
end
|
72
|
-
|
73
65
|
def failed?
|
74
66
|
@failed
|
75
67
|
end
|
@@ -81,21 +73,13 @@ module Cucumber
|
|
81
73
|
def to_sexp
|
82
74
|
init
|
83
75
|
sexp = [:background, @line, @keyword]
|
84
|
-
sexp += [name] unless name.empty?
|
76
|
+
sexp += [@name] unless @name.empty?
|
85
77
|
comment = @comment.to_sexp
|
86
78
|
sexp += [comment] if comment
|
87
79
|
steps = @steps.to_sexp
|
88
80
|
sexp += steps if steps.any?
|
89
81
|
sexp
|
90
82
|
end
|
91
|
-
|
92
|
-
def fail!(exception)
|
93
|
-
@failed = true
|
94
|
-
@exception = exception
|
95
|
-
@current_visitor.visit_exception(@exception, :failed)
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
83
|
end
|
100
84
|
end
|
101
85
|
end
|
@@ -1,24 +1,16 @@
|
|
1
|
-
require 'cucumber/ast/names'
|
2
|
-
|
3
1
|
module Cucumber
|
4
2
|
module Ast
|
5
3
|
class Examples #:nodoc:
|
6
|
-
include Names
|
7
4
|
attr_writer :outline_table
|
8
5
|
|
9
|
-
def initialize(comment, line, keyword,
|
10
|
-
@comment, @keyword, @
|
11
|
-
end
|
12
|
-
|
13
|
-
attr_reader :gherkin_statement
|
14
|
-
def gherkin_statement(statement=nil)
|
15
|
-
@gherkin_statement ||= statement
|
6
|
+
def initialize(comment, line, keyword, name, outline_table)
|
7
|
+
@comment, @keyword, @name, @outline_table = comment, keyword, name, outline_table
|
16
8
|
end
|
17
9
|
|
18
10
|
def accept(visitor)
|
19
11
|
return if Cucumber.wants_to_quit
|
20
12
|
visitor.visit_comment(@comment) unless @comment.empty?
|
21
|
-
visitor.visit_examples_name(@keyword, name)
|
13
|
+
visitor.visit_examples_name(@keyword, @name)
|
22
14
|
visitor.visit_outline_table(@outline_table)
|
23
15
|
end
|
24
16
|
|
@@ -35,7 +27,7 @@ module Cucumber
|
|
35
27
|
end
|
36
28
|
|
37
29
|
def to_sexp
|
38
|
-
sexp = [:examples, @keyword, name]
|
30
|
+
sexp = [:examples, @keyword, @name]
|
39
31
|
comment = @comment.to_sexp
|
40
32
|
sexp += [comment] if comment
|
41
33
|
sexp += [@outline_table.to_sexp]
|
data/lib/cucumber/ast/feature.rb
CHANGED
@@ -1,22 +1,14 @@
|
|
1
|
-
require 'cucumber/ast/names'
|
2
|
-
|
3
1
|
module Cucumber
|
4
2
|
module Ast
|
5
3
|
# Represents the root node of a parsed feature.
|
6
4
|
class Feature #:nodoc:
|
7
|
-
include Names
|
8
|
-
|
9
5
|
attr_accessor :language
|
10
6
|
attr_writer :features, :background
|
11
7
|
attr_reader :file
|
8
|
+
attr_reader :name
|
12
9
|
|
13
|
-
def initialize(background, comment, tags, keyword,
|
14
|
-
@background, @comment, @tags, @keyword, @
|
15
|
-
end
|
16
|
-
|
17
|
-
attr_reader :gherkin_statement
|
18
|
-
def gherkin_statement(statement=nil)
|
19
|
-
@gherkin_statement ||= statement
|
10
|
+
def initialize(background, comment, tags, keyword, name, feature_elements)
|
11
|
+
@background, @comment, @tags, @keyword, @name, @feature_elements = background, comment, tags, keyword, name.strip, feature_elements
|
20
12
|
end
|
21
13
|
|
22
14
|
def init
|
@@ -46,7 +38,7 @@ module Cucumber
|
|
46
38
|
|
47
39
|
def indented_name
|
48
40
|
indent = ""
|
49
|
-
name.split("\n").map do |l|
|
41
|
+
@name.split("\n").map do |l|
|
50
42
|
s = "#{indent}#{l}"
|
51
43
|
indent = " "
|
52
44
|
s
|
@@ -92,7 +84,7 @@ module Cucumber
|
|
92
84
|
|
93
85
|
def to_sexp
|
94
86
|
init
|
95
|
-
sexp = [:feature, @file, name]
|
87
|
+
sexp = [:feature, @file, @name]
|
96
88
|
comment = @comment.to_sexp
|
97
89
|
sexp += [comment] if comment
|
98
90
|
tags = @tags.to_sexp
|
@@ -6,11 +6,6 @@ module Cucumber
|
|
6
6
|
module FeatureElement #:nodoc:
|
7
7
|
attr_accessor :feature
|
8
8
|
|
9
|
-
attr_reader :gherkin_statement, :raw_steps, :title, :description
|
10
|
-
def gherkin_statement(statement=nil)
|
11
|
-
@gherkin_statement ||= statement
|
12
|
-
end
|
13
|
-
|
14
9
|
def add_step(step)
|
15
10
|
@raw_steps << step
|
16
11
|
end
|
@@ -32,10 +27,10 @@ module Cucumber
|
|
32
27
|
end
|
33
28
|
|
34
29
|
def name_line_lengths
|
35
|
-
if name.strip.empty?
|
30
|
+
if @name.strip.empty?
|
36
31
|
[Ast::Step::INDENT + @keyword.unpack('U*').length + ': '.length]
|
37
32
|
else
|
38
|
-
name.split("\n").enum_for(:each_with_index).map do |line, line_number|
|
33
|
+
@name.split("\n").enum_for(:each_with_index).map do |line, line_number|
|
39
34
|
if line_number == 0
|
40
35
|
Ast::Step::INDENT + @keyword.unpack('U*').length + ': '.length + line.unpack('U*').length
|
41
36
|
else
|
@@ -46,10 +41,10 @@ module Cucumber
|
|
46
41
|
end
|
47
42
|
|
48
43
|
def matches_scenario_names?(scenario_name_regexps)
|
49
|
-
scenario_name_regexps.detect{|
|
44
|
+
scenario_name_regexps.detect{|name| name =~ @name}
|
50
45
|
end
|
51
46
|
|
52
|
-
def backtrace_line(name = "#{@keyword}: #{name}", line = @line)
|
47
|
+
def backtrace_line(name = "#{@keyword}: #{@name}", line = @line)
|
53
48
|
@feature.backtrace_line(name, line) if @feature
|
54
49
|
end
|
55
50
|
|
@@ -21,7 +21,7 @@ module Cucumber
|
|
21
21
|
return if Cucumber.wants_to_quit
|
22
22
|
init
|
23
23
|
cells_rows.each_with_index do |row, n|
|
24
|
-
if(visitor.
|
24
|
+
if(visitor.options[:expand])
|
25
25
|
row.accept(visitor)
|
26
26
|
else
|
27
27
|
visitor.visit_table_row(row)
|
@@ -96,7 +96,7 @@ module Cucumber
|
|
96
96
|
|
97
97
|
def accept(visitor)
|
98
98
|
return if Cucumber.wants_to_quit
|
99
|
-
visitor.
|
99
|
+
visitor.options[:expand] ? accept_expand(visitor) : accept_plain(visitor)
|
100
100
|
end
|
101
101
|
|
102
102
|
def accept_plain(visitor)
|
@@ -108,7 +108,7 @@ module Cucumber
|
|
108
108
|
else
|
109
109
|
visitor.step_mother.with_hooks(self) do
|
110
110
|
@step_invocations.each do |step_invocation|
|
111
|
-
step_invocation.invoke(visitor.step_mother, visitor.
|
111
|
+
step_invocation.invoke(visitor.step_mother, visitor.options)
|
112
112
|
@exception ||= step_invocation.reported_exception
|
113
113
|
end
|
114
114
|
|
@@ -127,7 +127,7 @@ module Cucumber
|
|
127
127
|
visitor.step_mother.with_hooks(self) do
|
128
128
|
@table.visit_scenario_name(visitor, self)
|
129
129
|
@step_invocations.each do |step_invocation|
|
130
|
-
step_invocation.invoke(visitor.step_mother, visitor.
|
130
|
+
step_invocation.invoke(visitor.step_mother, visitor.options)
|
131
131
|
@exception ||= step_invocation.reported_exception
|
132
132
|
step_invocation.visit_step_result(visitor)
|
133
133
|
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module Cucumber
|
2
|
+
module Ast
|
3
|
+
# Represents an inline argument in a step. Example:
|
4
|
+
#
|
5
|
+
# Given the message
|
6
|
+
# """
|
7
|
+
# I like
|
8
|
+
# Cucumber sandwich
|
9
|
+
# """
|
10
|
+
#
|
11
|
+
# The text between the pair of <tt>"""</tt> is stored inside a PyString,
|
12
|
+
# which is yielded to the StepDefinition block as the last argument.
|
13
|
+
#
|
14
|
+
# The StepDefinition can then access the String via the #to_s method. In the
|
15
|
+
# example above, that would return: <tt>"I like\nCucumber sandwich"</tt>
|
16
|
+
#
|
17
|
+
# Note how the indentation from the source is stripped away.
|
18
|
+
#
|
19
|
+
class PyString #:nodoc:
|
20
|
+
class Builder
|
21
|
+
attr_reader :string
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
@string = ''
|
25
|
+
end
|
26
|
+
|
27
|
+
def py_string(string, line_number)
|
28
|
+
@string = string
|
29
|
+
end
|
30
|
+
|
31
|
+
def eof
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
attr_accessor :file
|
36
|
+
|
37
|
+
def self.default_arg_name
|
38
|
+
"string"
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.parse(text)
|
42
|
+
builder = Builder.new
|
43
|
+
lexer = Gherkin::I18nLexer.new(builder)
|
44
|
+
lexer.scan(text)
|
45
|
+
new(builder.string)
|
46
|
+
end
|
47
|
+
|
48
|
+
def initialize(string)
|
49
|
+
@string = string
|
50
|
+
end
|
51
|
+
|
52
|
+
def to_step_definition_arg
|
53
|
+
@string
|
54
|
+
end
|
55
|
+
|
56
|
+
def accept(visitor)
|
57
|
+
return if Cucumber.wants_to_quit
|
58
|
+
visitor.visit_py_string(@string)
|
59
|
+
end
|
60
|
+
|
61
|
+
def arguments_replaced(arguments) #:nodoc:
|
62
|
+
string = @string
|
63
|
+
arguments.each do |name, value|
|
64
|
+
value ||= ''
|
65
|
+
string = string.gsub(name, value)
|
66
|
+
end
|
67
|
+
PyString.new(string)
|
68
|
+
end
|
69
|
+
|
70
|
+
def has_text?(text)
|
71
|
+
@string.index(text)
|
72
|
+
end
|
73
|
+
|
74
|
+
# For testing only
|
75
|
+
def to_sexp #:nodoc:
|
76
|
+
[:py_string, to_step_definition_arg]
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'cucumber/ast/feature_element'
|
2
|
-
require 'cucumber/ast/names'
|
3
2
|
|
4
3
|
module Cucumber
|
5
4
|
module Ast
|
6
5
|
class Scenario #:nodoc:
|
7
6
|
include FeatureElement
|
8
|
-
include Names
|
9
7
|
|
10
|
-
attr_reader :line
|
8
|
+
attr_reader :name, :line
|
11
9
|
|
12
10
|
class EmptyBackground
|
13
11
|
def failed?
|
@@ -26,9 +24,9 @@ module Cucumber
|
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
29
|
-
def initialize(background, comment, tags, line, keyword,
|
27
|
+
def initialize(background, comment, tags, line, keyword, name, raw_steps)
|
30
28
|
@background = background || EmptyBackground.new
|
31
|
-
@comment, @tags, @line, @keyword, @
|
29
|
+
@comment, @tags, @line, @keyword, @name, @raw_steps = comment, tags, line, keyword, name, raw_steps
|
32
30
|
@exception = @executed = nil
|
33
31
|
end
|
34
32
|
|
@@ -47,7 +45,7 @@ module Cucumber
|
|
47
45
|
with_visitor(visitor) do
|
48
46
|
visitor.visit_comment(@comment) unless @comment.empty?
|
49
47
|
visitor.visit_tags(@tags)
|
50
|
-
visitor.visit_scenario_name(@keyword, name, file_colon_line(@line), source_indent(first_line_length))
|
48
|
+
visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
|
51
49
|
|
52
50
|
skip_invoke! if @background.failed?
|
53
51
|
visitor.step_mother.with_hooks(self, skip_hooks?) do
|
@@ -92,7 +90,7 @@ module Cucumber
|
|
92
90
|
end
|
93
91
|
|
94
92
|
def to_sexp
|
95
|
-
sexp = [:scenario, @line, @keyword, name]
|
93
|
+
sexp = [:scenario, @line, @keyword, @name]
|
96
94
|
comment = @comment.to_sexp
|
97
95
|
sexp += [comment] if comment
|
98
96
|
tags = @tags.to_sexp
|