aslakhellesoy-cucumber 0.1.99.21 → 0.1.99.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +20 -7
- data/Manifest.txt +24 -1
- data/examples/i18n/Rakefile +3 -3
- data/examples/i18n/fr/features/addition.feature +13 -11
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +10 -12
- data/examples/i18n/fr/lib/calculatrice.rb +1 -1
- data/examples/i18n/ja/features/addition.feature +10 -10
- data/examples/i18n/ja/features/division.feature +2 -2
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +3 -3
- data/examples/i18n/ko/features/addition.feature +3 -3
- data/examples/i18n/ko/features/division.feature +3 -3
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +2 -9
- data/examples/i18n/no/features/support/env.rb +6 -0
- data/examples/i18n/zh-TW/Rakefile +6 -0
- data/examples/i18n/zh-TW/features/addition.feature +16 -0
- data/examples/i18n/zh-TW/features/division.feature +10 -0
- data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/zh-TW/lib/calculator.rb +14 -0
- data/examples/self_test/features/step_definitions/sample_steps.rb +3 -1
- data/examples/sinatra/Rakefile +6 -0
- data/examples/sinatra/app.rb +14 -0
- data/examples/sinatra/features/add.feature +11 -0
- data/examples/sinatra/features/step_definitions/add_steps.rb +15 -0
- data/examples/sinatra/features/support/env.rb +20 -0
- data/examples/sinatra/views/add.erb +5 -0
- data/examples/sinatra/views/layout.erb +8 -0
- data/features/cucumber_cli.feature +7 -2
- data/features/step_definitions/cucumber_steps.rb +0 -1
- data/lib/autotest/cucumber_mixin.rb +3 -2
- data/lib/cucumber/ast/table.rb +23 -4
- data/lib/cucumber/ast/tags.rb +2 -2
- data/lib/cucumber/cli/configuration.rb +28 -11
- data/lib/cucumber/cli/language_help_formatter.rb +1 -1
- data/lib/cucumber/cli/main.rb +8 -1
- data/lib/cucumber/formatter/color_io.rb +6 -0
- data/lib/cucumber/languages.yml +37 -10
- data/lib/cucumber/parser/feature.rb +1 -1
- data/lib/cucumber/parser/feature.tt +1 -1
- data/lib/cucumber/rake/task.rb +39 -6
- data/lib/cucumber/step_definition.rb +7 -0
- data/lib/cucumber/step_mother.rb +12 -1
- data/lib/cucumber/version.rb +1 -1
- data/rails_generators/cucumber/cucumber_generator.rb +22 -3
- data/rails_generators/cucumber/templates/cucumber.rake +13 -5
- data/rails_generators/cucumber/templates/env.rb +2 -1
- data/rails_generators/cucumber/templates/paths.rb +18 -11
- data/rails_generators/cucumber/templates/webrat_steps.rb +23 -7
- data/spec/cucumber/ast/table_spec.rb +36 -9
- data/spec/cucumber/ast/tags_spec.rb +13 -1
- data/spec/cucumber/cli/configuration_spec.rb +33 -4
- data/spec/cucumber/cli/main_spec.rb +45 -6
- data/spec/cucumber/parser/feature_parser_spec.rb +2 -2
- data/spec/cucumber/step_definition_spec.rb +8 -0
- metadata +21 -4
- data/examples/i18n/ja/README.txt +0 -5
data/History.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
== Git (0.2 alpha)
|
2
2
|
|
3
3
|
This is a major rewrite of Cucumber's internals. The rewrite was done to address technical
|
4
|
-
debt and to have a
|
5
|
-
changes to the Gherkin language, so this release is not fully backwards compatible.
|
6
|
-
may have to edit your feature files a little. Most importantly, "GivenScenario" and
|
4
|
+
debt and to have a code base that is easier to evolve and maintain. There are some major
|
5
|
+
changes to the Gherkin language, so this release is not fully backwards compatible with the 0.1.x series.
|
6
|
+
You may have to edit your feature files a little. Most importantly, "GivenScenario" and
|
7
7
|
"More Examples" no longer exist. See the "Removed features" section below for more details
|
8
8
|
on how to use alternatives.
|
9
9
|
|
@@ -79,6 +79,8 @@ pure Ruby users have been enjoying for a while.
|
|
79
79
|
** Full jar and simple jar
|
80
80
|
|
81
81
|
== Bugfixes
|
82
|
+
* Add support for using << in formatters to ensure the html formatter works (#210 Joseph Wilk)
|
83
|
+
* Explicitly require env.rb files first to avoid potential load order problems. (#213, Ben Mabey, Randy Harmon)
|
82
84
|
* Depend on polyglot version (0.2.4) to avoid masking require errors. (Aslak Hellesøy).
|
83
85
|
* -n option does not suppress the line info for a Scenario Outline (#175 Aslak Hellesøy)
|
84
86
|
* Errors with rspec-rails matchers in cucumber 0.1.99 (#173 David Chelimsky)
|
@@ -92,6 +94,19 @@ pure Ruby users have been enjoying for a while.
|
|
92
94
|
* Pending steps in > steps called from steps (#65 Aslak Hellesøy)
|
93
95
|
|
94
96
|
=== New features
|
97
|
+
* New -S/--step-definitions option. Useful (among other things) for tools that implement automcompletion. (#208 Aslak Hellesøy).
|
98
|
+
* The cucumber.rake file defines a dummy :features task if Cucumber is not installed (#225 Josh Nichols)
|
99
|
+
* Added map_column to AST tables to ease casting of cell values into relevant types (#223 Rob Holland)
|
100
|
+
Given /^an expense report for (.*) with the following posts:$/ do |date, posts_table|
|
101
|
+
posts_table.map_column!('amount') { |a| a.to_i }
|
102
|
+
posts_table.hashes.each do |post|
|
103
|
+
# post['amount'] is a Fixnum, rather than a String
|
104
|
+
end
|
105
|
+
end
|
106
|
+
Mapping a column which is not specified in the table will produce an error unless you explicitly pass a 2nd false argument. This is to allow different Scenarios to re-use the step definition with different table columns.
|
107
|
+
* New --no-diff option (#218 Bryan Ash)
|
108
|
+
* Rails generators supports testunit and rspec option, defaulting to rspec (#217 Josh Nichols)
|
109
|
+
* Sinatra Example (#204 Rob Holland)
|
95
110
|
* Keywords can be aliased in languages.yml. See English for an example (examples: Examples|Scenarios)
|
96
111
|
* Adding support for Background (#153 Joseph Wilk)
|
97
112
|
* Added Česky/Czech (Vojtech Salbaba)
|
@@ -104,10 +119,7 @@ pure Ruby users have been enjoying for a while.
|
|
104
119
|
* Call multiline steps from other steps (#144 Aslak Hellesøy)
|
105
120
|
* Run cucumber with --autoformat DIR to reformat (pretty print) all of your feature files. (Aslak Hellesøy)
|
106
121
|
* New --strict option exits with an error code if there are undefined steps. (#52 Aslak Hellesøy)
|
107
|
-
* Given, When, Then are automatically aliased to current language.
|
108
|
-
Ruby 1.8 doesn't allow non-ascii method names in the source, so unless you're on 1.9
|
109
|
-
you will have to use Given, When, Then or set up your own aliases. Here is Norwegian:
|
110
|
-
Cucumber.alias_steps(%w{Naar Saa}) # Når, Så already aliased, but can't be called. (Aslak Hellesøy)
|
122
|
+
* Given, When, Then methods (used in step definitions) are automatically aliased to current language. Use $KCODE='u' in env.rb if needed.
|
111
123
|
* Run cucumber --language help to see all supported languages. (Aslak Hellesøy)
|
112
124
|
* Run cucumber --language LANG help to see keywords for a given language. (Aslak Hellesøy)
|
113
125
|
* Multiline arguments (tables and """ strings) are printed in the output. (Aslak Hellesøy)
|
@@ -118,6 +130,7 @@ pure Ruby users have been enjoying for a while.
|
|
118
130
|
* "GivenScenario" is gone. Instead you can call Steps from Steps, or wait for "Background (#153)"
|
119
131
|
* "More Examples" is gone. "Scenario" + "More Examples" is no longer supported. Use "Scenario Outline" + "Examples" instead.
|
120
132
|
* Pure Ruby features are no longer supported.
|
133
|
+
* Remove --color option in autotest. Can be added manually in cucumber.yml (#215 Jean-Michel Garnier)
|
121
134
|
|
122
135
|
== (0.16.4 aslakhellesoy-webrat gem on GitHub)
|
123
136
|
|
data/Manifest.txt
CHANGED
@@ -61,7 +61,6 @@ examples/i18n/it/Rakefile
|
|
61
61
|
examples/i18n/it/features/somma.feature
|
62
62
|
examples/i18n/it/features/step_definitons/calcolatrice_steps.rb
|
63
63
|
examples/i18n/it/lib/calcolatrice.rb
|
64
|
-
examples/i18n/ja/README.txt
|
65
64
|
examples/i18n/ja/Rakefile
|
66
65
|
examples/i18n/ja/features/addition.feature
|
67
66
|
examples/i18n/ja/features/division.feature
|
@@ -80,6 +79,7 @@ examples/i18n/lt/lib/calculator.rb
|
|
80
79
|
examples/i18n/no/Rakefile
|
81
80
|
examples/i18n/no/features/step_definitons/kalkulator_steps.rb
|
82
81
|
examples/i18n/no/features/summering.feature
|
82
|
+
examples/i18n/no/features/support/env.rb
|
83
83
|
examples/i18n/no/lib/kalkulator.rb
|
84
84
|
examples/i18n/pt/Rakefile
|
85
85
|
examples/i18n/pt/features/adicao.feature
|
@@ -89,6 +89,14 @@ examples/i18n/ro/Rakefile
|
|
89
89
|
examples/i18n/ro/features/step_definitons/calculator_steps.rb
|
90
90
|
examples/i18n/ro/features/suma.feature
|
91
91
|
examples/i18n/ro/lib/calculator.rb
|
92
|
+
examples/i18n/ru/Rakefile
|
93
|
+
examples/i18n/ru/features/addition.feature
|
94
|
+
examples/i18n/ru/features/consecutive_calculations.feature
|
95
|
+
examples/i18n/ru/features/division.feature
|
96
|
+
examples/i18n/ru/features/step_definitons/calculator_steps.rb
|
97
|
+
examples/i18n/ru/features/support/env.rb
|
98
|
+
examples/i18n/ru/features/support/world.rb
|
99
|
+
examples/i18n/ru/lib/calculator.rb
|
92
100
|
examples/i18n/se/Rakefile
|
93
101
|
examples/i18n/se/features/step_definitons/kalkulator_steps.rb
|
94
102
|
examples/i18n/se/features/summering.feature
|
@@ -97,6 +105,11 @@ examples/i18n/zh-CN/Rakefile
|
|
97
105
|
examples/i18n/zh-CN/features/addition.feature
|
98
106
|
examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
|
99
107
|
examples/i18n/zh-CN/lib/calculator.rb
|
108
|
+
examples/i18n/zh-TW/Rakefile
|
109
|
+
examples/i18n/zh-TW/features/addition.feature
|
110
|
+
examples/i18n/zh-TW/features/division.feature
|
111
|
+
examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb
|
112
|
+
examples/i18n/zh-TW/lib/calculator.rb
|
100
113
|
examples/java/README.textile
|
101
114
|
examples/java/Rakefile
|
102
115
|
examples/java/features/hello.feature
|
@@ -126,12 +139,20 @@ examples/self_test/features/background/pending_background.feature
|
|
126
139
|
examples/self_test/features/background/scenario_outline_failing_background.feature
|
127
140
|
examples/self_test/features/background/scenario_outline_passing_background.feature
|
128
141
|
examples/self_test/features/call_undefined_step_from_step_def.feature
|
142
|
+
examples/self_test/features/failing_expectation.feature
|
129
143
|
examples/self_test/features/lots_of_undefined.feature
|
130
144
|
examples/self_test/features/outline_sample.feature
|
131
145
|
examples/self_test/features/sample.feature
|
132
146
|
examples/self_test/features/step_definitions/sample_steps.rb
|
133
147
|
examples/self_test/features/support/env.rb
|
134
148
|
examples/self_test/features/support/tag_count_formatter.rb
|
149
|
+
examples/sinatra/Rakefile
|
150
|
+
examples/sinatra/app.rb
|
151
|
+
examples/sinatra/features/add.feature
|
152
|
+
examples/sinatra/features/step_definitions/add_steps.rb
|
153
|
+
examples/sinatra/features/support/env.rb
|
154
|
+
examples/sinatra/views/add.erb
|
155
|
+
examples/sinatra/views/layout.erb
|
135
156
|
examples/test_unit/Rakefile
|
136
157
|
examples/test_unit/features/step_definitions/test_unit_steps.rb
|
137
158
|
examples/test_unit/features/test_unit.feature
|
@@ -155,6 +176,7 @@ examples/watir/features/step_definitons/search_steps.rb
|
|
155
176
|
examples/watir/features/support/env.rb
|
156
177
|
features/background.feature
|
157
178
|
features/cucumber_cli.feature
|
179
|
+
features/cucumber_cli_diff_disabled.feature
|
158
180
|
features/cucumber_cli_outlines.feature
|
159
181
|
features/custom_formatter.feature
|
160
182
|
features/report_called_undefined_steps.feature
|
@@ -257,6 +279,7 @@ spec/cucumber/cli/main_spec.rb
|
|
257
279
|
spec/cucumber/core_ext/proc_spec.rb
|
258
280
|
spec/cucumber/core_ext/string_spec.rb
|
259
281
|
spec/cucumber/formatter/ansicolor_spec.rb
|
282
|
+
spec/cucumber/formatter/color_io_spec.rb
|
260
283
|
spec/cucumber/formatter/html/cucumber.css
|
261
284
|
spec/cucumber/formatter/html/cucumber.js
|
262
285
|
spec/cucumber/formatter/html/index.html
|
data/examples/i18n/Rakefile
CHANGED
@@ -21,12 +21,12 @@ end
|
|
21
21
|
|
22
22
|
def supported?(lang)
|
23
23
|
if RUBY_VERSION =~ /^1\.9/
|
24
|
-
!%w{ar
|
24
|
+
!%w{ar ko zh-CN}.index(lang)
|
25
25
|
else
|
26
|
-
!%w{ar
|
26
|
+
!%w{ar ko}.index(lang)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def rake(args)
|
31
31
|
ruby($0, args) rescue nil
|
32
|
-
end
|
32
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
1
|
Fonctionnalité: Addition
|
2
|
-
Afin de
|
3
|
-
En tant que
|
4
|
-
Je souhaite pouvoir
|
2
|
+
Afin de gagner du temps lors du calcul de la facture
|
3
|
+
En tant que commerçant
|
4
|
+
Je souhaite pouvoir faire une additionn
|
5
5
|
|
6
|
-
Scénario
|
7
|
-
|
8
|
-
Et que
|
9
|
-
|
10
|
-
|
6
|
+
Plan du Scénario: Addition de deux nombres
|
7
|
+
Soit une calculatrice
|
8
|
+
Et que j'entre <a> pour le premier nombre
|
9
|
+
Et que je tape sur la touche "+"
|
10
|
+
Et que j'entre <b> pour le second nombre
|
11
|
+
Lorsque je tape sur la touche "="
|
12
|
+
Alors le résultat affiché doit être <somme>
|
11
13
|
|
12
14
|
Exemples:
|
13
|
-
| a | b |
|
14
|
-
| 2 | 2 | 4
|
15
|
-
| 2 | 3 | 5
|
15
|
+
| a | b | somme |
|
16
|
+
| 2 | 2 | 4 |
|
17
|
+
| 2 | 3 | 5 |
|
@@ -4,24 +4,22 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in y
|
|
4
4
|
require 'cucumber/formatters/unicode'
|
5
5
|
require 'calculatrice'
|
6
6
|
|
7
|
-
|
8
|
-
@calc =
|
7
|
+
Soit /^une calculatrice$/ do
|
8
|
+
@calc = Calculatrice.new
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
Et /^que j'entre (\d+) pour le (.*) nombre/ do |n, x|
|
12
|
+
@calc.push n.to_i
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
@calc.push n.to_i
|
15
|
+
Lorsque /^je tape sur la touche "="$/ do
|
16
|
+
@expected_result = @calc.additionner
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
@result = @calc.additionner
|
19
|
+
Alors /le résultat affiché doit être (\d*)/ do |result|
|
20
|
+
result.to_i.should == @expected_result
|
22
21
|
end
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
@result.should == result.to_i
|
23
|
+
Soit /^que je tape sur la touche "\+"$/ do
|
24
|
+
# noop
|
27
25
|
end
|
@@ -3,14 +3,14 @@
|
|
3
3
|
数学オンチとして
|
4
4
|
2つの数の合計を知りたい
|
5
5
|
|
6
|
-
|
7
|
-
前提
|
8
|
-
かつ
|
9
|
-
もし
|
10
|
-
ならば
|
6
|
+
シナリオテンプレート: 2つの数の加算について
|
7
|
+
前提 <値1> を入力
|
8
|
+
かつ <値2> を入力
|
9
|
+
もし <ボタン> を押した
|
10
|
+
ならば <結果> を表示
|
11
11
|
|
12
|
-
|
13
|
-
|
|
14
|
-
| 20
|
15
|
-
| 2
|
16
|
-
| 0
|
12
|
+
例:
|
13
|
+
| 値1 | 値2 | ボタン | 結果 |
|
14
|
+
| 20 | 30 | add | 50 |
|
15
|
+
| 2 | 5 | add | 7 |
|
16
|
+
| 0 | 40 | add | 40 |
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: UTF-8
|
2
2
|
require 'spec/expectations'
|
3
3
|
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
4
|
require 'cucumber/formatters/unicode'
|
@@ -15,10 +15,10 @@ Given "$n を入力" do |n|
|
|
15
15
|
@calc.push n.to_i
|
16
16
|
end
|
17
17
|
|
18
|
-
When /(\w+)
|
18
|
+
When /(\w+) を押した/ do |op|
|
19
19
|
@result = @calc.send op
|
20
20
|
end
|
21
21
|
|
22
|
-
Then
|
22
|
+
Then /(.*) を表示/ do |result|
|
23
23
|
@result.should == result.to_f
|
24
24
|
end
|
@@ -1,11 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'spec/expectations'
|
3
|
-
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
-
require 'cucumber/formatters/unicode'
|
5
|
-
require 'kalkulator'
|
6
|
-
|
7
|
-
# Not necessary with Ruby 1.9 - Gitt, Når Så automatically aliased.
|
8
|
-
Cucumber.alias_steps %w{Naar Saa}
|
9
2
|
|
10
3
|
Before do
|
11
4
|
@calc = Kalkulator.new
|
@@ -15,10 +8,10 @@ Gitt /at jeg har tastet inn (\d+)/ do |n|
|
|
15
8
|
@calc.push n.to_i
|
16
9
|
end
|
17
10
|
|
18
|
-
|
11
|
+
Når 'jeg summerer' do
|
19
12
|
@result = @calc.add
|
20
13
|
end
|
21
14
|
|
22
|
-
|
15
|
+
Så /skal resultatet være (\d*)/ do |result|
|
23
16
|
@result.should == result.to_i
|
24
17
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
功能: 加法
|
2
|
+
為了避免愚蠢的錯誤
|
3
|
+
作為一個數學白痴
|
4
|
+
我希望有人能告訴我兩個數相加的結果
|
5
|
+
|
6
|
+
場景大綱: 將兩個數相加
|
7
|
+
假設我已經在計算機上輸入 <數值_1>
|
8
|
+
而且我已經在計算機上輸入 <數值_2>
|
9
|
+
當我按下 <按鈕>
|
10
|
+
那麼螢幕上應該顯示 <結果>
|
11
|
+
|
12
|
+
例子:
|
13
|
+
| 數值_1 | 數值_2 | 按鈕 | 結果 |
|
14
|
+
| 20 | 30 | add | 50 |
|
15
|
+
| 2 | 5 | add | 7 |
|
16
|
+
| 0 | 40 | add | 40 |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec/expectations'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
|
4
|
+
require 'cucumber/formatters/unicode'
|
5
|
+
require 'calculator'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@calc = Calculator.new
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
end
|
13
|
+
|
14
|
+
Given /我已經在計算機上輸入 (\d+)/ do |n|
|
15
|
+
@calc.push n.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
When /我按下 (\w+)/ do |op|
|
19
|
+
@result = @calc.send op
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /螢幕上應該顯示 (.*)/ do |result|
|
23
|
+
@result.should == result.to_f
|
24
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: Addition
|
2
|
+
In order to avoid silly mistakes
|
3
|
+
As a math idiot
|
4
|
+
I want to be told the sum of two numbers
|
5
|
+
|
6
|
+
Scenario: Add two numbers
|
7
|
+
Given I visit the calculator page
|
8
|
+
And I fill in '50' for 'first'
|
9
|
+
And I fill in '70' for 'second'
|
10
|
+
When I press 'Add'
|
11
|
+
Then I should see 'Answer: 120'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Given /^I visit the calculator page$/ do
|
2
|
+
visit '/add'
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /^I fill in '(.*)' for '(.*)'$/ do |value, field|
|
6
|
+
fill_in(field, :with => value)
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I press '(.*)'$/ do |name|
|
10
|
+
click_button(name)
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^I should see '(.*)'$/ do |text|
|
14
|
+
response.body.should =~ /#{text}/m
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Sinatra
|
2
|
+
require File.join(File.dirname(__FILE__), *%w[.. .. app])
|
3
|
+
# Force the application name because polyglot breaks the auto-detection logic.
|
4
|
+
Sinatra::Application.app_file = File.join(File.dirname(__FILE__), *%w[.. .. app.rb])
|
5
|
+
|
6
|
+
# RSpec
|
7
|
+
require 'spec/expectations'
|
8
|
+
|
9
|
+
# Webrat
|
10
|
+
require 'webrat'
|
11
|
+
Webrat.configure do |config|
|
12
|
+
config.mode = :sinatra
|
13
|
+
end
|
14
|
+
|
15
|
+
World do
|
16
|
+
include Webrat::Matchers
|
17
|
+
include Webrat::HaveTagMatcher
|
18
|
+
|
19
|
+
Webrat::SinatraSession.new
|
20
|
+
end
|
@@ -159,6 +159,11 @@ Feature: Cucumber command line
|
|
159
159
|
Scenario: Call via another
|
160
160
|
Given call step "a step definition that calls an undefined step"
|
161
161
|
|
162
|
+
Feature: Failing expectation
|
163
|
+
|
164
|
+
Scenario: Failing expectation
|
165
|
+
Given failing expectation
|
166
|
+
|
162
167
|
Feature: Lots of undefined
|
163
168
|
|
164
169
|
Scenario: Implement me
|
@@ -206,8 +211,8 @@ Feature: Cucumber command line
|
|
206
211
|
hello
|
207
212
|
\"\"\"
|
208
213
|
|
209
|
-
|
210
|
-
|
214
|
+
12 scenarios
|
215
|
+
12 skipped steps
|
211
216
|
7 undefined steps
|
212
217
|
|
213
218
|
"""
|
@@ -95,7 +95,7 @@ module Autotest::CucumberMixin
|
|
95
95
|
ensure
|
96
96
|
$stdout.sync = old_sync
|
97
97
|
end
|
98
|
-
self.features_to_run = dirty_features_file.read
|
98
|
+
self.features_to_run = dirty_features_file.read.strip
|
99
99
|
self.tainted = true unless self.features_to_run == []
|
100
100
|
end
|
101
101
|
hook :ran_features
|
@@ -115,7 +115,8 @@ module Autotest::CucumberMixin
|
|
115
115
|
else
|
116
116
|
args = %w{--format} << (features_to_run == :all ? "progress" : "pretty")
|
117
117
|
end
|
118
|
-
|
118
|
+
# No --color option as some IDEs (Netbeans) don't output them very well ([31m1 failed step[0m)
|
119
|
+
args += %w{--format rerun --out} << dirty_features_filename
|
119
120
|
args << (features_to_run == :all ? "features" : features_to_run)
|
120
121
|
args = args.join(' ')
|
121
122
|
|
data/lib/cucumber/ast/table.rb
CHANGED
@@ -16,6 +16,7 @@ module Cucumber
|
|
16
16
|
@raw = raw
|
17
17
|
@cells_class = Cells
|
18
18
|
@cell_class = Cell
|
19
|
+
@conversion_procs = Hash.new(lambda{|cell_value| cell_value})
|
19
20
|
end
|
20
21
|
|
21
22
|
def at_lines?(lines)
|
@@ -41,6 +42,8 @@ module Cucumber
|
|
41
42
|
#
|
42
43
|
# [{'a' => '2', 'b' => '3', 'sum' => '5'}, {'a' => '7', 'b' => '9', 'sum' => '16'}]
|
43
44
|
#
|
45
|
+
# Use #map_column! to specify how values in a column are converted.
|
46
|
+
#
|
44
47
|
def hashes
|
45
48
|
@hashes ||= cells_rows[1..-1].map do |row|
|
46
49
|
row.to_hash
|
@@ -75,10 +78,22 @@ module Cucumber
|
|
75
78
|
[:table, *cells_rows.map{|row| row.to_sexp}]
|
76
79
|
end
|
77
80
|
|
81
|
+
# Change how #hashes converts column values. The +column_name+ argument identifies the column
|
82
|
+
# and +conversion_proc+ performs the conversion for each cell in that column. If +strict+ is
|
83
|
+
# true, an error will be raised if the column named +column_name+ is not found. If +strict+
|
84
|
+
# is false, no error will be raised.
|
85
|
+
def map_column!(column_name, strict=true, &conversion_proc)
|
86
|
+
verify_column(column_name) if strict
|
87
|
+
@conversion_procs[column_name] = conversion_proc
|
88
|
+
end
|
89
|
+
|
78
90
|
def to_hash(cells) #:nodoc:
|
79
|
-
hash =
|
80
|
-
|
81
|
-
|
91
|
+
hash = Hash.new do |hash, key|
|
92
|
+
hash[key.to_s] if key.is_a?(Symbol)
|
93
|
+
end
|
94
|
+
@raw[0].each_with_index do |column_name, column_index|
|
95
|
+
value = @conversion_procs[column_name].call(cells.value(column_index))
|
96
|
+
hash[column_name] = value
|
82
97
|
end
|
83
98
|
hash
|
84
99
|
end
|
@@ -87,12 +102,16 @@ module Cucumber
|
|
87
102
|
cells_rows.index(cells)
|
88
103
|
end
|
89
104
|
|
105
|
+
def verify_column(column_name)
|
106
|
+
raise %{The column named "#{column_name}" does not exist} unless @raw[0].include?(column_name)
|
107
|
+
end
|
108
|
+
|
90
109
|
def arguments_replaced(arguments) #:nodoc:
|
91
110
|
raw_with_replaced_args = raw.map do |row|
|
92
111
|
row.map do |cell|
|
93
112
|
cell_with_replaced_args = cell
|
94
113
|
arguments.each do |name, value|
|
95
|
-
cell_with_replaced_args = cell_with_replaced_args.gsub(name, value)
|
114
|
+
cell_with_replaced_args = value ? cell_with_replaced_args.gsub(name, value) : nil
|
96
115
|
end
|
97
116
|
cell_with_replaced_args
|
98
117
|
end
|