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.
@@ -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)
@@ -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,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = "--language en-lol"
6
+ end
@@ -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,8 @@
1
+ # stuffing.feature
2
+ OH HAI: STUFFING
3
+
4
+ MISHUN: CUCUMBR
5
+ I CAN HAZ IN TEH BEGINNIN 3 CUCUMBRZ
6
+ WEN I EAT 2 CUCUMBRZ
7
+ DEN I HAS 2 CUCUMBERZ IN MAH BELLY
8
+ AN IN TEH END 1 CUCUMBRZ KTHXBAI
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ $KCODE='u' unless Cucumber::RUBY_1_9
3
+ require 'cucumber/formatter/unicode'
4
+ require 'spec/expectations'
5
+
6
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
7
+ require 'basket'
8
+ require 'belly'
@@ -0,0 +1,12 @@
1
+ class Basket
2
+ attr_reader :cukes
3
+
4
+ def initialize(cukes)
5
+ @cukes = cukes
6
+ end
7
+
8
+ def take(cukes)
9
+ @cukes -= cukes
10
+ cukes
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ class Belly
2
+ attr_reader :cukes
3
+
4
+ def initialize
5
+ @cukes = 0
6
+ end
7
+
8
+ def eat(cukes)
9
+ @cukes += cukes
10
+ end
11
+ 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 |
@@ -42,6 +42,7 @@ module Cucumber
42
42
  def arguments_replaced(arguments) #:nodoc:
43
43
  string = @string
44
44
  arguments.each do |name, value|
45
+ value ||= ''
45
46
  string = string.gsub(name, value)
46
47
  end
47
48
  PyString.new(@start_line, @end_line, string, @quotes_indent)
@@ -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
@@ -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 = value && cell_with_replaced_args ? cell_with_replaced_args.gsub(name, value) : nil
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
@@ -27,7 +27,7 @@ module Cucumber
27
27
  end
28
28
  end
29
29
 
30
- def visit_step_name(keyword, step_match, status, source_indent)
30
+ def visit_step_name(keyword, step_match, status, source_indent, background)
31
31
  @rerun = true if [:failed].index(status)
32
32
  end
33
33
  end
@@ -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: GIVN
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: Scenario Outline
133
+ scenario_outline: All y'all
119
134
  examples: Examples
120
135
  given: Given y'all
121
136
  when: When y'all
@@ -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?
@@ -51,6 +51,7 @@ module Cucumber
51
51
  module StepMother
52
52
  class << self
53
53
  def alias_adverb(adverb)
54
+ adverb = adverb.gsub(/\s/, '')
54
55
  alias_method adverb, :register_step_definition
55
56
  end
56
57
  end
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 100
6
- PATCH = 3 # Set to nil for official release
6
+ PATCH = 4 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -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.3
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-16 00:00:00 -07:00
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