cucumber 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -0
- data/Rakefile +4 -2
- data/VERSION.yml +1 -1
- data/cucumber.gemspec +17 -11
- data/cucumber.yml +1 -0
- data/examples/i18n/no/features/support/env.rb +1 -0
- data/features/html_formatter/a.html +4 -4
- data/features/profiles.feature +17 -3
- data/features/step_definitions/cucumber_steps.rb +1 -1
- data/features/support/env.rb +1 -5
- data/gem_tasks/features.rake +1 -1
- data/lib/cucumber/cli/options.rb +17 -13
- data/lib/cucumber/formatter/console.rb +3 -3
- data/lib/cucumber/formatter/html.rb +19 -10
- data/lib/cucumber/formatter/pdf.rb +12 -4
- data/lib/cucumber/formatter/pretty.rb +1 -1
- data/lib/cucumber/formatter/progress.rb +1 -1
- data/lib/cucumber/formatter/unicode.rb +22 -10
- data/lib/cucumber/language_support/language_methods.rb +4 -0
- data/lib/cucumber/wire_support/connection.rb +7 -2
- data/spec/cucumber/wire_support/connection_spec.rb +46 -0
- metadata +27 -7
- data/lib/cucumber/webrat/element_locator.rb +0 -93
- data/lib/cucumber/webrat/table_locator.rb +0 -1
data/History.txt
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
== 0.6.2 2010-01-18
|
2
|
+
|
3
|
+
=== Bugfixes
|
4
|
+
* Update --help for --tags which was out of date. (Aslak Hellesøy)
|
5
|
+
* Explicitly use Prawn 0.6.3 for pdf formatter since 0.7.1 is broken (Aslak Hellesøy)
|
6
|
+
* PDF formatter renders tables incorrectly (#553 Andy Waite)
|
7
|
+
* Better colouring in HTML report (Rob Aldred)
|
8
|
+
* Detect output encoding properly on JRuby+Windows (Aslak Hellesøy)
|
9
|
+
* Added option to override output encoding on Windows with an CUCUMBER_OUTPUT_ENCODING env var (Aslak Hellesøy)
|
10
|
+
* PDF generation requires 'prawn-format' (#558 Aslak Hellesøy)
|
11
|
+
|
12
|
+
=== New features
|
13
|
+
* Show profiles in error scenario summary. (#550 Joseph Wilk)
|
14
|
+
|
15
|
+
=== Removed features
|
16
|
+
* element_at and table_at have been removed. Use tableish in cucumber-rails instead. (Aslak Hellesœy)
|
17
|
+
|
1
18
|
== 0.6.1 2010-01-03
|
2
19
|
|
3
20
|
=== Bugfixes
|
data/Rakefile
CHANGED
@@ -25,8 +25,10 @@ begin
|
|
25
25
|
gem.add_dependency 'json_pure', '>= 1.2.0'
|
26
26
|
|
27
27
|
gem.add_development_dependency 'nokogiri', '>= 1.4.1'
|
28
|
-
gem.add_development_dependency 'prawn', '
|
29
|
-
gem.add_development_dependency '
|
28
|
+
gem.add_development_dependency 'prawn', '= 0.6.3'
|
29
|
+
gem.add_development_dependency 'prawn-format', '= 0.2.3'
|
30
|
+
gem.add_development_dependency 'rspec', '>= 1.3.0'
|
31
|
+
gem.add_development_dependency 'syntax', '>= 1.0.0'
|
30
32
|
gem.add_development_dependency 'spork', '>= 0.7.5' unless Cucumber::JRUBY || Cucumber::WINDOWS
|
31
33
|
|
32
34
|
extend Cucumber::Formatter::ANSIColor
|
data/VERSION.yml
CHANGED
data/cucumber.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cucumber}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Aslak Helles\303\270y"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-18}
|
13
13
|
s.default_executable = %q{cucumber}
|
14
14
|
s.description = %q{A BDD tool written in Ruby}
|
15
15
|
s.email = %q{cukes@googlegroups.com}
|
@@ -474,8 +474,6 @@ Gem::Specification.new do |s|
|
|
474
474
|
"lib/cucumber/step_match.rb",
|
475
475
|
"lib/cucumber/step_mother.rb",
|
476
476
|
"lib/cucumber/tag_expression.rb",
|
477
|
-
"lib/cucumber/webrat/element_locator.rb",
|
478
|
-
"lib/cucumber/webrat/table_locator.rb",
|
479
477
|
"lib/cucumber/wire_support/configuration.rb",
|
480
478
|
"lib/cucumber/wire_support/connection.rb",
|
481
479
|
"lib/cucumber/wire_support/request_handler.rb",
|
@@ -533,6 +531,7 @@ Gem::Specification.new do |s|
|
|
533
531
|
"spec/cucumber/treetop_parser/with_comments.feature",
|
534
532
|
"spec/cucumber/treetop_parser/with_tags.feature",
|
535
533
|
"spec/cucumber/wire_support/configuration_spec.rb",
|
534
|
+
"spec/cucumber/wire_support/connection_spec.rb",
|
536
535
|
"spec/cucumber/wire_support/wire_exception_spec.rb",
|
537
536
|
"spec/cucumber/wire_support/wire_language_spec.rb",
|
538
537
|
"spec/cucumber/wire_support/wire_packet_spec.rb",
|
@@ -547,7 +546,7 @@ Gem::Specification.new do |s|
|
|
547
546
|
|
548
547
|
(::) U P G R A D I N G (::)
|
549
548
|
|
550
|
-
Thank you for installing cucumber-0.6.
|
549
|
+
Thank you for installing cucumber-0.6.2.
|
551
550
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
|
552
551
|
for important information about this release. Happy cuking!
|
553
552
|
|
@@ -594,6 +593,7 @@ for important information about this release. Happy cuking!
|
|
594
593
|
"spec/cucumber/step_mother_spec.rb",
|
595
594
|
"spec/cucumber/tag_expression_spec.rb",
|
596
595
|
"spec/cucumber/wire_support/configuration_spec.rb",
|
596
|
+
"spec/cucumber/wire_support/connection_spec.rb",
|
597
597
|
"spec/cucumber/wire_support/wire_exception_spec.rb",
|
598
598
|
"spec/cucumber/wire_support/wire_language_spec.rb",
|
599
599
|
"spec/cucumber/wire_support/wire_packet_spec.rb",
|
@@ -729,8 +729,10 @@ for important information about this release. Happy cuking!
|
|
729
729
|
s.add_runtime_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
730
730
|
s.add_runtime_dependency(%q<json_pure>, [">= 1.2.0"])
|
731
731
|
s.add_development_dependency(%q<nokogiri>, [">= 1.4.1"])
|
732
|
-
s.add_development_dependency(%q<prawn>, ["
|
733
|
-
s.add_development_dependency(%q<
|
732
|
+
s.add_development_dependency(%q<prawn>, ["= 0.6.3"])
|
733
|
+
s.add_development_dependency(%q<prawn-format>, ["= 0.2.3"])
|
734
|
+
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
735
|
+
s.add_development_dependency(%q<syntax>, [">= 1.0.0"])
|
734
736
|
s.add_development_dependency(%q<spork>, [">= 0.7.5"])
|
735
737
|
else
|
736
738
|
s.add_dependency(%q<term-ansicolor>, [">= 1.0.4"])
|
@@ -740,8 +742,10 @@ for important information about this release. Happy cuking!
|
|
740
742
|
s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
741
743
|
s.add_dependency(%q<json_pure>, [">= 1.2.0"])
|
742
744
|
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
743
|
-
s.add_dependency(%q<prawn>, ["
|
744
|
-
s.add_dependency(%q<
|
745
|
+
s.add_dependency(%q<prawn>, ["= 0.6.3"])
|
746
|
+
s.add_dependency(%q<prawn-format>, ["= 0.2.3"])
|
747
|
+
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
748
|
+
s.add_dependency(%q<syntax>, [">= 1.0.0"])
|
745
749
|
s.add_dependency(%q<spork>, [">= 0.7.5"])
|
746
750
|
end
|
747
751
|
else
|
@@ -752,8 +756,10 @@ for important information about this release. Happy cuking!
|
|
752
756
|
s.add_dependency(%q<diff-lcs>, [">= 1.1.2"])
|
753
757
|
s.add_dependency(%q<json_pure>, [">= 1.2.0"])
|
754
758
|
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
755
|
-
s.add_dependency(%q<prawn>, ["
|
756
|
-
s.add_dependency(%q<
|
759
|
+
s.add_dependency(%q<prawn>, ["= 0.6.3"])
|
760
|
+
s.add_dependency(%q<prawn-format>, ["= 0.2.3"])
|
761
|
+
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
762
|
+
s.add_dependency(%q<syntax>, [">= 1.0.0"])
|
757
763
|
s.add_dependency(%q<spork>, [">= 0.7.5"])
|
758
764
|
end
|
759
765
|
end
|
data/cucumber.yml
CHANGED
@@ -5,6 +5,7 @@ std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
|
|
5
5
|
%>
|
6
6
|
default: <%= std_opts %>
|
7
7
|
jruby: <%= std_opts %> --tags ~@spork --tags ~@wire
|
8
|
+
jruby_win: <%= std_opts %> --tags ~@spork --tags ~@wire CUCUMBER_FORWARD_SLASH_PATHS=true
|
8
9
|
run_code_run: <%= std_opts %> --tags ~@spork
|
9
10
|
windows_mri: <%= std_opts %> --tags ~@spork --tags ~@wire --tags ~@needs-many-fonts CUCUMBER_FORWARD_SLASH_PATHS=true
|
10
11
|
ruby_1_9: <%= std_opts %> --tags ~@fails_on_1_9
|
@@ -303,7 +303,7 @@ features/background/scenario_outline_failing_background.feature:4:in `Given fail
|
|
303
303
|
<span class="offending"><span class="linenum">2</span><span class="keyword">end</span></span></code></pre></li> <script type="text/javascript">moveProgressBar('29.5');</script></ol></div><div class='scenario outline'><h3 id="scenario_13"><span class="keyword">Scenario Outline:</span> <span class="val">failing background</span></h3><ol><li id='features_background_scenario_outline_failing_background_feature_7' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('30.1');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_9'><th class="step skipped_param" id="row_9_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('30.7');</script><tr class='step' id='row_10'><td class="step skipped" id="row_10_0"><div><span class="step param">10</span></div></td></tr><tr><td class="failed" colspan="1"><pre>FAIL
|
304
304
|
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
305
305
|
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
306
|
-
features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'</pre></td></tr> <script type="text/javascript">moveProgressBar('31.3');</script></table></div></div><div class='scenario outline'><h3 id="scenario_14"><span class="keyword">Scenario Outline:</span> <span class="val">another failing background</span></h3><ol><li id='features_background_scenario_outline_failing_background_feature_13' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('31.9');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_15'><th class="step skipped_param" id="row_15_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('32.5');</script><tr class='step' id='row_16'><td class="step skipped" id="row_16_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('33.1');</script></table></div></div></div><div class="feature"><h2><span class="val">Feature: Passing background with scenario outlines sample</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_4' class='step passed'><div><span class="keyword">Given</span> <span class="step val">'<span class="param">10</span>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('33.7');</script></ol></div><div class='scenario outline'><h3 id="scenario_15"><span class="keyword">Scenario Outline:</span> <span class="val">passing background</span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_7' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('34.3');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_9'><th class="step skipped_param" id="row_9_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('34.9');</script><tr class='step' id='row_10'><td class="step passed" id="row_10_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('35.5');</script></table></div></div><div class='scenario outline'><h3 id="scenario_16"><span class="keyword">Scenario Outline:</span> <span class="val">another passing background</span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_13' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('36.0');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_15'><th class="step skipped_param" id="row_15_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('36.6');</script><tr class='step' id='row_16'><td class="step passed" id="row_16_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('37.2');</script></table></div></div></div><div class="feature"><h2><span class="val">Feature: Calling undefined step</span></h2><p class="narrative"></p><div class='scenario'><h3 id="scenario_17"><span class="keyword">Scenario:</span> <span class="val">Call directly</span></h3><ol><script>makeYellow('scenario_17');</script><li id='features_call_undefined_step_from_step_def_feature_4' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">a step definition that calls an undefined step</span></div><div class="message"><pre>Undefined step: "this does not exist"</pre></div><div class="backtrace"><pre>./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
|
306
|
+
features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'</pre></td></tr><script>makeRed('scenario_13');</script> <script type="text/javascript">moveProgressBar('31.3');</script></table></div></div><div class='scenario outline'><h3 id="scenario_14"><span class="keyword">Scenario Outline:</span> <span class="val">another failing background</span></h3><ol><li id='features_background_scenario_outline_failing_background_feature_13' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('31.9');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_15'><th class="step skipped_param" id="row_15_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('32.5');</script><tr class='step' id='row_16'><td class="step skipped" id="row_16_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('33.1');</script></table></div></div></div><div class="feature"><h2><span class="val">Feature: Passing background with scenario outlines sample</span></h2><p class="narrative"></p><div class="background"><h3><span class="keyword">Background:</span> <span class="val"></span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_4' class='step passed'><div><span class="keyword">Given</span> <span class="step val">'<span class="param">10</span>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('33.7');</script></ol></div><div class='scenario outline'><h3 id="scenario_15"><span class="keyword">Scenario Outline:</span> <span class="val">passing background</span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_7' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('34.3');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_9'><th class="step skipped_param" id="row_9_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('34.9');</script><tr class='step' id='row_10'><td class="step passed" id="row_10_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('35.5');</script></table></div></div><div class='scenario outline'><h3 id="scenario_16"><span class="keyword">Scenario Outline:</span> <span class="val">another passing background</span></h3><ol><li id='features_background_scenario_outline_passing_background_feature_13' class='step skipped'><div><span class="keyword">Then</span> <span class="step val">I should have '<count>' cukes</span></div></li> <script type="text/javascript">moveProgressBar('36.0');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_15'><th class="step skipped_param" id="row_15_0"><div><span class="step param">count</span></div></th></tr> <script type="text/javascript">moveProgressBar('36.6');</script><tr class='step' id='row_16'><td class="step passed" id="row_16_0"><div><span class="step param">10</span></div></td></tr> <script type="text/javascript">moveProgressBar('37.2');</script></table></div></div></div><div class="feature"><h2><span class="val">Feature: Calling undefined step</span></h2><p class="narrative"></p><div class='scenario'><h3 id="scenario_17"><span class="keyword">Scenario:</span> <span class="val">Call directly</span></h3><ol><script>makeYellow('scenario_17');</script><li id='features_call_undefined_step_from_step_def_feature_4' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">a step definition that calls an undefined step</span></div><div class="message"><pre>Undefined step: "this does not exist"</pre></div><div class="backtrace"><pre>./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
|
307
307
|
features/call_undefined_step_from_step_def.feature:4:in `Given a step definition that calls an undefined step':in `/^a step definition that calls an undefined step$/'
|
308
308
|
./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
|
309
309
|
features/call_undefined_step_from_step_def.feature:4:in `Given a step definition that calls an undefined step':in `Given a step definition that calls an undefined step'</pre></div><pre class="ruby"><code><span class="linenum">18</span>
|
@@ -353,7 +353,7 @@ which goes on and on and on for three lines
|
|
353
353
|
yawn</span></h4><table><tr class='step' id='row_26'><th class="step skipped_param" id="row_26_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('46.7');</script><tr class='step' id='row_27'><td class="step passed" id="row_27_0"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('47.3');</script></table></div></div></div><div class="feature"><h2><span class="val">Feature: Outline Sample</span></h2><p class="narrative"></p><div class='scenario'><h3 id="scenario_24"><span class="keyword">Scenario:</span> <span class="val">I have no steps</span></h3><ol></ol></div><div class='scenario outline'><h3 id="scenario_25"><span class="keyword">Scenario Outline:</span> <span class="val">Test state</span></h3><ol><li id='features_outline_sample_feature_6' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('47.9');</script><li id='features_outline_sample_feature_7' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><other_state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('48.5');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Rainbow colours</span></h4><table><tr class='step' id='row_9'><th class="step skipped_param" id="row_9_0"><div><span class="step param">state</span></div></th><th class="step skipped_param" id="row_9_1"><div><span class="step param">other_state</span></div></th></tr> <script type="text/javascript">moveProgressBar('49.1');</script><tr class='step' id='row_10'><td class="step undefined" id="row_10_0"><div><span class="step param">missing</span></div></td><script>makeYellow('scenario_25');</script><td class="step skipped" id="row_10_1"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('49.7');</script><tr class='step' id='row_11'><td class="step passed" id="row_11_0"><div><span class="step param">passing</span></div></td><td class="step passed" id="row_11_1"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('50.2');</script><tr class='step' id='row_12'><td class="step failed" id="row_12_0"><div><span class="step param">failing</span></div></td><script>makeRed('scenario_25');</script><td class="step skipped" id="row_12_1"><div><span class="step param">passing</span></div></td></tr><tr><td class="failed" colspan="2"><pre>FAIL
|
354
354
|
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
355
355
|
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
356
|
-
features/outline_sample.feature:6:in `Given <state> without a table'</pre></td></tr> <script type="text/javascript">moveProgressBar('50.8');</script></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Only passing</span></h4><table><tr class='step' id='row_14'><th class="step skipped_param" id="row_14_0"><div><span class="step param">state</span></div></th><th class="step skipped_param" id="row_14_1"><div><span class="step param">other_state</span></div></th></tr> <script type="text/javascript">moveProgressBar('51.4');</script><tr class='step' id='row_15'><td class="step passed" id="row_15_0"><div><span class="step param">passing</span></div></td><td class="step passed" id="row_15_1"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('52.0');</script></table></div></div></div><div class="feature"><pre class="comment"># Feature comment<br/></pre><span class="tag">@one</span><h2><span class="val">Feature: Sample</span></h2><p class="narrative"></p><div class='scenario'><span class="tag">@two</span> <span class="tag">@three</span><h3 id="scenario_26"><span class="keyword">Scenario:</span> <span class="val">Missing</span></h3><ol><script>makeYellow('scenario_26');</script><li id='features_sample_feature_7' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">missing</span></div><pre>Given /^missing$/ do
|
356
|
+
features/outline_sample.feature:6:in `Given <state> without a table'</pre></td></tr><script></script> <script type="text/javascript">moveProgressBar('50.8');</script></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Only passing</span></h4><table><tr class='step' id='row_14'><th class="step skipped_param" id="row_14_0"><div><span class="step param">state</span></div></th><th class="step skipped_param" id="row_14_1"><div><span class="step param">other_state</span></div></th></tr> <script type="text/javascript">moveProgressBar('51.4');</script><tr class='step' id='row_15'><td class="step passed" id="row_15_0"><div><span class="step param">passing</span></div></td><td class="step passed" id="row_15_1"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('52.0');</script></table></div></div></div><div class="feature"><pre class="comment"># Feature comment<br/></pre><span class="tag">@one</span><h2><span class="val">Feature: Sample</span></h2><p class="narrative"></p><div class='scenario'><span class="tag">@two</span> <span class="tag">@three</span><h3 id="scenario_26"><span class="keyword">Scenario:</span> <span class="val">Missing</span></h3><ol><script>makeYellow('scenario_26');</script><li id='features_sample_feature_7' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">missing</span></div><pre>Given /^missing$/ do
|
357
357
|
pending # express the regexp above with the code you wish you had
|
358
358
|
end</pre></li> <script type="text/javascript">moveProgressBar('52.6');</script></ol></div><div class='scenario'><pre class="comment"># Scenario comment<br/></pre><span class="tag">@three</span><h3 id="scenario_27"><span class="keyword">Scenario:</span> <span class="val">Passing</span></h3><ol><li id='features_sample_feature_12' class='step passed'><div><span class="keyword">Given</span> <span class="step val">passing</span></div><table><tr class='step' id='row_13'><td class="step" id="row_13_0"><div><span class="step param">a</span></div></td><td class="step" id="row_13_1"><div><span class="step param">b</span></div></td></tr> <script type="text/javascript">moveProgressBar('53.8');</script><tr class='step' id='row_14'><td class="step" id="row_14_0"><div><span class="step param">c</span></div></td><td class="step" id="row_14_1"><div><span class="step param">d</span></div></td></tr> <script type="text/javascript">moveProgressBar('54.4');</script></table></li> <script type="text/javascript">moveProgressBar('54.4');</script></ol></div><div class='scenario'><span class="tag">@four</span><h3 id="scenario_28"><span class="keyword">Scenario:</span> <span class="val">Failing</span></h3><ol><script>makeRed('scenario_28');</script><li id='features_sample_feature_18' class='step failed'><div><span class="keyword">Given</span> <span class="step val">failing</span></div><pre class="val">hello</pre><div class="message"><pre>FAIL</pre></div><div class="backtrace"><pre>./features/step_definitions/sample_steps.rb:2:in `flunker'
|
359
359
|
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
@@ -378,10 +378,10 @@ features/search_sample.feature:10:in `Given failing without a table':in `Given f
|
|
378
378
|
<span class="offending"><span class="linenum">2</span><span class="keyword">end</span></span></code></pre></li> <script type="text/javascript">moveProgressBar('57.9');</script></ol></div><div class='scenario outline'><h3 id="scenario_31"><span class="keyword">Scenario Outline:</span> <span class="val">Ignore me</span></h3><ol><li id='features_search_sample_feature_13' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('58.5');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_15'><th class="step skipped_param" id="row_15_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('59.1');</script><tr class='step' id='row_16'><td class="step failed" id="row_16_0"><div><span class="step param">failing</span></div></td><script>makeRed('scenario_31');</script></tr><tr><td class="failed" colspan="1"><pre>FAIL
|
379
379
|
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
380
380
|
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
381
|
-
features/search_sample.feature:13:in `Given <state> without a table'</pre></td></tr> <script type="text/javascript">moveProgressBar('59.7');</script></table></div></div><div class='scenario outline'><h3 id="scenario_32"><span class="keyword">Scenario Outline:</span> <span class="val">Hantu Pisang match</span></h3><ol><li id='features_search_sample_feature_19' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('60.3');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_21'><th class="step skipped_param" id="row_21_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('60.9');</script><tr class='step' id='row_22'><td class="step passed" id="row_22_0"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('61.5');</script></table></div></div><div class='scenario outline'><h3 id="scenario_33"><span class="keyword">Scenario Outline:</span> <span class="val">no match in name but in examples</span></h3><ol><li id='features_search_sample_feature_25' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('62.1');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Hantu Pisang</span></h4><table><tr class='step' id='row_27'><th class="step skipped_param" id="row_27_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('62.7');</script><tr class='step' id='row_28'><td class="step passed" id="row_28_0"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('63.3');</script></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Ignore me</span></h4><table><tr class='step' id='row_31'><th class="step skipped_param" id="row_31_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('63.9');</script><tr class='step' id='row_32'><td class="step failed" id="row_32_0"><div><span class="step param">failing</span></div></td><script>makeRed('scenario_33');</script></tr><tr><td class="failed" colspan="1"><pre>FAIL
|
381
|
+
features/search_sample.feature:13:in `Given <state> without a table'</pre></td></tr><script></script> <script type="text/javascript">moveProgressBar('59.7');</script></table></div></div><div class='scenario outline'><h3 id="scenario_32"><span class="keyword">Scenario Outline:</span> <span class="val">Hantu Pisang match</span></h3><ol><li id='features_search_sample_feature_19' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('60.3');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_21'><th class="step skipped_param" id="row_21_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('60.9');</script><tr class='step' id='row_22'><td class="step passed" id="row_22_0"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('61.5');</script></table></div></div><div class='scenario outline'><h3 id="scenario_33"><span class="keyword">Scenario Outline:</span> <span class="val">no match in name but in examples</span></h3><ol><li id='features_search_sample_feature_25' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state> without a table</span></div></li> <script type="text/javascript">moveProgressBar('62.1');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Hantu Pisang</span></h4><table><tr class='step' id='row_27'><th class="step skipped_param" id="row_27_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('62.7');</script><tr class='step' id='row_28'><td class="step passed" id="row_28_0"><div><span class="step param">passing</span></div></td></tr> <script type="text/javascript">moveProgressBar('63.3');</script></table></div><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val">Ignore me</span></h4><table><tr class='step' id='row_31'><th class="step skipped_param" id="row_31_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('63.9');</script><tr class='step' id='row_32'><td class="step failed" id="row_32_0"><div><span class="step param">failing</span></div></td><script>makeRed('scenario_33');</script></tr><tr><td class="failed" colspan="1"><pre>FAIL
|
382
382
|
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
383
383
|
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
384
|
-
features/search_sample.feature:25:in `Given <state> without a table'</pre></td></tr> <script type="text/javascript">moveProgressBar('64.4');</script></table></div></div></div><div class="feature"><span class="tag">@sample_one</span><h2><span class="val">Feature: Tag samples</span></h2><p class="narrative"></p><div class='scenario'><span class="tag">@sample_two</span> <span class="tag">@sample_four</span><h3 id="scenario_34"><span class="keyword">Scenario:</span> <span class="val">Passing</span></h3><ol><script>makeYellow('scenario_34');</script><li id='features_tags_sample_feature_6' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">missing</span></div><pre>Given /^missing$/ do
|
384
|
+
features/search_sample.feature:25:in `Given <state> without a table'</pre></td></tr><script></script> <script type="text/javascript">moveProgressBar('64.4');</script></table></div></div></div><div class="feature"><span class="tag">@sample_one</span><h2><span class="val">Feature: Tag samples</span></h2><p class="narrative"></p><div class='scenario'><span class="tag">@sample_two</span> <span class="tag">@sample_four</span><h3 id="scenario_34"><span class="keyword">Scenario:</span> <span class="val">Passing</span></h3><ol><script>makeYellow('scenario_34');</script><li id='features_tags_sample_feature_6' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">missing</span></div><pre>Given /^missing$/ do
|
385
385
|
pending # express the regexp above with the code you wish you had
|
386
386
|
end</pre></li> <script type="text/javascript">moveProgressBar('65.0');</script></ol></div><div class='scenario outline'><span class="tag">@sample_three</span><h3 id="scenario_35"><span class="keyword">Scenario Outline:</span> <span class="val"></span></h3><ol><li id='features_tags_sample_feature_10' class='step skipped'><div><span class="keyword">Given</span> <span class="step val"><state></span></div></li> <script type="text/javascript">moveProgressBar('65.6');</script></ol><div class="examples"><h4><span class="keyword">Examples:</span> <span class="val"></span></h4><table><tr class='step' id='row_12'><th class="step skipped_param" id="row_12_0"><div><span class="step param">state</span></div></th></tr> <script type="text/javascript">moveProgressBar('66.2');</script><tr class='step' id='row_13'><td class="step undefined" id="row_13_0"><div><span class="step param">missing</span></div></td><script>makeYellow('scenario_35');</script></tr> <script type="text/javascript">moveProgressBar('66.8');</script></table></div></div><div class='scenario'><span class="tag">@sample_three</span> <span class="tag">@sample_four</span><h3 id="scenario_36"><span class="keyword">Scenario:</span> <span class="val">Skipped</span></h3><ol><script>makeYellow('scenario_36');</script><li id='features_tags_sample_feature_17' class='step undefined'><div><span class="keyword">Given</span> <span class="step val">missing</span></div><pre>Given /^missing$/ do
|
387
387
|
pending # express the regexp above with the code you wish you had
|
data/features/profiles.feature
CHANGED
@@ -107,6 +107,20 @@ Feature: Profiles
|
|
107
107
|
Feature: Sample
|
108
108
|
"""
|
109
109
|
|
110
|
-
|
111
|
-
|
112
|
-
|
110
|
+
Scenario Outline: Showing profiles when listing failing scenarios
|
111
|
+
Given a file named "features/step_definitions/steps.rb" with:
|
112
|
+
"""
|
113
|
+
Given /^I am just testing stuff$/ do
|
114
|
+
fail
|
115
|
+
end
|
116
|
+
"""
|
117
|
+
When I run cucumber -q -p super -p default -f <format> features/sample.feature --require features/step_definitions/steps.rb
|
118
|
+
Then it should fail
|
119
|
+
Then the output should contain
|
120
|
+
"""
|
121
|
+
cucumber -p super features/sample.feature:2 # Scenario: this is a test
|
122
|
+
"""
|
123
|
+
Examples:
|
124
|
+
| format |
|
125
|
+
| pretty |
|
126
|
+
| progress|
|
@@ -49,7 +49,7 @@ Given /^I have environment variable (\w+) set to "([^\"]*)"$/ do |variable, valu
|
|
49
49
|
end
|
50
50
|
|
51
51
|
When /^I run cucumber (.*)$/ do |cucumber_opts|
|
52
|
-
run "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} --no-color #{cucumber_opts}"
|
52
|
+
run "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} --no-color #{cucumber_opts} CUCUMBER_OUTPUT_ENCODING=UTF-8"
|
53
53
|
end
|
54
54
|
|
55
55
|
When /^I run rake (.*)$/ do |rake_opts|
|
data/features/support/env.rb
CHANGED
@@ -95,11 +95,7 @@ class CucumberWorld
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def run_spork_in_background(port = nil)
|
98
|
-
|
99
|
-
require 'spork'
|
100
|
-
rescue Gem::LoadError => ex
|
101
|
-
gem 'spork', '>= 0.7.3' # Ensure correct spork version number to avoid false-negatives.
|
102
|
-
end
|
98
|
+
require 'spork'
|
103
99
|
|
104
100
|
pid = fork
|
105
101
|
in_current_dir do
|
data/gem_tasks/features.rake
CHANGED
@@ -6,7 +6,7 @@ Cucumber::Rake::Task.new do |t|
|
|
6
6
|
if(ENV["RUN_CODE_RUN"])
|
7
7
|
t.profile = 'run_code_run'
|
8
8
|
elsif(Cucumber::JRUBY)
|
9
|
-
t.profile = 'jruby'
|
9
|
+
t.profile = Cucumber::WINDOWS ? 'jruby_win' : 'jruby'
|
10
10
|
elsif(Cucumber::WINDOWS_MRI)
|
11
11
|
t.profile = 'windows_mri'
|
12
12
|
elsif(Cucumber::RUBY_1_9)
|
data/lib/cucumber/cli/options.rb
CHANGED
@@ -151,19 +151,19 @@ module Cucumber
|
|
151
151
|
@options[:formats] << ['pretty', nil] if @options[:formats].empty?
|
152
152
|
@options[:formats][-1][1] = v
|
153
153
|
end
|
154
|
-
opts.on("-t
|
155
|
-
"Only execute the features or scenarios with
|
156
|
-
"
|
157
|
-
"
|
158
|
-
"
|
159
|
-
"
|
160
|
-
"
|
161
|
-
"Example: --tags @
|
162
|
-
"
|
163
|
-
"
|
164
|
-
"
|
165
|
-
"
|
166
|
-
"
|
154
|
+
opts.on("-t TAG_EXPRESSION", "--tags TAG_EXPRESSION",
|
155
|
+
"Only execute the features or scenarios with tags matching TAG_EXPRESSION.",
|
156
|
+
"Scenarios inherit tags declared on the Feature level. The simplest",
|
157
|
+
"TAG_EXPRESSION is simply a tag. Example: --tags @dev. When a tag in a tag",
|
158
|
+
"expression starts with a ~, this represents boolean NOT. Example: --tags ~@dev.",
|
159
|
+
"A tag expression can have several tags separated by a comma, which represents",
|
160
|
+
"logical OR. Example: --tags @dev,@wip. The --tags option can be specified",
|
161
|
+
"several times, and this represents logical AND. Example: --tags @foo,~@bar --tags @zap.",
|
162
|
+
"This represents the boolean expression (@foo || !@bar) && @zap.",
|
163
|
+
"\n",
|
164
|
+
"Positive tags can be given a threshold to limit the number of occurrences.",
|
165
|
+
"Example: --tags @qa:3 will fail if there are more than 3 occurrences of the @qa tag.",
|
166
|
+
"This can be practical if you are practicing Kanban or CONWIP.") do |v|
|
167
167
|
@options[:tag_expressions] << v
|
168
168
|
end
|
169
169
|
opts.on("-n NAME", "--name NAME",
|
@@ -275,6 +275,10 @@ module Cucumber
|
|
275
275
|
self
|
276
276
|
end
|
277
277
|
|
278
|
+
def custom_profiles
|
279
|
+
@profiles - [@default_profile]
|
280
|
+
end
|
281
|
+
|
278
282
|
protected
|
279
283
|
|
280
284
|
attr_reader :options, :profiles, :expanded_args
|
@@ -62,14 +62,14 @@ module Cucumber
|
|
62
62
|
print_stats(nil)
|
63
63
|
end
|
64
64
|
|
65
|
-
def print_stats(features)
|
66
|
-
|
65
|
+
def print_stats(features, profiles = [])
|
67
66
|
@failures = step_mother.scenarios(:failed).select { |s| s.is_a?(Cucumber::Ast::Scenario) }
|
68
67
|
|
69
68
|
if !@failures.empty?
|
70
69
|
@io.puts format_string("Failing Scenarios:", :failed)
|
71
70
|
@failures.each do |failure|
|
72
|
-
|
71
|
+
profiles_string = (profiles.map{|profile| "-p #{profile} " }).flatten unless profiles.empty?
|
72
|
+
@io.puts format_string("cucumber #{profiles_string}" + failure.file_colon_line, :failed) +
|
73
73
|
format_string(" # Scenario: " + failure.name, :comment)
|
74
74
|
end
|
75
75
|
@io.puts
|
@@ -302,6 +302,7 @@ module Cucumber
|
|
302
302
|
end
|
303
303
|
end
|
304
304
|
end
|
305
|
+
set_scenario_color_failed
|
305
306
|
end
|
306
307
|
if @outline_row
|
307
308
|
@outline_row += 1
|
@@ -353,20 +354,28 @@ module Cucumber
|
|
353
354
|
|
354
355
|
def set_scenario_color(status)
|
355
356
|
if status == :undefined
|
356
|
-
|
357
|
-
@builder.text!("makeYellow('cucumber-header');") unless @header_red
|
358
|
-
@builder.text!("makeYellow('scenario_#{@scenario_number}');") unless @scenario_red
|
359
|
-
end
|
357
|
+
set_scenario_color_pending
|
360
358
|
end
|
361
359
|
if status == :failed
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
360
|
+
set_scenario_color_failed
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
def set_scenario_color_failed
|
365
|
+
@builder.script do
|
366
|
+
@builder.text!("makeRed('cucumber-header');") unless @header_red
|
367
|
+
@header_red = true
|
368
|
+
@builder.text!("makeRed('scenario_#{@scenario_number}');") unless @scenario_red
|
369
|
+
@scenario_red = true
|
368
370
|
end
|
369
371
|
end
|
372
|
+
|
373
|
+
def set_scenario_color_pending
|
374
|
+
@builder.script do
|
375
|
+
@builder.text!("makeYellow('cucumber-header');") unless @header_red
|
376
|
+
@builder.text!("makeYellow('scenario_#{@scenario_number}');") unless @scenario_red
|
377
|
+
end
|
378
|
+
end
|
370
379
|
|
371
380
|
def get_step_count(features)
|
372
381
|
count = 0
|
@@ -1,9 +1,17 @@
|
|
1
1
|
require 'cucumber/formatter/console'
|
2
2
|
require 'cucumber/formatter/io'
|
3
3
|
require 'fileutils'
|
4
|
-
|
5
|
-
|
6
|
-
require
|
4
|
+
begin
|
5
|
+
gem 'prawn', '=0.6.3'
|
6
|
+
require 'prawn'
|
7
|
+
require "prawn/layout"
|
8
|
+
|
9
|
+
gem 'prawn-format', '=0.2.3'
|
10
|
+
require "prawn/format"
|
11
|
+
rescue LoadError => e
|
12
|
+
e.message << "\nPlease gem install prawn --version 0.6.3 && gem install prawn-format --version 0.2.3"
|
13
|
+
raise e
|
14
|
+
end
|
7
15
|
|
8
16
|
module Cucumber
|
9
17
|
module Formatter
|
@@ -146,7 +154,7 @@ module Cucumber
|
|
146
154
|
return if @hide_this_step
|
147
155
|
if(table.kind_of? Cucumber::Ast::Table)
|
148
156
|
keep_with do
|
149
|
-
@doc.table(table.rows
|
157
|
+
@doc.table(table.rows, :headers => table.headers, :position => :center, :row_colors => ['ffffff', 'f0f0f0'])
|
150
158
|
end
|
151
159
|
end
|
152
160
|
end
|
@@ -43,7 +43,7 @@ module Cucumber
|
|
43
43
|
def print_summary(features)
|
44
44
|
print_steps(:pending)
|
45
45
|
print_steps(:failed)
|
46
|
-
print_stats(features)
|
46
|
+
print_stats(features, @options.custom_profiles)
|
47
47
|
print_snippets(@options)
|
48
48
|
print_passing_wip(@options)
|
49
49
|
print_tag_limit_warnings(features)
|
@@ -1,17 +1,10 @@
|
|
1
1
|
# Require this file if you need Unicode support.
|
2
|
+
# Tips for improvement - esp. ruby 1.9: http://www.ruby-forum.com/topic/184730
|
2
3
|
require 'cucumber/platform'
|
3
4
|
require 'cucumber/formatter/ansicolor'
|
4
5
|
$KCODE='u' unless Cucumber::RUBY_1_9
|
5
6
|
|
6
7
|
if Cucumber::WINDOWS
|
7
|
-
if Cucumber::WINDOWS_MRI
|
8
|
-
Cucumber::CODEPAGE = "cp#{Win32::Console::OutputCP()}"
|
9
|
-
elsif `cmd /c chcp` =~ /(\d+)/
|
10
|
-
Cucumber::CODEPAGE = "cp#{$1.to_i}"
|
11
|
-
else
|
12
|
-
raise "Cucumber couldn't detect the output codepage"
|
13
|
-
end
|
14
|
-
|
15
8
|
require 'iconv'
|
16
9
|
|
17
10
|
module Cucumber
|
@@ -22,7 +15,11 @@ if Cucumber::WINDOWS
|
|
22
15
|
def print(*a)
|
23
16
|
begin
|
24
17
|
cucumber_print(*Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a.map{|a|a.to_s}))
|
25
|
-
rescue Iconv::
|
18
|
+
rescue Iconv::InvalidEncoding => e
|
19
|
+
STDERR.cucumber_puts("WARNING: #{e.message}")
|
20
|
+
cucumber_print(*a)
|
21
|
+
rescue Iconv::IllegalSequence => e
|
22
|
+
STDERR.cucumber_puts("WARNING: #{e.message}")
|
26
23
|
cucumber_print(*a)
|
27
24
|
end
|
28
25
|
end
|
@@ -31,7 +28,11 @@ if Cucumber::WINDOWS
|
|
31
28
|
def puts(*a)
|
32
29
|
begin
|
33
30
|
cucumber_puts(*Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a.map{|a|a.to_s}))
|
34
|
-
rescue Iconv::
|
31
|
+
rescue Iconv::InvalidEncoding => e
|
32
|
+
STDERR.cucumber_print("WARNING: #{e.message}")
|
33
|
+
cucumber_print(*a)
|
34
|
+
rescue Iconv::IllegalSequence => e
|
35
|
+
STDERR.cucumber_puts("WARNING: #{e.message}")
|
35
36
|
cucumber_puts(*a)
|
36
37
|
end
|
37
38
|
end
|
@@ -43,4 +44,15 @@ if Cucumber::WINDOWS
|
|
43
44
|
STDERR.extend(self)
|
44
45
|
end
|
45
46
|
end
|
47
|
+
|
48
|
+
if ENV['CUCUMBER_OUTPUT_ENCODING']
|
49
|
+
Cucumber::CODEPAGE = ENV['CUCUMBER_OUTPUT_ENCODING']
|
50
|
+
elsif Cucumber::WINDOWS_MRI
|
51
|
+
Cucumber::CODEPAGE = "cp#{Win32::Console::OutputCP()}"
|
52
|
+
elsif `cmd /c chcp` =~ /(\d+)/
|
53
|
+
Cucumber::CODEPAGE = "cp#{$1.to_i}"
|
54
|
+
else
|
55
|
+
STDERR.cucumber_puts("WARNING: Couldn't detect your output codepage. Assuming it is 1252. You may have to chcp 1252.")
|
56
|
+
Cucumber::CODEPAGE = "cp1252"
|
57
|
+
end
|
46
58
|
end
|
@@ -36,10 +36,15 @@ module Cucumber
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def fetch_data_from_socket(timeout)
|
39
|
-
raw_response =
|
39
|
+
raw_response =
|
40
|
+
if timeout == :never
|
41
|
+
socket.gets
|
42
|
+
else
|
43
|
+
Timeout.timeout(timeout) { socket.gets }
|
44
|
+
end
|
40
45
|
WirePacket.parse(raw_response)
|
41
46
|
end
|
42
|
-
|
47
|
+
|
43
48
|
def socket
|
44
49
|
@socket ||= TCPSocket.new(@config.host, @config.port)
|
45
50
|
rescue Errno::ECONNREFUSED => exception
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require 'cucumber/wire_support/wire_language'
|
3
|
+
|
4
|
+
module Cucumber
|
5
|
+
module WireSupport
|
6
|
+
describe Connection do
|
7
|
+
class TestConnection < Connection
|
8
|
+
attr_accessor :socket
|
9
|
+
end
|
10
|
+
|
11
|
+
class TestConfiguration
|
12
|
+
attr_reader :custom_timeout
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@custom_timeout = {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def timeout(message = nil)
|
19
|
+
return :default_timeout if message.nil?
|
20
|
+
@custom_timeout[message] || :custom_timeout
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
before(:each) do
|
25
|
+
@config = TestConfiguration.new
|
26
|
+
@connection = TestConnection.new(@config)
|
27
|
+
@connection.socket = @socket = mock('socket')
|
28
|
+
Timeout.stub(:timeout).with(:custom_timeout).and_raise(Timeout::Error.new(''))
|
29
|
+
@response = %q{["response"]}
|
30
|
+
Timeout.stub(:timeout).with(:default_timeout).and_return(@response)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "re-raises a timeout error" do
|
34
|
+
Timeout.stub!(:timeout).and_raise(Timeout::Error.new(''))
|
35
|
+
lambda { @connection.call_remote(nil, :foo, []) }.should raise_error(Timeout::Error)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "ignores timeout errors when configured to do so" do
|
39
|
+
@config.custom_timeout[:foo] = :never
|
40
|
+
@socket.should_receive(:gets).and_return(@response)
|
41
|
+
handler = mock(:handle_response => :response)
|
42
|
+
@connection.call_remote(handler, :foo, []).should == :response
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Aslak Helles\xC3\xB8y"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-18 00:00:00 +01:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -88,10 +88,20 @@ dependencies:
|
|
88
88
|
version_requirement:
|
89
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- - "
|
91
|
+
- - "="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 0.6.3
|
94
94
|
version:
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: prawn-format
|
97
|
+
type: :development
|
98
|
+
version_requirement:
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.2.3
|
104
|
+
version:
|
95
105
|
- !ruby/object:Gem::Dependency
|
96
106
|
name: rspec
|
97
107
|
type: :development
|
@@ -100,7 +110,17 @@ dependencies:
|
|
100
110
|
requirements:
|
101
111
|
- - ">="
|
102
112
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
113
|
+
version: 1.3.0
|
114
|
+
version:
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: syntax
|
117
|
+
type: :development
|
118
|
+
version_requirement:
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 1.0.0
|
104
124
|
version:
|
105
125
|
- !ruby/object:Gem::Dependency
|
106
126
|
name: spork
|
@@ -577,8 +597,6 @@ files:
|
|
577
597
|
- lib/cucumber/step_match.rb
|
578
598
|
- lib/cucumber/step_mother.rb
|
579
599
|
- lib/cucumber/tag_expression.rb
|
580
|
-
- lib/cucumber/webrat/element_locator.rb
|
581
|
-
- lib/cucumber/webrat/table_locator.rb
|
582
600
|
- lib/cucumber/wire_support/configuration.rb
|
583
601
|
- lib/cucumber/wire_support/connection.rb
|
584
602
|
- lib/cucumber/wire_support/request_handler.rb
|
@@ -636,6 +654,7 @@ files:
|
|
636
654
|
- spec/cucumber/treetop_parser/with_comments.feature
|
637
655
|
- spec/cucumber/treetop_parser/with_tags.feature
|
638
656
|
- spec/cucumber/wire_support/configuration_spec.rb
|
657
|
+
- spec/cucumber/wire_support/connection_spec.rb
|
639
658
|
- spec/cucumber/wire_support/wire_exception_spec.rb
|
640
659
|
- spec/cucumber/wire_support/wire_language_spec.rb
|
641
660
|
- spec/cucumber/wire_support/wire_packet_spec.rb
|
@@ -653,7 +672,7 @@ post_install_message: |+
|
|
653
672
|
|
654
673
|
(::) U P G R A D I N G (::)
|
655
674
|
|
656
|
-
Thank you for installing cucumber-0.6.
|
675
|
+
Thank you for installing cucumber-0.6.2.
|
657
676
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
|
658
677
|
for important information about this release. Happy cuking!
|
659
678
|
|
@@ -717,6 +736,7 @@ test_files:
|
|
717
736
|
- spec/cucumber/step_mother_spec.rb
|
718
737
|
- spec/cucumber/tag_expression_spec.rb
|
719
738
|
- spec/cucumber/wire_support/configuration_spec.rb
|
739
|
+
- spec/cucumber/wire_support/connection_spec.rb
|
720
740
|
- spec/cucumber/wire_support/wire_exception_spec.rb
|
721
741
|
- spec/cucumber/wire_support/wire_language_spec.rb
|
722
742
|
- spec/cucumber/wire_support/wire_packet_spec.rb
|
@@ -1,93 +0,0 @@
|
|
1
|
-
warning = "\nWARNING: #{caller.detect{|l| l =~ /features/}}: cucumber/webrat/element_locator.rb is deprecated and will be removed in Cucumber 0.6.0.\nUse cucumber/web/tableish instead.\n"
|
2
|
-
at_exit do
|
3
|
-
warn warning
|
4
|
-
end
|
5
|
-
require 'webrat'
|
6
|
-
|
7
|
-
module Webrat
|
8
|
-
class Element
|
9
|
-
# Returns an Array of Array of String where each String is a
|
10
|
-
# "cell" in the table-like structure represented by this Element.
|
11
|
-
#
|
12
|
-
# Supported elements are table, dl, ol and ul. Different conversion
|
13
|
-
# strategies are used depending on the kind of element:
|
14
|
-
#
|
15
|
-
# * table : Each tr becomes a row. The innerHTML of each td or th inside becomes a cell. The number
|
16
|
-
# of columns is determined by the number of cells in the first row.
|
17
|
-
# * dl : Each dt becomes a row with 2 cells. The innerHTML of the dt itself and the next dd become cells.
|
18
|
-
# * ul or ol : Each li becomes a row with one cell, the innerHTML of the li.
|
19
|
-
#
|
20
|
-
def to_table
|
21
|
-
case element.name
|
22
|
-
when 'table'
|
23
|
-
table_from_table
|
24
|
-
when 'dl'
|
25
|
-
table_from_dl
|
26
|
-
when /ul|ol/
|
27
|
-
table_from_list
|
28
|
-
else
|
29
|
-
raise "#to_table not supported for #{element.name} elements"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def table_from_table #:nodoc:
|
34
|
-
col_count = nil
|
35
|
-
element.css('tr').map do |row|
|
36
|
-
cols = row.css('th,td')
|
37
|
-
col_count ||= cols.length
|
38
|
-
cols[0...col_count].map do |col|
|
39
|
-
col.inner_html
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def table_from_dl #:nodoc:
|
45
|
-
element.css('dt').map do |dt|
|
46
|
-
next_node = dt.next_sibling
|
47
|
-
while next_node.name != 'dd'
|
48
|
-
next_node = next_node.next_sibling
|
49
|
-
end
|
50
|
-
[dt.inner_html, next_node.inner_html]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def table_from_list #:nodoc:
|
55
|
-
element.css('li').map do |li|
|
56
|
-
[li.inner_html]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
alias to_a to_table # Backwards compatibility with Cucumber
|
61
|
-
end
|
62
|
-
|
63
|
-
module Locators
|
64
|
-
class ElementLocator < Locator #:nodoc:
|
65
|
-
def locate
|
66
|
-
Element.load(@session, table_element)
|
67
|
-
end
|
68
|
-
|
69
|
-
def table_element
|
70
|
-
@dom.css(@value)[0]
|
71
|
-
end
|
72
|
-
|
73
|
-
def error_message
|
74
|
-
"Could not find anything matching '#{@value}'"
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# Returns a Webrat DOM element located by +css_selector+.
|
79
|
-
def element_at(css_selector)
|
80
|
-
ElementLocator.new(@session, dom, css_selector).locate!
|
81
|
-
end
|
82
|
-
|
83
|
-
alias table_at element_at # Backwards compatibility with Cucumber
|
84
|
-
end
|
85
|
-
|
86
|
-
module Methods #:nodoc:
|
87
|
-
delegate_to_session :element_at, :table_at
|
88
|
-
end
|
89
|
-
|
90
|
-
class Session #:nodoc:
|
91
|
-
def_delegators :current_scope, :element_at, :table_at
|
92
|
-
end
|
93
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'cucumber/webrat/element_locator'
|