aslakhellesoy-cucumber 0.1.100.3 → 0.1.100.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +6 -0
- data/examples/i18n/en-lol/Rakefile +6 -0
- data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +16 -0
- data/examples/i18n/en-lol/features/stuffing.feature +8 -0
- data/examples/i18n/en-lol/features/support/env.rb +8 -0
- data/examples/i18n/en-lol/lib/basket.rb +12 -0
- data/examples/i18n/en-lol/lib/belly.rb +11 -0
- data/examples/tickets/features/236.feature +13 -0
- data/lib/cucumber/ast/py_string.rb +1 -0
- data/lib/cucumber/ast/step.rb +1 -0
- data/lib/cucumber/ast/table.rb +3 -1
- data/lib/cucumber/formatter/rerun.rb +1 -1
- data/lib/cucumber/languages.yml +17 -2
- data/lib/cucumber/rake/task.rb +1 -1
- data/lib/cucumber/step_mother.rb +1 -0
- data/lib/cucumber/version.rb +1 -1
- data/spec/cucumber/ast/py_string_spec.rb +7 -0
- data/spec/cucumber/ast/step_spec.rb +13 -0
- data/spec/cucumber/ast/table_spec.rb +10 -0
- metadata +9 -3
data/History.txt
CHANGED
@@ -57,6 +57,9 @@ Scenario Outlines, the rich command line, the nice output format and everything
|
|
57
57
|
pure Ruby users have been enjoying for a while.
|
58
58
|
|
59
59
|
== Bugfixes
|
60
|
+
* Within Scenario Outlines when replacing with a nil in a step name use empty string instead. (#237 Joseph Wilk)
|
61
|
+
* Fixed bug with Scenario Outlines incorrectly replacing values in step tables with nil. (#237 Joseph Wilk)
|
62
|
+
* Within Scenario Outlines when replacing with a nil in multiline strings use empty string instead. (#238 Joseph Wilk)
|
60
63
|
* Re-structure the ast: Feature -> Background -> (Scenario|ScenarioOutline)*. Fixes bug with background being called outside transactions. (#181 Joseph Wilk)
|
61
64
|
* --strict always exits with status 1 (#230 Tim Cuthbertson)
|
62
65
|
* Fix error with nil values in tables raising an exception (#227 Joseph Wilk)
|
@@ -75,6 +78,7 @@ pure Ruby users have been enjoying for a while.
|
|
75
78
|
* Pending steps in > steps called from steps (#65 Aslak Hellesøy)
|
76
79
|
|
77
80
|
=== New features
|
81
|
+
* Australian translation (Josh Graham)
|
78
82
|
* Added World#announce(announcment) which lets you output text to the formatted output (#222 Rob Kaufmann)
|
79
83
|
* Added Table#transpose to to allow use of vertically aligned table keys (Torbjørn Vatn, Aslak Hellesøy)
|
80
84
|
* Added Table#map_headers to to allow use of more readable headers (Rob Holland)
|
data/Manifest.txt
CHANGED
@@ -30,6 +30,12 @@ examples/i18n/de/features/addition.feature
|
|
30
30
|
examples/i18n/de/features/division.feature
|
31
31
|
examples/i18n/de/features/step_definitons/calculator_steps.rb
|
32
32
|
examples/i18n/de/lib/calculator.rb
|
33
|
+
examples/i18n/en-lol/Rakefile
|
34
|
+
examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb
|
35
|
+
examples/i18n/en-lol/features/stuffing.feature
|
36
|
+
examples/i18n/en-lol/features/support/env.rb
|
37
|
+
examples/i18n/en-lol/lib/basket.rb
|
38
|
+
examples/i18n/en-lol/lib/belly.rb
|
33
39
|
examples/i18n/en/Rakefile
|
34
40
|
examples/i18n/en/features/addition.feature
|
35
41
|
examples/i18n/en/features/division.feature
|
@@ -0,0 +1,16 @@
|
|
1
|
+
ICANHAZ /^IN TEH BEGINNIN (\d+) CUCUMBRZ$/ do |n|
|
2
|
+
@basket = Basket.new(n.to_i)
|
3
|
+
end
|
4
|
+
|
5
|
+
WEN /^I EAT (\d+) CUCUMBRZ$/ do |n|
|
6
|
+
@belly = Belly.new
|
7
|
+
@belly.eat(@basket.take(n.to_i))
|
8
|
+
end
|
9
|
+
|
10
|
+
DEN /^I HAS (\d+) CUCUMBERZ IN MAH BELLY$/ do |n|
|
11
|
+
@belly.cukes.should == n.to_i
|
12
|
+
end
|
13
|
+
|
14
|
+
AN /^IN TEH END (\d+) CUCUMBRZ KTHXBAI$/ do |n|
|
15
|
+
@basket.cukes.should == n.to_i
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Unsubstituted argument placeholder
|
2
|
+
|
3
|
+
Scenario Outline: See Annual Leave Details (as Management & Human Resource)
|
4
|
+
Given the following users exist in the system
|
5
|
+
| name | email | role_assignments | group_memberships |
|
6
|
+
| Jane | jane@fmail.com | <role> | Sales (manager) |
|
7
|
+
| Max | max@fmail.com | | Sales (member) |
|
8
|
+
| Carol | carol@fmail.com | | Sales (member) |
|
9
|
+
| Cat | cat@fmail.com | | |
|
10
|
+
|
11
|
+
Examples:
|
12
|
+
| role |
|
13
|
+
| HUMAN RESOURCE |
|
data/lib/cucumber/ast/step.rb
CHANGED
@@ -112,6 +112,7 @@ module Cucumber
|
|
112
112
|
def replace_name_arguments(argument_hash)
|
113
113
|
name_with_arguments_replaced = @name
|
114
114
|
argument_hash.each do |name, value|
|
115
|
+
value ||= ''
|
115
116
|
name_with_arguments_replaced = name_with_arguments_replaced.gsub(name, value) if value
|
116
117
|
end
|
117
118
|
name_with_arguments_replaced
|
data/lib/cucumber/ast/table.rb
CHANGED
@@ -158,7 +158,9 @@ module Cucumber
|
|
158
158
|
row.map do |cell|
|
159
159
|
cell_with_replaced_args = cell
|
160
160
|
arguments.each do |name, value|
|
161
|
-
cell_with_replaced_args
|
161
|
+
if cell_with_replaced_args && cell_with_replaced_args.include?(name)
|
162
|
+
cell_with_replaced_args = value ? cell_with_replaced_args.gsub(name, value) : nil
|
163
|
+
end
|
162
164
|
end
|
163
165
|
cell_with_replaced_args
|
164
166
|
end
|
data/lib/cucumber/languages.yml
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
then: Then
|
21
21
|
and: And
|
22
22
|
but: But
|
23
|
+
|
23
24
|
# Please help us keeping the languages below uptodate. The parsers for a language
|
24
25
|
# that is missing a keyword will expect the English word until the missing word(s)
|
25
26
|
# are added.
|
@@ -94,6 +95,20 @@
|
|
94
95
|
then: Dann
|
95
96
|
and: Und
|
96
97
|
but: Aber
|
98
|
+
"en-au":
|
99
|
+
name: Australian
|
100
|
+
native: Australian
|
101
|
+
encoding: UTF-8
|
102
|
+
feature: Crikey
|
103
|
+
background: Background
|
104
|
+
scenario: Mate
|
105
|
+
scenario_outline: Blokes
|
106
|
+
examples: Cobber
|
107
|
+
given: Ya know how
|
108
|
+
when: When
|
109
|
+
then: Ya gotta
|
110
|
+
and: N
|
111
|
+
but: Cept
|
97
112
|
"en-lol":
|
98
113
|
name: LOLCAT
|
99
114
|
native: LOLCAT
|
@@ -103,7 +118,7 @@
|
|
103
118
|
scenario: MISHUN
|
104
119
|
scenario_outline: MISHUN SRSLY
|
105
120
|
examples: EXAMPLZ
|
106
|
-
given:
|
121
|
+
given: I CAN HAZ
|
107
122
|
when: WEN
|
108
123
|
then: DEN
|
109
124
|
and: AN
|
@@ -115,7 +130,7 @@
|
|
115
130
|
feature: Feature
|
116
131
|
background: Background
|
117
132
|
scenario: Scenario
|
118
|
-
scenario_outline:
|
133
|
+
scenario_outline: All y'all
|
119
134
|
examples: Examples
|
120
135
|
given: Given y'all
|
121
136
|
when: When y'all
|
data/lib/cucumber/rake/task.rb
CHANGED
@@ -51,7 +51,7 @@ module Cucumber
|
|
51
51
|
# Define a Rake
|
52
52
|
def initialize(task_name = "features", desc = "Run Features with Cucumber")
|
53
53
|
@task_name, @desc = task_name, desc
|
54
|
-
@libs = []
|
54
|
+
@libs = ['lib']
|
55
55
|
@rcov_opts = %w{--rails --exclude osx\/objc,gems\/}
|
56
56
|
|
57
57
|
yield self if block_given?
|
data/lib/cucumber/step_mother.rb
CHANGED
data/lib/cucumber/version.rb
CHANGED
@@ -33,6 +33,13 @@ module Cucumber
|
|
33
33
|
@ps.to_s.should_not include("Life is elsewhere")
|
34
34
|
end
|
35
35
|
|
36
|
+
it "should replaced nil with empty string" do
|
37
|
+
ps = PyString.new(10, 13, "'<book>'", 0)
|
38
|
+
py_string_with_replaced_arg = ps.arguments_replaced({'<book>' => nil})
|
39
|
+
|
40
|
+
py_string_with_replaced_arg.to_s.should == "''"
|
41
|
+
end
|
42
|
+
|
36
43
|
end
|
37
44
|
|
38
45
|
end
|
@@ -19,6 +19,19 @@ module Cucumber
|
|
19
19
|
step_invocation.name.should == 'a green cucumber'
|
20
20
|
end
|
21
21
|
|
22
|
+
it "should use empty string for the replacement of arguments in name when replace value is nil" do
|
23
|
+
step = Step.new(1, 'Given', 'a <color>cucumber')
|
24
|
+
|
25
|
+
invocation_table = Table.new([
|
26
|
+
['color'],
|
27
|
+
[nil]
|
28
|
+
])
|
29
|
+
cells = invocation_table.cells_rows[1]
|
30
|
+
step_invocation = step.step_invocation_from_cells(cells)
|
31
|
+
|
32
|
+
step_invocation.name.should == 'a cucumber'
|
33
|
+
end
|
34
|
+
|
22
35
|
it "should replace arguments in table arg" do
|
23
36
|
arg_table = Table.new([%w{taste_<taste> color_<color>}])
|
24
37
|
|
@@ -103,6 +103,16 @@ module Cucumber
|
|
103
103
|
table_with_replaced_args.hashes[0]['book'].should == nil
|
104
104
|
end
|
105
105
|
|
106
|
+
it "should preserve values which don't match a placeholder when replacing with nil" do
|
107
|
+
table = Table.new([
|
108
|
+
%w{book},
|
109
|
+
%w{cat}
|
110
|
+
])
|
111
|
+
table_with_replaced_args = table.arguments_replaced({'<book>' => nil})
|
112
|
+
|
113
|
+
table_with_replaced_args.hashes[0]['book'].should == 'cat'
|
114
|
+
end
|
115
|
+
|
106
116
|
it "should not change the original table" do
|
107
117
|
@table.arguments_replaced({'<book>' => 'Unbearable lightness of being'})
|
108
118
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aslakhellesoy-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.100.
|
4
|
+
version: 0.1.100.4
|
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: 2009-03-
|
12
|
+
date: 2009-03-18 00:00:00 -07:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -117,6 +117,12 @@ files:
|
|
117
117
|
- examples/i18n/de/features/division.feature
|
118
118
|
- examples/i18n/de/features/step_definitons/calculator_steps.rb
|
119
119
|
- examples/i18n/de/lib/calculator.rb
|
120
|
+
- examples/i18n/en-lol/Rakefile
|
121
|
+
- examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb
|
122
|
+
- examples/i18n/en-lol/features/stuffing.feature
|
123
|
+
- examples/i18n/en-lol/features/support/env.rb
|
124
|
+
- examples/i18n/en-lol/lib/basket.rb
|
125
|
+
- examples/i18n/en-lol/lib/belly.rb
|
120
126
|
- examples/i18n/en/Rakefile
|
121
127
|
- examples/i18n/en/features/addition.feature
|
122
128
|
- examples/i18n/en/features/division.feature
|
@@ -214,7 +220,6 @@ files:
|
|
214
220
|
- examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java
|
215
221
|
- examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java
|
216
222
|
- examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java
|
217
|
-
- examples/jbehave/target/maven-archiver/pom.properties
|
218
223
|
- examples/selenium/Rakefile
|
219
224
|
- examples/selenium/features/search.feature
|
220
225
|
- examples/selenium/features/step_definitons/search_steps.rb
|
@@ -257,6 +262,7 @@ files:
|
|
257
262
|
- examples/tickets/features/177/2.feature
|
258
263
|
- examples/tickets/features/177/3.feature
|
259
264
|
- examples/tickets/features/180.feature
|
265
|
+
- examples/tickets/features/236.feature
|
260
266
|
- examples/tickets/features/lib/eatting_machine.rb
|
261
267
|
- examples/tickets/features/lib/pantry.rb
|
262
268
|
- examples/tickets/features/scenario_outline.feature
|