cucumber 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,6 +1,26 @@
1
+ ## [1.3.7](https://github.com/cucumber/cucumber/compare/v1.3.6...v1.3.7)
2
+
3
+ * Fixed incorrect html formatter behaviour when background step fails
4
+ ([520](https://github.com/cucumber/cucumber/issues/520),
5
+ [521](https://github.com/cucumber/cucumber/issues/521) @mlex)
6
+
7
+ * Fixed problem with printing badly formatted backtrace for failed background
8
+ ([522](https://github.com/cucumber/cucumber/issues/522),
9
+ [523](https://github.com/cucumber/cucumber/issues/523) @mlex)
10
+
11
+ * required Gherkin version bumped to 2.12.1
12
+
13
+ * All mutating methods of AST::Table deprecated
14
+ ([505](https://github.com/cucumber/cucumber/issues/505),
15
+ [525](https://github.com/cucumber/cucumber/issues/525) @adbatista)
16
+
17
+ * AST::Table#map_headers doesn't use #map_headers! anymore
18
+ ([505](https://github.com/cucumber/cucumber/issues/528) @adbatista)
19
+
1
20
  ## [1.3.6](https://github.com/cucumber/cucumber/compare/v1.3.5...v1.3.6)
2
21
 
3
- * Html formatter fixed to not mark passes scenarios with tables as pending ([493](https://github.com/cucumber/cucumber/issues/493) Oleg Sukhodolsky)
22
+ * Html formatter fixed to not mark passes scenarios with tables as pending
23
+ ([493](https://github.com/cucumber/cucumber/issues/493) Oleg Sukhodolsky)
4
24
 
5
25
  ## [1.3.5](https://github.com/cucumber/cucumber/compare/v1.3.4...v1.3.5)
6
26
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency 'builder', '>= 2.1.2'
17
17
  s.add_dependency 'diff-lcs', '>= 1.1.3'
18
- s.add_dependency 'gherkin', '~> 2.12.0'
18
+ s.add_dependency 'gherkin', '~> 2.12.1'
19
19
  s.add_dependency 'multi_json', '~> 1.7.5'
20
20
  s.add_dependency 'multi_test', '>= 0.0.2'
21
21
 
@@ -0,0 +1,37 @@
1
+ @needs-many-fonts
2
+ Feature: Language help
3
+
4
+ It's possible to ask cucumber which keywords are used for any
5
+ particular language by running:
6
+
7
+ `cucumber --i18n <language code> help`
8
+
9
+ This will print a table showing all the different words we use for
10
+ that language, to allow you to easily write features in any language
11
+ you choose.
12
+
13
+ Scenario: Get help for Portuguese language
14
+ When I run `cucumber --i18n pt help`
15
+ Then it should pass with:
16
+ """
17
+ | feature | "Funcionalidade", "Característica", "Caracteristica" |
18
+ | background | "Contexto", "Cenário de Fundo", "Cenario de Fundo", "Fundo" |
19
+ | scenario | "Cenário", "Cenario" |
20
+ | scenario_outline | "Esquema do Cenário", "Esquema do Cenario", "Delineação do Cenário", "Delineacao do Cenario" |
21
+ | examples | "Exemplos", "Cenários", "Cenarios" |
22
+ | given | "* ", "Dado ", "Dada ", "Dados ", "Dadas " |
23
+ | when | "* ", "Quando " |
24
+ | then | "* ", "Então ", "Entao " |
25
+ | and | "* ", "E " |
26
+ | but | "* ", "Mas " |
27
+ | given (code) | "Dado", "Dada", "Dados", "Dadas" |
28
+ | when (code) | "Quando" |
29
+ | then (code) | "Então", "Entao" |
30
+ | and (code) | "E" |
31
+ | but (code) | "Mas" |
32
+
33
+ """
34
+
35
+ Scenario: List languages
36
+ When I run `cucumber --i18n help`
37
+ Then cucumber lists all the supported languages
@@ -27,8 +27,22 @@ Feature: HTML output formatter
27
27
  | two |
28
28
  | three |
29
29
  """
30
+ And a file named "features/failing_background_step.feature" with:
31
+ """
32
+ Feature: Feature with failing background step
33
+
34
+ Background:
35
+ Given this fails
36
+
37
+ Scenario:
38
+ When I do something
39
+ Then I should see something
40
+ """
30
41
  And a file named "features/step_definitions/steps.rb" with:
31
42
  """
43
+ Given /^this fails$/ do
44
+ fail 'This step should fail'
45
+ end
32
46
  Given /^this hasn't been implemented yet$/ do
33
47
  pending
34
48
  end
@@ -61,10 +75,20 @@ Feature: HTML output formatter
61
75
  """
62
76
  default: -r features
63
77
  """
64
- When I run `cucumber --profile default --format html`
78
+ When I run `cucumber features/scenario_outline_with_undefined_steps.feature --profile default --format html`
65
79
  Then it should pass
66
80
  And the output should not contain:
67
81
  """
68
82
  Using the default profile...
69
83
  """
70
84
 
85
+ Scenario: a feature with a failing background step
86
+ When I run `cucumber features/failing_background_step.feature --format html`
87
+ Then the output should not contain:
88
+ """
89
+ makeRed('scenario_0')
90
+ """
91
+ And the output should contain:
92
+ """
93
+ makeRed('background_0')
94
+ """
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+ Then(/^cucumber lists all the supported languages$/) do
4
+ all_output.should include("Arabic")
5
+ all_output.should include("български")
6
+ all_output.should include("Pirate")
7
+ all_output.should include("English")
8
+ all_output.should include("日本語")
9
+ end
@@ -141,6 +141,10 @@ Then /^STDERR should be empty$/ do
141
141
  last_stderr.should == ""
142
142
  end
143
143
 
144
+ Then /^STDERR should have warning message$/ do
145
+ last_stderr.should include("[warning]")
146
+ end
147
+
144
148
  Then /^"([^"]*)" should exist$/ do |file|
145
149
  File.exists?(file).should be_true
146
150
  FileUtils.rm(file)
@@ -18,7 +18,7 @@ Feature: Table mapping
18
18
  }
19
19
  """
20
20
  When I run cucumber features/f.feature
21
- Then STDERR should be empty
21
+ Then STDERR should have warning message
22
22
  And it should pass with
23
23
  """
24
24
  Feature: F
@@ -30,5 +30,5 @@ Feature: Table mapping
30
30
 
31
31
  1 scenario (1 passed)
32
32
  1 step (1 passed)
33
-
33
+
34
34
  """
@@ -29,7 +29,7 @@ Feature: Wire protocol table diffing
29
29
  | ["diff_failed"] | ["fail",{"message":"Not same", "exception":"DifferentException", "backtrace":["a.cs:12","b.cs:34"]}] |
30
30
  | ["end_scenario"] | ["success"] |
31
31
  When I run cucumber -f progress --backtrace
32
- Then STDERR should be empty
32
+ Then STDERR should have warning message
33
33
  And it should fail with
34
34
  """
35
35
  F
@@ -109,7 +109,7 @@ Feature: Wire protocol table diffing
109
109
 
110
110
  Tables were not identical (Cucumber::Ast::Table::Different)
111
111
  features/wired.feature:3:in `Given we're all wired'
112
-
112
+
113
113
  Failing Scenarios:
114
114
  cucumber features/wired.feature:2 # Scenario: Wired
115
115
 
@@ -238,16 +238,15 @@ module Cucumber
238
238
  # # => ['phone number', 'ADDRESS']
239
239
  #
240
240
  def map_headers!(mappings={}, &block)
241
+ Kernel.warn "[warning] map_headers! will be deprecated, please use map_headers instead."
241
242
  clear_cache!
242
243
  @header_mappings = mappings
243
244
  @header_conversion_proc = block
244
245
  end
245
246
 
246
247
  # Returns a new Table where the headers are redefined. See #map_headers!
247
- def map_headers(mappings={})
248
- table = self.dup
249
- table.map_headers!(mappings)
250
- table
248
+ def map_headers(mappings={}, &block)
249
+ self.class.new raw.dup, @conversion_procs.dup, mappings, block
251
250
  end
252
251
 
253
252
  # Change how #hashes converts column values. The +column_name+ argument identifies the column
@@ -263,6 +262,7 @@ module Cucumber
263
262
  # end
264
263
  #
265
264
  def map_column!(column_name, strict=true, &conversion_proc)
265
+ Kernel.warn "[warning] map_column! will be deprecated"
266
266
  @conversion_procs[column_name.to_s] = { :strict => strict, :proc => conversion_proc }
267
267
  self
268
268
  end
@@ -304,6 +304,7 @@ module Cucumber
304
304
  # a Table argument, if you want to compare that table to some actual values.
305
305
  #
306
306
  def diff!(other_table, options={})
307
+ Kernel.warn "[warning] diff! will be deprecated"
307
308
  options = {
308
309
  :missing_row => true,
309
310
  :surplus_row => true,
@@ -268,6 +268,7 @@ module Cucumber
268
268
  end
269
269
 
270
270
  def exception(exception, status)
271
+ return if @hide_this_step
271
272
  build_exception_detail(exception)
272
273
  end
273
274
 
@@ -417,7 +418,8 @@ module Cucumber
417
418
  @builder.script do
418
419
  @builder.text!("makeRed('cucumber-header');") unless @header_red
419
420
  @header_red = true
420
- @builder.text!("makeRed('scenario_#{@scenario_number}');") unless @scenario_red
421
+ scenario_or_background = @in_background ? "background" : "scenario"
422
+ @builder.text!("makeRed('#{scenario_or_background}_#{@scenario_number}');") unless @scenario_red
421
423
  @scenario_red = true
422
424
  end
423
425
  end
@@ -425,7 +427,8 @@ module Cucumber
425
427
  def set_scenario_color_pending
426
428
  @builder.script do
427
429
  @builder.text!("makeYellow('cucumber-header');") unless @header_red
428
- @builder.text!("makeYellow('scenario_#{@scenario_number}');") unless @scenario_red
430
+ scenario_or_background = @in_background ? "background" : "scenario"
431
+ @builder.text!("makeYellow('#{scenario_or_background}_#{@scenario_number}');") unless @scenario_red
429
432
  end
430
433
  end
431
434
 
@@ -4,7 +4,7 @@ require 'rbconfig'
4
4
 
5
5
  module Cucumber
6
6
  unless defined?(Cucumber::VERSION)
7
- VERSION = '1.3.6'
7
+ VERSION = '1.3.7'
8
8
  BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
9
9
  LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
10
10
  JRUBY = defined?(JRUBY_VERSION)
@@ -54,7 +54,7 @@ module Cucumber
54
54
  @table.map_column!('one') { |v| v.to_i }
55
55
  @table.hashes.first['one'].should == 4444
56
56
  end
57
-
57
+
58
58
  it "applies the block once to each value" do
59
59
  headers = ['header']
60
60
  rows = ['value']
@@ -158,75 +158,84 @@ module Cucumber
158
158
  end
159
159
  end
160
160
 
161
- describe '#map_headers' do
161
+ describe '#map_headers!' do
162
+ let(:table) do
163
+ Table.new([
164
+ %w{HELLO WORLD},
165
+ %w{4444 55555}
166
+ ])
167
+ end
168
+
162
169
  it "renames the columns to the specified values in the provided hash" do
163
- table2 = @table.map_headers('one' => :three)
164
- table2.hashes.first[:three].should == '4444'
170
+ @table.map_headers!('one' => :three)
171
+ @table.hashes.first[:three].should == '4444'
165
172
  end
166
173
 
167
174
  it "allows renaming columns using regexp" do
168
- table2 = @table.map_headers(/one|uno/ => :three)
169
- table2.hashes.first[:three].should == '4444'
175
+ @table.map_headers!(/one|uno/ => :three)
176
+ @table.hashes.first[:three].should == '4444'
170
177
  end
171
178
 
172
179
  it "copies column mappings" do
173
180
  @table.map_column!('one') { |v| v.to_i }
174
- table2 = @table.map_headers('one' => 'three')
175
- table2.hashes.first['three'].should == 4444
181
+ @table.map_headers!('one' => 'three')
182
+ @table.hashes.first['three'].should == 4444
176
183
  end
177
184
 
178
185
  it "takes a block and operates on all the headers with it" do
179
- table = Table.new([
180
- ['HELLO', 'WORLD'],
181
- %w{4444 55555}
182
- ])
183
-
184
186
  table.map_headers! do |header|
185
187
  header.downcase
186
188
  end
187
-
188
189
  table.hashes.first.keys.should =~ %w[hello world]
189
190
  end
190
191
 
191
192
  it "treats the mappings in the provided hash as overrides when used with a block" do
192
- table = Table.new([
193
- ['HELLO', 'WORLD'],
194
- %w{4444 55555}
195
- ])
196
-
197
193
  table.map_headers!('WORLD' => 'foo') do |header|
198
194
  header.downcase
199
195
  end
200
196
 
201
197
  table.hashes.first.keys.should =~ %w[hello foo]
202
198
  end
199
+ end
203
200
 
204
- it "should allow mapping of headers before table.hashes has been accessed" do
205
- table = Table.new([
206
- ['HELLO', 'WORLD'],
201
+ describe '#map_headers' do
202
+ let(:table) do
203
+ Table.new([
204
+ %w{HELLO WORLD},
207
205
  %w{4444 55555}
208
206
  ])
207
+ end
209
208
 
210
- table.map_headers! do |header|
211
- header.downcase
212
- end
209
+ it "renames the columns to the specified values in the provided hash" do
210
+ table2 = @table.map_headers('one' => :three)
211
+ table2.hashes.first[:three].should == '4444'
212
+ end
213
213
 
214
- table.hashes.first.keys.should =~ %w[hello world]
214
+ it "allows renaming columns using regexp" do
215
+ table2 = @table.map_headers(/one|uno/ => :three)
216
+ table2.hashes.first[:three].should == '4444'
215
217
  end
216
218
 
217
- it "should allow mapping of headers after table.hashes has been accessed" do
218
- table = Table.new([
219
- ['HELLO', 'WORLD'],
220
- %w{4444 55555}
221
- ])
219
+ it "copies column mappings" do
220
+ @table.map_column!('one') { |v| v.to_i }
221
+ table2 = @table.map_headers('one' => 'three')
222
+ table2.hashes.first['three'].should == 4444
223
+ end
222
224
 
223
- dev_null = table.hashes.size
225
+ it "takes a block and operates on all the headers with it" do
226
+ table2 = table.map_headers do |header|
227
+ header.downcase
228
+ end
224
229
 
225
- table.map_headers! do |header|
230
+ table2.hashes.first.keys.should =~ %w[hello world]
231
+ end
232
+
233
+ it "treats the mappings in the provided hash as overrides when used with a block" do
234
+ table2 = table.map_headers('WORLD' => 'foo') do |header|
226
235
  header.downcase
227
236
  end
228
237
 
229
- table.hashes.first.keys.should =~ %w[hello world]
238
+ table2.hashes.first.keys.should =~ %w[hello foo]
230
239
  end
231
240
  end
232
241
 
@@ -289,7 +298,6 @@ module Cucumber
289
298
  table.arguments_replaced({'<book>' => nil, '<qty>' => '5'})
290
299
  }.should_not raise_error
291
300
  end
292
-
293
301
  end
294
302
 
295
303
  describe "diff!" do
@@ -211,7 +211,7 @@ module Cucumber
211
211
  it { @doc.should have_css_node('.feature .scenario .step.failed .message', /StandardError/) }
212
212
  end
213
213
 
214
- describe "with a step that fails in the backgound" do
214
+ describe "with a step that fails in the background" do
215
215
  define_steps do
216
216
  Given(/boo/) { raise 'eek' }
217
217
  end
@@ -225,8 +225,12 @@ module Cucumber
225
225
  FEATURE
226
226
 
227
227
  it { @doc.should have_css_node('.feature .background .step.failed', /eek/) }
228
+ it { @out.string.should_not include('makeRed(\'scenario_0\')') }
229
+ it { @out.string.should include('makeRed(\'background_0\')') }
228
230
  it { @doc.should_not have_css_node('.feature .scenario .step.failed', //) }
229
231
  it { @doc.should have_css_node('.feature .scenario .step.undefined', /yay/) }
232
+ it { @doc.should have_css_node('.feature .background .backtrace', //) }
233
+ it { @doc.should_not have_css_node('.feature .scenario .backtrace', //) }
230
234
  end
231
235
 
232
236
  describe "with a step that embeds a snapshot" do
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: 1.3.6
4
+ version: 1.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-09 00:00:00.000000000 Z
12
+ date: 2013-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 2.12.0
53
+ version: 2.12.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.12.0
61
+ version: 2.12.1
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: multi_json
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -625,6 +625,7 @@ files:
625
625
  - features/bootstrap.feature
626
626
  - features/custom_formatter.feature
627
627
  - features/doc_strings.feature
628
+ - features/docs/gherkin/language_help.feature
628
629
  - features/drb_server_integration.feature
629
630
  - features/execute_with_tag_filter.feature
630
631
  - features/formatter_callbacks.feature
@@ -632,6 +633,7 @@ files:
632
633
  - features/html_formatter.feature
633
634
  - features/iso-8859-1.feature
634
635
  - features/json_formatter.feature
636
+ - features/lib/step_definitions/language_steps.rb
635
637
  - features/load_path.feature
636
638
  - features/nested_steps.feature
637
639
  - features/nested_steps_i18n.feature
@@ -758,7 +760,6 @@ files:
758
760
  - legacy_features/expand.feature
759
761
  - legacy_features/junit_formatter.feature
760
762
  - legacy_features/language_from_header.feature
761
- - legacy_features/language_help.feature
762
763
  - legacy_features/listener_debugger_formatter.feature
763
764
  - legacy_features/multiline_names.feature
764
765
  - legacy_features/post_configuration_hook.feature
@@ -963,7 +964,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
963
964
  version: '0'
964
965
  segments:
965
966
  - 0
966
- hash: -233265350743836880
967
+ hash: 2687724431755954047
967
968
  required_rubygems_version: !ruby/object:Gem::Requirement
968
969
  none: false
969
970
  requirements:
@@ -972,12 +973,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
972
973
  version: '0'
973
974
  segments:
974
975
  - 0
975
- hash: -233265350743836880
976
+ hash: 2687724431755954047
976
977
  requirements: []
977
978
  rubyforge_project:
978
979
  rubygems_version: 1.8.25
979
980
  signing_key:
980
981
  specification_version: 3
981
- summary: cucumber-1.3.6
982
+ summary: cucumber-1.3.7
982
983
  test_files: []
983
984
  has_rdoc:
@@ -1,87 +0,0 @@
1
- @needs-many-fonts
2
- Feature: Language help
3
- In order to figure out the keywords to use for a language
4
- I want to be able to get help on the language from the CLI
5
-
6
- Scenario: Get help for Portuguese language
7
- When I run cucumber --i18n pt help
8
- Then it should pass with
9
- """
10
- | feature | "Funcionalidade", "Característica", "Caracteristica" |
11
- | background | "Contexto", "Cenário de Fundo", "Cenario de Fundo", "Fundo" |
12
- | scenario | "Cenário", "Cenario" |
13
- | scenario_outline | "Esquema do Cenário", "Esquema do Cenario", "Delineação do Cenário", "Delineacao do Cenario" |
14
- | examples | "Exemplos", "Cenários", "Cenarios" |
15
- | given | "* ", "Dado ", "Dada ", "Dados ", "Dadas " |
16
- | when | "* ", "Quando " |
17
- | then | "* ", "Então ", "Entao " |
18
- | and | "* ", "E " |
19
- | but | "* ", "Mas " |
20
- | given (code) | "Dado", "Dada", "Dados", "Dadas" |
21
- | when (code) | "Quando" |
22
- | then (code) | "Então", "Entao" |
23
- | and (code) | "E" |
24
- | but (code) | "Mas" |
25
-
26
- """
27
-
28
- Scenario: List languages
29
- When I run cucumber --i18n help
30
- Then STDERR should be empty
31
- Then it should pass with
32
- """
33
- | ar | Arabic | العربية |
34
- | bg | Bulgarian | български |
35
- | bm | Malay | Bahasa Melayu |
36
- | ca | Catalan | català |
37
- | cs | Czech | Česky |
38
- | cy-GB | Welsh | Cymraeg |
39
- | da | Danish | dansk |
40
- | de | German | Deutsch |
41
- | el | Greek | Ελληνικά |
42
- | en | English | English |
43
- | en-Scouse | Scouse | Scouse |
44
- | en-au | Australian | Australian |
45
- | en-lol | LOLCAT | LOLCAT |
46
- | en-old | Old English | Englisc |
47
- | en-pirate | Pirate | Pirate |
48
- | en-tx | Texan | Texan |
49
- | eo | Esperanto | Esperanto |
50
- | es | Spanish | español |
51
- | et | Estonian | eesti keel |
52
- | fa | Persian | فارسی |
53
- | fi | Finnish | suomi |
54
- | fr | French | français |
55
- | gl | Galician | galego |
56
- | he | Hebrew | עברית |
57
- | hi | Hindi | हिंदी |
58
- | hr | Croatian | hrvatski |
59
- | hu | Hungarian | magyar |
60
- | id | Indonesian | Bahasa Indonesia |
61
- | is | Icelandic | Íslenska |
62
- | it | Italian | italiano |
63
- | ja | Japanese | 日本語 |
64
- | ko | Korean | 한국어 |
65
- | lt | Lithuanian | lietuvių kalba |
66
- | lu | Luxemburgish | Lëtzebuergesch |
67
- | lv | Latvian | latviešu |
68
- | nl | Dutch | Nederlands |
69
- | no | Norwegian | norsk |
70
- | pl | Polish | polski |
71
- | pt | Portuguese | português |
72
- | ro | Romanian | română |
73
- | ru | Russian | русский |
74
- | sk | Slovak | Slovensky |
75
- | sr-Cyrl | Serbian | Српски |
76
- | sr-Latn | Serbian (Latin) | Srpski (Latinica) |
77
- | sv | Swedish | Svenska |
78
- | tl | Telugu | తెలుగు |
79
- | tr | Turkish | Türkçe |
80
- | tt | Tatar | Татарча |
81
- | uk | Ukrainian | Українська |
82
- | uz | Uzbek | Узбекча |
83
- | vi | Vietnamese | Tiếng Việt |
84
- | zh-CN | Chinese simplified | 简体中文 |
85
- | zh-TW | Chinese traditional | 繁體中文 |
86
-
87
- """