cucumber 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -158,7 +158,6 @@ module Cucumber
158
158
  def broadcast(*args, &block)
159
159
  message = extract_method_name_from(caller)
160
160
  message.gsub!('visit_', '')
161
-
162
161
  if block_given?
163
162
  send_to_all("before_#{message}", *args)
164
163
  yield if block_given?
@@ -87,7 +87,8 @@ module Cucumber
87
87
  end
88
88
 
89
89
  def print_exception(e, status, indent)
90
- @io.puts(format_string("#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent), status))
90
+ string = "#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent)
91
+ @io.puts(format_string(string, status))
91
92
  end
92
93
 
93
94
  def print_snippets(options)
@@ -11,9 +11,6 @@ module Cucumber
11
11
  @print_emtpy_match = print_emtpy_match
12
12
  end
13
13
 
14
- def before_features(features)
15
- end
16
-
17
14
  def before_feature(feature)
18
15
  @gf.uri(feature.file)
19
16
  @gf.feature(feature.gherkin_statement)
@@ -21,12 +18,10 @@ module Cucumber
21
18
 
22
19
  def before_background(background)
23
20
  @outline = false
24
- @gf.steps(background.raw_steps)
25
21
  @gf.background(background.gherkin_statement)
26
22
  end
27
23
 
28
24
  def before_feature_element(feature_element)
29
- @gf.steps(feature_element.raw_steps)
30
25
  case(feature_element)
31
26
  when Ast::Scenario
32
27
  @outline = false
@@ -77,7 +72,11 @@ module Cucumber
77
72
  end
78
73
 
79
74
  def embed(file, mime_type, label)
80
- @gf.embedding(mime_type, File.read(file))
75
+ data = File.read(file)
76
+ if defined?(JRUBY_VERSION)
77
+ data = data.to_java_bytes
78
+ end
79
+ @gf.embedding(mime_type, data)
81
80
  end
82
81
  end
83
82
  end
@@ -291,7 +291,7 @@ module Cucumber
291
291
  def doc_string(string)
292
292
  return if @hide_this_step
293
293
  @builder.pre(:class => 'val') do |pre|
294
- @builder << string.gsub("\n", '&#x000A;')
294
+ @builder << h(string.gsub("\n", '&#x000A;'))
295
295
  end
296
296
  end
297
297
 
@@ -373,8 +373,8 @@ module Cucumber
373
373
  @builder.div(:class => 'message') do
374
374
  message = exception.message
375
375
  if defined?(RAILS_ROOT) && message.include?('Exception caught')
376
- matches = message.match(/Showing <i>(.+)<\/i>(?:.+)#(\d+)/)
377
- backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"]
376
+ matches = message.match(/Showing <i>(.+)<\/i>(?:.+) #(\d+)/)
377
+ backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"] if matches
378
378
  message = message.match(/<code>([^(\/)]+)<\//m)[1]
379
379
  end
380
380
  @builder.pre do
@@ -11,17 +11,19 @@ module Cucumber
11
11
 
12
12
  def initialize(step_mother, io, options)
13
13
  @io = ensure_io(io, "json")
14
- @obj = {'features' => []}
15
- super(Gherkin::Formatter::JSONFormatter.new(nil), false)
14
+ @io.write('{"features":[')
15
+ super(Gherkin::Formatter::JSONFormatter.new(@io), false)
16
16
  end
17
17
 
18
- def after_feature(feature)
18
+ def before_feature(feature)
19
19
  super
20
- @obj['features'] << @gf.gherkin_object
20
+ @io.write(',') if @one
21
+ @one = true
21
22
  end
22
23
 
23
24
  def after_features(features)
24
- @io.write(@obj.to_json)
25
+ @io.write(']}')
26
+ @io.flush
25
27
  end
26
28
  end
27
29
  end
@@ -144,8 +144,7 @@ module Cucumber
144
144
  end
145
145
 
146
146
  def basename(feature_file)
147
- ext_length = File.extname(feature_file).length
148
- feature_file.gsub('features/', '').gsub(File::SEPARATOR, '_')[0...-ext_length]
147
+ File.basename(feature_file.gsub(/[\\\/]/, '-'), '.feature')
149
148
  end
150
149
 
151
150
  def write_file(feature_filename, data)
@@ -28,11 +28,13 @@ module Cucumber
28
28
  end
29
29
 
30
30
  def after_feature(*)
31
- after_first_time do
32
- @io.print ' '
31
+ unless @lines.empty?
32
+ after_first_time do
33
+ @io.print ' '
34
+ end
35
+ @io.print "#{@file}:#{@lines.join(':')}"
36
+ @io.flush
33
37
  end
34
- @io.print "#{@file}:#{@lines.join(':')}"
35
- @io.flush
36
38
  end
37
39
 
38
40
  def after_features(features)
@@ -4,7 +4,7 @@ require 'rbconfig'
4
4
 
5
5
  module Cucumber
6
6
  unless defined?(Cucumber::VERSION)
7
- VERSION = '1.0.0'
7
+ VERSION = '1.0.1'
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)
@@ -52,7 +52,7 @@ module Cucumber
52
52
  %w{20 6 14}
53
53
  ]
54
54
  ],
55
- Gherkin::Formatter::Model::Examples.new(nil, nil, nil, nil, nil, nil)
55
+ Gherkin::Formatter::Model::Examples.new(nil, nil, nil, nil, nil, nil, nil)
56
56
  ]
57
57
  ]
58
58
 
@@ -61,7 +61,7 @@ module Cucumber::Formatter
61
61
  }, File.join('features', 'some', 'path', 'spec.feature')
62
62
 
63
63
  it 'writes the filename including the subdirectory' do
64
- @formatter.written_files.keys.first.should == File.join('', 'TEST-some_path_spec.xml')
64
+ @formatter.written_files.keys.first.should == File.join('', 'TEST-features-some-path-spec.xml')
65
65
  end
66
66
  end
67
67
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
5
+ version: 1.0.1
11
6
  platform: ruby
12
7
  authors:
13
8
  - "Aslak Helles\xC3\xB8y"
@@ -15,8 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-06-20 00:00:00 +01:00
19
- default_executable:
13
+ date: 2011-07-10 00:00:00 Z
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  name: gherkin
@@ -26,12 +20,7 @@ dependencies:
26
20
  requirements:
27
21
  - - ~>
28
22
  - !ruby/object:Gem::Version
29
- hash: 29
30
- segments:
31
- - 2
32
- - 4
33
- - 1
34
- version: 2.4.1
23
+ version: 2.4.5
35
24
  type: :runtime
36
25
  version_requirements: *id001
37
26
  - !ruby/object:Gem::Dependency
@@ -42,11 +31,6 @@ dependencies:
42
31
  requirements:
43
32
  - - ">="
44
33
  - !ruby/object:Gem::Version
45
- hash: 29
46
- segments:
47
- - 1
48
- - 0
49
- - 5
50
34
  version: 1.0.5
51
35
  type: :runtime
52
36
  version_requirements: *id002
@@ -58,11 +42,6 @@ dependencies:
58
42
  requirements:
59
43
  - - ">="
60
44
  - !ruby/object:Gem::Version
61
- hash: 15
62
- segments:
63
- - 2
64
- - 1
65
- - 2
66
45
  version: 2.1.2
67
46
  type: :runtime
68
47
  version_requirements: *id003
@@ -74,11 +53,6 @@ dependencies:
74
53
  requirements:
75
54
  - - ">="
76
55
  - !ruby/object:Gem::Version
77
- hash: 23
78
- segments:
79
- - 1
80
- - 1
81
- - 2
82
56
  version: 1.1.2
83
57
  type: :runtime
84
58
  version_requirements: *id004
@@ -90,11 +64,6 @@ dependencies:
90
64
  requirements:
91
65
  - - ">="
92
66
  - !ruby/object:Gem::Version
93
- hash: 11
94
- segments:
95
- - 1
96
- - 4
97
- - 6
98
67
  version: 1.4.6
99
68
  type: :runtime
100
69
  version_requirements: *id005
@@ -106,11 +75,6 @@ dependencies:
106
75
  requirements:
107
76
  - - ~>
108
77
  - !ruby/object:Gem::Version
109
- hash: 11
110
- segments:
111
- - 0
112
- - 4
113
- - 2
114
78
  version: 0.4.2
115
79
  type: :development
116
80
  version_requirements: *id006
@@ -122,11 +86,6 @@ dependencies:
122
86
  requirements:
123
87
  - - ">="
124
88
  - !ruby/object:Gem::Version
125
- hash: 63
126
- segments:
127
- - 0
128
- - 9
129
- - 2
130
89
  version: 0.9.2
131
90
  type: :development
132
91
  version_requirements: *id007
@@ -138,11 +97,6 @@ dependencies:
138
97
  requirements:
139
98
  - - ">="
140
99
  - !ruby/object:Gem::Version
141
- hash: 23
142
- segments:
143
- - 2
144
- - 6
145
- - 0
146
100
  version: 2.6.0
147
101
  type: :development
148
102
  version_requirements: *id008
@@ -154,11 +108,6 @@ dependencies:
154
108
  requirements:
155
109
  - - ">="
156
110
  - !ruby/object:Gem::Version
157
- hash: 15
158
- segments:
159
- - 1
160
- - 4
161
- - 4
162
111
  version: 1.4.4
163
112
  type: :development
164
113
  version_requirements: *id009
@@ -170,11 +119,6 @@ dependencies:
170
119
  requirements:
171
120
  - - "="
172
121
  - !ruby/object:Gem::Version
173
- hash: 55
174
- segments:
175
- - 0
176
- - 8
177
- - 4
178
122
  version: 0.8.4
179
123
  type: :development
180
124
  version_requirements: *id010
@@ -186,11 +130,6 @@ dependencies:
186
130
  requirements:
187
131
  - - "="
188
132
  - !ruby/object:Gem::Version
189
- hash: 55
190
- segments:
191
- - 0
192
- - 8
193
- - 4
194
133
  version: 0.8.4
195
134
  type: :development
196
135
  version_requirements: *id011
@@ -202,11 +141,6 @@ dependencies:
202
141
  requirements:
203
142
  - - ">="
204
143
  - !ruby/object:Gem::Version
205
- hash: 23
206
- segments:
207
- - 1
208
- - 0
209
- - 0
210
144
  version: 1.0.0
211
145
  type: :development
212
146
  version_requirements: *id012
@@ -218,13 +152,6 @@ dependencies:
218
152
  requirements:
219
153
  - - ">="
220
154
  - !ruby/object:Gem::Version
221
- hash: 15424139
222
- segments:
223
- - 0
224
- - 9
225
- - 0
226
- - rc
227
- - 7
228
155
  version: 0.9.0.rc7
229
156
  type: :development
230
157
  version_requirements: *id013
@@ -236,11 +163,6 @@ dependencies:
236
163
  requirements:
237
164
  - - ">="
238
165
  - !ruby/object:Gem::Version
239
- hash: 11
240
- segments:
241
- - 0
242
- - 4
243
- - 2
244
166
  version: 0.4.2
245
167
  type: :development
246
168
  version_requirements: *id014
@@ -252,11 +174,6 @@ dependencies:
252
174
  requirements:
253
175
  - - "="
254
176
  - !ruby/object:Gem::Version
255
- hash: 1
256
- segments:
257
- - 0
258
- - 7
259
- - 1
260
177
  version: 0.7.1
261
178
  type: :development
262
179
  version_requirements: *id015
@@ -268,11 +185,6 @@ dependencies:
268
185
  requirements:
269
186
  - - "="
270
187
  - !ruby/object:Gem::Version
271
- hash: 31
272
- segments:
273
- - 1
274
- - 6
275
- - 8
276
188
  version: 1.6.8
277
189
  type: :development
278
190
  version_requirements: *id016
@@ -284,11 +196,6 @@ dependencies:
284
196
  requirements:
285
197
  - - "="
286
198
  - !ruby/object:Gem::Version
287
- hash: 5
288
- segments:
289
- - 0
290
- - 6
291
- - 1
292
199
  version: 0.6.1
293
200
  type: :development
294
201
  version_requirements: *id017
@@ -300,9 +207,6 @@ dependencies:
300
207
  requirements:
301
208
  - - ">="
302
209
  - !ruby/object:Gem::Version
303
- hash: 3
304
- segments:
305
- - 0
306
210
  version: "0"
307
211
  type: :development
308
212
  version_requirements: *id018
@@ -314,11 +218,6 @@ dependencies:
314
218
  requirements:
315
219
  - - ">="
316
220
  - !ruby/object:Gem::Version
317
- hash: 5
318
- segments:
319
- - 0
320
- - 5
321
- - 7
322
221
  version: 0.5.7
323
222
  type: :development
324
223
  version_requirements: *id019
@@ -330,11 +229,6 @@ dependencies:
330
229
  requirements:
331
230
  - - ">="
332
231
  - !ruby/object:Gem::Version
333
- hash: 5
334
- segments:
335
- - 0
336
- - 7
337
- - 3
338
232
  version: 0.7.3
339
233
  type: :development
340
234
  version_requirements: *id020
@@ -346,11 +240,6 @@ dependencies:
346
240
  requirements:
347
241
  - - ">="
348
242
  - !ruby/object:Gem::Version
349
- hash: 19
350
- segments:
351
- - 1
352
- - 2
353
- - 6
354
243
  version: 1.2.6
355
244
  type: :development
356
245
  version_requirements: *id021
@@ -362,11 +251,6 @@ dependencies:
362
251
  requirements:
363
252
  - - ">="
364
253
  - !ruby/object:Gem::Version
365
- hash: 23
366
- segments:
367
- - 1
368
- - 0
369
- - 0
370
254
  version: 1.0.0
371
255
  type: :development
372
256
  version_requirements: *id022
@@ -650,7 +534,7 @@ files:
650
534
  - features/iso-8859-1.feature
651
535
  - features/json_formatter.feature
652
536
  - features/stats_formatters.feature
653
- - features/step_definitions/cucumber-features/core_steps.rb
537
+ - features/step_definitions/cucumber-features/cucumber_ruby_mappings.rb
654
538
  - features/step_definitions/cucumber_steps.rb
655
539
  - features/step_definitions/iso-8859-1_steps.rb
656
540
  - features/support/env.rb
@@ -907,7 +791,6 @@ files:
907
791
  - spec/cucumber/ast/feature_spec.rb
908
792
  - spec/cucumber/ast/outline_table_spec.rb
909
793
  - spec/cucumber/ast/scenario_outline_spec.rb
910
- - spec/cucumber/ast/scenario_spec.rb
911
794
  - spec/cucumber/ast/step_spec.rb
912
795
  - spec/cucumber/ast/table_spec.rb
913
796
  - spec/cucumber/ast/tree_walker_spec.rb
@@ -943,20 +826,15 @@ files:
943
826
  - spec/cucumber/wire_support/wire_step_definition_spec.rb
944
827
  - spec/cucumber/world/pending_spec.rb
945
828
  - spec/spec_helper.rb
946
- has_rdoc: true
947
829
  homepage: http://cukes.info
948
830
  licenses: []
949
831
 
950
- post_install_message: |+
951
-
952
- (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
953
-
954
- Thank you for installing cucumber-1.0.0.
955
- Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading
956
- for important information about this release. Happy cuking!
957
-
958
- (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
959
-
832
+ post_install_message: "\n\
833
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n\
834
+ Thank you for installing cucumber-1.0.1.\n\
835
+ Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading\n\
836
+ for important information about this release. Happy cuking!\n\n\
837
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
960
838
  rdoc_options:
961
839
  - --charset=UTF-8
962
840
  require_paths:
@@ -966,26 +844,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
966
844
  requirements:
967
845
  - - ">="
968
846
  - !ruby/object:Gem::Version
969
- hash: 3
970
- segments:
971
- - 0
972
847
  version: "0"
973
848
  required_rubygems_version: !ruby/object:Gem::Requirement
974
849
  none: false
975
850
  requirements:
976
851
  - - ">="
977
852
  - !ruby/object:Gem::Version
978
- hash: 3
979
- segments:
980
- - 0
981
853
  version: "0"
982
854
  requirements: []
983
855
 
984
856
  rubyforge_project:
985
- rubygems_version: 1.6.2
857
+ rubygems_version: 1.8.5
986
858
  signing_key:
987
859
  specification_version: 3
988
- summary: cucumber-1.0.0
860
+ summary: cucumber-1.0.1
989
861
  test_files:
990
862
  - features/background.feature
991
863
  - features/bootstrap.feature
@@ -995,7 +867,7 @@ test_files:
995
867
  - features/iso-8859-1.feature
996
868
  - features/json_formatter.feature
997
869
  - features/stats_formatters.feature
998
- - features/step_definitions/cucumber-features/core_steps.rb
870
+ - features/step_definitions/cucumber-features/cucumber_ruby_mappings.rb
999
871
  - features/step_definitions/cucumber_steps.rb
1000
872
  - features/step_definitions/iso-8859-1_steps.rb
1001
873
  - features/support/env.rb
@@ -1007,7 +879,6 @@ test_files:
1007
879
  - spec/cucumber/ast/feature_spec.rb
1008
880
  - spec/cucumber/ast/outline_table_spec.rb
1009
881
  - spec/cucumber/ast/scenario_outline_spec.rb
1010
- - spec/cucumber/ast/scenario_spec.rb
1011
882
  - spec/cucumber/ast/step_spec.rb
1012
883
  - spec/cucumber/ast/table_spec.rb
1013
884
  - spec/cucumber/ast/tree_walker_spec.rb