cucumber 0.9.3 → 0.9.4
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/Gemfile +5 -0
- data/History.txt +9 -0
- data/cucumber.gemspec +1 -1
- data/features/support/env.rb +5 -0
- data/features/wire_protocol.feature +2 -2
- data/lib/cucumber.rb +0 -1
- data/lib/cucumber/ast/background.rb +16 -2
- data/lib/cucumber/ast/table.rb +7 -3
- data/lib/cucumber/cli/options.rb +1 -1
- data/lib/cucumber/core_ext/disable_mini_unit_autorun.rb +4 -0
- data/lib/cucumber/core_ext/proc.rb +2 -1
- data/lib/cucumber/formatter/cucumber.css +13 -0
- data/lib/cucumber/formatter/cucumber.sass +32 -17
- data/lib/cucumber/formatter/html.rb +31 -1
- data/lib/cucumber/js_support/js_snippets.rb +2 -2
- data/lib/cucumber/platform.rb +1 -1
- data/lib/cucumber/py_support/py_language.rb +2 -2
- data/lib/cucumber/rb_support/rb_language.rb +2 -2
- data/lib/cucumber/runtime.rb +4 -2
- data/lib/cucumber/runtime/results.rb +18 -4
- data/lib/cucumber/step_mother.rb +1 -1
- data/lib/cucumber/wire_support/wire_language.rb +2 -2
- data/spec/cucumber/ast/background_spec.rb +57 -0
- data/spec/cucumber/ast/table_spec.rb +17 -0
- metadata +9 -11
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 0.9.4 (2010-11-07)
|
2
|
+
|
3
|
+
=== Bugfixes
|
4
|
+
* Superfluous space after step_keyword value in snippet_text message (#679 Aslak Hellesøy)
|
5
|
+
* Better Handling for "announce" in HTML formatter (#676 Stephen Kennedy)
|
6
|
+
* Too many open files - getcwd (#666 Aslak Hellesøy)
|
7
|
+
* Cucumber 0.9.3 prevents Test::Unit from running (#677 Aslak Hellesøy)
|
8
|
+
* Performance degradation when running feature files with over 1000 steps (#675 Dimitri Geshef)
|
9
|
+
|
1
10
|
== 0.9.3 (2010-10-24)
|
2
11
|
|
3
12
|
=== Bugfixes
|
data/cucumber.gemspec
CHANGED
@@ -31,7 +31,7 @@ for important information about this release. Happy cuking!
|
|
31
31
|
s.add_dependency 'json', '~> 1.4.6'
|
32
32
|
|
33
33
|
s.add_development_dependency 'rake', '~> 0.8.7'
|
34
|
-
s.add_development_dependency 'rspec', '~> 2.0.
|
34
|
+
s.add_development_dependency 'rspec', '~> 2.0.1'
|
35
35
|
s.add_development_dependency 'nokogiri', '~> 1.4.3'
|
36
36
|
s.add_development_dependency 'prawn', '= 0.8.4'
|
37
37
|
s.add_development_dependency 'prawn-layout', '= 0.8.4'
|
data/features/support/env.rb
CHANGED
@@ -5,6 +5,11 @@ require 'rspec/expectations'
|
|
5
5
|
require 'fileutils'
|
6
6
|
require 'forwardable'
|
7
7
|
require 'cucumber/formatter/unicode'
|
8
|
+
# This is to force miniunit to be loaded on 1.9.2, and verify that we can still run with --profile. See:
|
9
|
+
# * disable_mini_test_autorun.rb and
|
10
|
+
# * http://groups.google.com/group/cukes/browse_thread/thread/5682d41436e235d7
|
11
|
+
# * https://rspec.lighthouseapp.com/projects/16211/tickets/677-cucumber-093-prevents-testunit-from-running
|
12
|
+
require 'test/unit'
|
8
13
|
|
9
14
|
class CucumberWorld
|
10
15
|
extend Forwardable
|
@@ -294,9 +294,9 @@ Feature: Wire Protocol
|
|
294
294
|
Given there is a wire server running on port 54321 which understands the following protocol:
|
295
295
|
| request | response |
|
296
296
|
| ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[]] |
|
297
|
-
| ["snippet_text",{"step_keyword":"Given
|
297
|
+
| ["snippet_text",{"step_keyword":"Given","multiline_arg_class":"","step_name":"we're all wired"}] | ["success","foo()\n bar;\nbaz"] |
|
298
298
|
| ["begin_scenario"] | ["success"] |
|
299
|
-
| ["end_scenario"]
|
299
|
+
| ["end_scenario"] | ["success"] |
|
300
300
|
When I run cucumber -f pretty
|
301
301
|
Then STDERR should be empty
|
302
302
|
And it should pass with
|
data/lib/cucumber.rb
CHANGED
@@ -4,7 +4,7 @@ module Cucumber
|
|
4
4
|
module Ast
|
5
5
|
class Background #:nodoc:
|
6
6
|
include FeatureElement
|
7
|
-
attr_reader :feature_elements
|
7
|
+
attr_reader :feature_elements, :name
|
8
8
|
|
9
9
|
def initialize(comment, line, keyword, name, raw_steps)
|
10
10
|
@comment, @line, @keyword, @name, @raw_steps = comment, line, keyword, name, raw_steps
|
@@ -35,13 +35,15 @@ module Cucumber
|
|
35
35
|
visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
|
36
36
|
with_visitor(hook_context, visitor) do
|
37
37
|
visitor.step_mother.before(hook_context)
|
38
|
+
skip_invoke! if failed?
|
38
39
|
visitor.visit_steps(@step_invocations)
|
39
|
-
@failed = @step_invocations.detect{|step_invocation| step_invocation.exception}
|
40
|
+
@failed = @step_invocations.detect{|step_invocation| step_invocation.exception || step_invocation.status != :passed }
|
40
41
|
visitor.step_mother.after(hook_context) if @failed || @feature_elements.empty?
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
44
45
|
def with_visitor(scenario, visitor)
|
46
|
+
@current_visitor = visitor
|
45
47
|
init
|
46
48
|
if self != scenario && scenario.respond_to?(:with_visitor)
|
47
49
|
scenario.with_visitor(visitor) do
|
@@ -62,6 +64,10 @@ module Cucumber
|
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
67
|
+
def skip_invoke!
|
68
|
+
@step_invocations.each{|step_invocation| step_invocation.skip_invoke!}
|
69
|
+
end
|
70
|
+
|
65
71
|
def failed?
|
66
72
|
@failed
|
67
73
|
end
|
@@ -80,6 +86,14 @@ module Cucumber
|
|
80
86
|
sexp += steps if steps.any?
|
81
87
|
sexp
|
82
88
|
end
|
89
|
+
|
90
|
+
def fail!(exception)
|
91
|
+
@failed = true
|
92
|
+
@exception = exception
|
93
|
+
@current_visitor.visit_exception(@exception, :failed)
|
94
|
+
end
|
95
|
+
|
96
|
+
|
83
97
|
end
|
84
98
|
end
|
85
99
|
end
|
data/lib/cucumber/ast/table.rb
CHANGED
@@ -154,7 +154,7 @@ module Cucumber
|
|
154
154
|
#
|
155
155
|
# gets converted into the following:
|
156
156
|
#
|
157
|
-
# [['a', 'b], ['c', 'd']]
|
157
|
+
# [['a', 'b'], ['c', 'd']]
|
158
158
|
#
|
159
159
|
def raw
|
160
160
|
cell_matrix.map do |row|
|
@@ -164,6 +164,10 @@ module Cucumber
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
+
def column_names #:nodoc:
|
168
|
+
@col_names ||= cell_matrix[0].map { |cell| cell.value }
|
169
|
+
end
|
170
|
+
|
167
171
|
# Same as #raw, but skips the first (header) row
|
168
172
|
def rows
|
169
173
|
raw[1..-1]
|
@@ -380,7 +384,7 @@ module Cucumber
|
|
380
384
|
hash = Hash.new do |hash, key|
|
381
385
|
hash[key.to_s] if key.is_a?(Symbol)
|
382
386
|
end
|
383
|
-
|
387
|
+
column_names.each_with_index do |column_name, column_index|
|
384
388
|
value = @conversion_procs[column_name].call(cells.value(column_index))
|
385
389
|
hash[column_name] = value
|
386
390
|
end
|
@@ -681,4 +685,4 @@ module Cucumber
|
|
681
685
|
end
|
682
686
|
end
|
683
687
|
end
|
684
|
-
end
|
688
|
+
end
|
data/lib/cucumber/cli/options.rb
CHANGED
@@ -165,7 +165,7 @@ module Cucumber
|
|
165
165
|
"This represents the boolean expression (@foo || !@bar) && @zap.",
|
166
166
|
"\n",
|
167
167
|
"Beware that if you want to use several negative tags to exclude several tags",
|
168
|
-
"you have to use logical AND: --tags ~@fixme --tags
|
168
|
+
"you have to use logical AND: --tags ~@fixme --tags ~@buggy.",
|
169
169
|
"\n",
|
170
170
|
"Positive tags can be given a threshold to limit the number of occurrences.",
|
171
171
|
"Example: --tags @qa:3 will fail if there are more than 3 occurrences of the @qa tag.",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# Proc extension to get more location info out of a proc
|
2
2
|
class Proc #:nodoc:
|
3
3
|
PROC_PATTERN = /[\d\w]+@(.+):(\d+).*>/
|
4
|
+
PWD = Dir.pwd
|
4
5
|
|
5
6
|
def to_comment_line
|
6
7
|
"# #{file_colon_line}"
|
@@ -14,7 +15,7 @@ class Proc #:nodoc:
|
|
14
15
|
def file_colon_line
|
15
16
|
path, line = *to_s.match(PROC_PATTERN)[1..2]
|
16
17
|
path = File.expand_path(path)
|
17
|
-
pwd = File.expand_path(
|
18
|
+
pwd = File.expand_path(PWD)
|
18
19
|
if path.index(pwd)
|
19
20
|
path = path[pwd.length+1..-1]
|
20
21
|
elsif path =~ /.*\/gems\/(.*\.rb)$/
|
@@ -129,6 +129,12 @@ body {
|
|
129
129
|
background: #fcfb98;
|
130
130
|
color: #131313;
|
131
131
|
}
|
132
|
+
.cucumber table td.announcement, td table td.announcement, th table td.announcement {
|
133
|
+
border-left: 5px solid aqua;
|
134
|
+
border-bottom: 1px solid aqua;
|
135
|
+
background: #e0ffff;
|
136
|
+
color: #001111;
|
137
|
+
}
|
132
138
|
.cucumber ol, td ol, th ol {
|
133
139
|
list-style: none;
|
134
140
|
margin: 0px;
|
@@ -175,6 +181,13 @@ body {
|
|
175
181
|
background: #fcfb98;
|
176
182
|
color: #131313;
|
177
183
|
}
|
184
|
+
.cucumber ol li.announcement, td ol li.announcement, th ol li.announcement {
|
185
|
+
border-left: 5px solid aqua;
|
186
|
+
border-bottom: 1px solid aqua;
|
187
|
+
background: #e0ffff;
|
188
|
+
color: #001111;
|
189
|
+
margin-left: 10px;
|
190
|
+
}
|
178
191
|
.cucumber #summary, td #summary, th #summary {
|
179
192
|
margin: 0px;
|
180
193
|
padding: 5px 10px;
|
@@ -1,28 +1,32 @@
|
|
1
1
|
/* cucumber.css is generated from cucumber.sass */
|
2
2
|
/* Regenerate with rake sass */
|
3
3
|
|
4
|
-
!step_left
|
5
|
-
!step_bottom
|
4
|
+
!step_left = 5px "solid"
|
5
|
+
!step_bottom = 1px "solid"
|
6
6
|
|
7
|
-
!failed
|
8
|
-
!failed_border
|
9
|
-
!failed_text
|
7
|
+
!failed = #FFFBD3
|
8
|
+
!failed_border = #C20000
|
9
|
+
!failed_text = #C20000
|
10
10
|
|
11
|
-
!passed
|
12
|
-
!passed_border
|
13
|
-
!passed_text
|
11
|
+
!passed = #DBFFB4
|
12
|
+
!passed_border = #65C400
|
13
|
+
!passed_text = #3D7700
|
14
14
|
|
15
|
-
!skipped
|
16
|
-
!skipped_border
|
17
|
-
!skipped_text
|
15
|
+
!skipped = #E0FFFF
|
16
|
+
!skipped_border = #00FFFF
|
17
|
+
!skipped_text = #001111
|
18
18
|
|
19
|
-
!pending
|
20
|
-
!pending_border
|
21
|
-
!pending_text
|
19
|
+
!pending = #FCFB98
|
20
|
+
!pending_border = #FAF834
|
21
|
+
!pending_text = #131313
|
22
22
|
|
23
|
-
!undefined
|
24
|
-
!undefined_border
|
25
|
-
!undefined_text
|
23
|
+
!undefined = #FCFB98
|
24
|
+
!undefined_border = #FAF834
|
25
|
+
!undefined_text = #131313
|
26
|
+
|
27
|
+
!announcement = #E0FFFF
|
28
|
+
!announcement_border = #00FFFF
|
29
|
+
!announcement_text = #001111
|
26
30
|
|
27
31
|
body
|
28
32
|
:font-size 0px
|
@@ -148,6 +152,11 @@ body
|
|
148
152
|
:border-bottom= !step_bottom !undefined_border
|
149
153
|
:background= !undefined
|
150
154
|
:color= !undefined_text
|
155
|
+
td.announcement
|
156
|
+
:border-left= !step_left !announcement_border
|
157
|
+
:border-bottom= !step_bottom !announcement_border
|
158
|
+
:background= !announcement
|
159
|
+
:color= !announcement_text
|
151
160
|
|
152
161
|
ol
|
153
162
|
:list-style none
|
@@ -187,6 +196,12 @@ body
|
|
187
196
|
:border-bottom= !step_bottom !undefined_border
|
188
197
|
:background= !undefined
|
189
198
|
:color= !undefined_text
|
199
|
+
li.announcement
|
200
|
+
:border-left= !step_left !announcement_border
|
201
|
+
:border-bottom= !step_bottom !announcement_border
|
202
|
+
:background= !announcement
|
203
|
+
:color= !announcement_text
|
204
|
+
:margin-left= 10px
|
190
205
|
|
191
206
|
#summary
|
192
207
|
:margin 0px
|
@@ -20,6 +20,7 @@ module Cucumber
|
|
20
20
|
@scenario_number = 0
|
21
21
|
@step_number = 0
|
22
22
|
@header_red = nil
|
23
|
+
@delayed_announcements = []
|
23
24
|
end
|
24
25
|
|
25
26
|
def embed(file, mime_type)
|
@@ -245,6 +246,7 @@ module Cucumber
|
|
245
246
|
end
|
246
247
|
end
|
247
248
|
@builder << '</li>'
|
249
|
+
print_announcements
|
248
250
|
end
|
249
251
|
|
250
252
|
def step_name(keyword, step_match, status, source_indent, background)
|
@@ -298,6 +300,7 @@ module Cucumber
|
|
298
300
|
|
299
301
|
def after_table_row(table_row)
|
300
302
|
return if @hide_this_step
|
303
|
+
print_table_row_announcements
|
301
304
|
@builder << '</tr>'
|
302
305
|
if table_row.exception
|
303
306
|
@builder.tr do
|
@@ -328,7 +331,34 @@ module Cucumber
|
|
328
331
|
end
|
329
332
|
|
330
333
|
def announce(announcement)
|
331
|
-
@
|
334
|
+
@delayed_announcements << announcement
|
335
|
+
#@builder.pre(announcement, :class => 'announcement')
|
336
|
+
end
|
337
|
+
|
338
|
+
def print_announcements
|
339
|
+
return if @delayed_announcements.empty?
|
340
|
+
|
341
|
+
#@builder.ol do
|
342
|
+
@delayed_announcements.each do |ann|
|
343
|
+
@builder.li(:class => 'step announcement') do
|
344
|
+
@builder << ann
|
345
|
+
end
|
346
|
+
end
|
347
|
+
#end
|
348
|
+
empty_announcements
|
349
|
+
end
|
350
|
+
|
351
|
+
def print_table_row_announcements
|
352
|
+
return if @delayed_announcements.empty?
|
353
|
+
|
354
|
+
@builder.td(:class => 'announcement') do
|
355
|
+
@builder << @delayed_announcements.join(", ")
|
356
|
+
end
|
357
|
+
empty_announcements
|
358
|
+
end
|
359
|
+
|
360
|
+
def empty_announcements
|
361
|
+
@delayed_announcements = []
|
332
362
|
end
|
333
363
|
|
334
364
|
protected
|
@@ -4,7 +4,7 @@ module Cucumber
|
|
4
4
|
PARAM_PATTERN = /"([^"]*)"/
|
5
5
|
ESCAPED_PARAM_PATTERN = '"([^\\"]*)"'
|
6
6
|
|
7
|
-
def snippet_text(
|
7
|
+
def snippet_text(code_keyword, step_name, multiline_arg_class)
|
8
8
|
escaped = Regexp.escape(step_name).gsub('\ ', ' ').gsub('/', '\/')
|
9
9
|
escaped = escaped.gsub(PARAM_PATTERN, ESCAPED_PARAM_PATTERN)
|
10
10
|
|
@@ -20,7 +20,7 @@ module Cucumber
|
|
20
20
|
multiline_class_comment = "//#{multiline_arg_class.default_arg_name} is a #{multiline_arg_class.to_s}\n"
|
21
21
|
end
|
22
22
|
|
23
|
-
"#{
|
23
|
+
"#{code_keyword}(/^#{escaped}$/, function(#{block_arg_string}){\n #{multiline_class_comment} //express the regexp above with the code you wish you had\n});"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/cucumber/platform.rb
CHANGED
@@ -4,7 +4,7 @@ require 'rbconfig'
|
|
4
4
|
|
5
5
|
module Cucumber
|
6
6
|
unless defined?(Cucumber::VERSION)
|
7
|
-
VERSION = '0.9.
|
7
|
+
VERSION = '0.9.4'
|
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)
|
@@ -28,8 +28,8 @@ module Cucumber
|
|
28
28
|
mod = import(py_file)
|
29
29
|
end
|
30
30
|
|
31
|
-
def snippet_text(
|
32
|
-
"python snippet: #{
|
31
|
+
def snippet_text(code_keyword, step_name, multiline_arg_class)
|
32
|
+
"python snippet: #{code_keyword}, #{step_name}"
|
33
33
|
end
|
34
34
|
|
35
35
|
def begin_scenario(scenario)
|
@@ -91,7 +91,7 @@ module Cucumber
|
|
91
91
|
|
92
92
|
ARGUMENT_PATTERNS = ['"([^"]*)"', '(\d+)']
|
93
93
|
|
94
|
-
def snippet_text(
|
94
|
+
def snippet_text(code_keyword, step_name, multiline_arg_class)
|
95
95
|
snippet_pattern = Regexp.escape(step_name).gsub('\ ', ' ').gsub('/', '\/')
|
96
96
|
arg_count = 0
|
97
97
|
ARGUMENT_PATTERNS.each do |pattern|
|
@@ -107,7 +107,7 @@ module Cucumber
|
|
107
107
|
multiline_class_comment = "# #{multiline_arg_class.default_arg_name} is a #{multiline_arg_class.to_s}\n "
|
108
108
|
end
|
109
109
|
|
110
|
-
"#{
|
110
|
+
"#{code_keyword} /^#{snippet_pattern}$/ do#{block_arg_string}\n #{multiline_class_comment}pending # express the regexp above with the code you wish you had\nend"
|
111
111
|
end
|
112
112
|
|
113
113
|
def begin_rb_scenario(scenario)
|
data/lib/cucumber/runtime.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
require 'gherkin/rubify'
|
2
|
+
require 'gherkin/i18n'
|
1
3
|
require 'cucumber/configuration'
|
2
4
|
require 'cucumber/language_support/language_methods'
|
3
5
|
require 'cucumber/formatter/duration'
|
4
|
-
require 'gherkin/rubify'
|
5
6
|
require 'cucumber/runtime/user_interface'
|
6
7
|
require 'cucumber/runtime/features_loader'
|
7
8
|
require 'cucumber/runtime/results'
|
@@ -16,6 +17,7 @@ module Cucumber
|
|
16
17
|
include Runtime::UserInterface
|
17
18
|
|
18
19
|
def initialize(configuration = Configuration.default)
|
20
|
+
require 'cucumber/core_ext/disable_mini_unit_autorun'
|
19
21
|
@current_scenario = nil
|
20
22
|
@configuration = Configuration.parse(configuration)
|
21
23
|
@support_code = SupportCode.new(self, @configuration)
|
@@ -68,7 +70,7 @@ module Cucumber
|
|
68
70
|
end
|
69
71
|
|
70
72
|
def snippet_text(step_keyword, step_name, multiline_arg_class) #:nodoc:
|
71
|
-
@support_code.snippet_text(step_keyword, step_name, multiline_arg_class)
|
73
|
+
@support_code.snippet_text(Gherkin::I18n.code_keyword_for(step_keyword), step_name, multiline_arg_class)
|
72
74
|
end
|
73
75
|
|
74
76
|
def with_hooks(scenario, skip_hooks=false)
|
@@ -4,18 +4,32 @@ module Cucumber
|
|
4
4
|
class Results
|
5
5
|
def initialize(configuration)
|
6
6
|
@configuration = configuration
|
7
|
+
|
8
|
+
# Optimization - quicker lookup.
|
9
|
+
@inserted_steps = {}
|
10
|
+
@inserted_scenarios = {}
|
7
11
|
end
|
8
|
-
|
12
|
+
|
9
13
|
def configure(new_configuration)
|
10
14
|
@configuration = Configuration.parse(new_configuration)
|
11
15
|
end
|
12
|
-
|
16
|
+
|
13
17
|
def step_visited(step) #:nodoc:
|
14
|
-
|
18
|
+
step_id = step.object_id
|
19
|
+
|
20
|
+
unless @inserted_steps.has_key?(step_id)
|
21
|
+
@inserted_steps[step_id] = step
|
22
|
+
steps.push(step)
|
23
|
+
end
|
15
24
|
end
|
16
25
|
|
17
26
|
def scenario_visited(scenario) #:nodoc:
|
18
|
-
|
27
|
+
scenario_id = scenario.object_id
|
28
|
+
|
29
|
+
unless @inserted_scenarios.has_key?(scenario_id)
|
30
|
+
@inserted_scenarios[scenario_id] = scenario
|
31
|
+
scenarios.push(scenario)
|
32
|
+
end
|
19
33
|
end
|
20
34
|
|
21
35
|
def steps(status = nil) #:nodoc:
|
data/lib/cucumber/step_mother.rb
CHANGED
@@ -3,7 +3,7 @@ require 'cucumber/runtime'
|
|
3
3
|
module Cucumber
|
4
4
|
class StepMother < Runtime
|
5
5
|
def initialize(*args)
|
6
|
-
warn("StepMother has been deprecated and will be gently put to sleep at the next major
|
6
|
+
warn("StepMother has been deprecated and will be gently put to sleep at the next major release. Please use Runtime instead. #{caller[0]}")
|
7
7
|
super
|
8
8
|
end
|
9
9
|
end
|
@@ -26,9 +26,9 @@ module Cucumber
|
|
26
26
|
@connections << Connection.new(config)
|
27
27
|
end
|
28
28
|
|
29
|
-
def snippet_text(
|
29
|
+
def snippet_text(code_keyword, step_name, multiline_arg_class)
|
30
30
|
snippets = @connections.map do |remote|
|
31
|
-
remote.snippet_text(
|
31
|
+
remote.snippet_text(code_keyword, step_name, multiline_arg_class.to_s)
|
32
32
|
end
|
33
33
|
snippets.flatten.join("\n")
|
34
34
|
end
|
@@ -48,6 +48,63 @@ module Cucumber
|
|
48
48
|
$x.should == 2
|
49
49
|
$y.should == 10
|
50
50
|
end
|
51
|
+
|
52
|
+
describe "should respond to #name" do
|
53
|
+
it "with a value" do
|
54
|
+
background = Background.new(
|
55
|
+
comment=Comment.new(''),
|
56
|
+
line=2,
|
57
|
+
keyword="",
|
58
|
+
name="background name",
|
59
|
+
steps=[])
|
60
|
+
lambda{ background.name }.should_not raise_error
|
61
|
+
background.name.should == 'background name'
|
62
|
+
end
|
63
|
+
it "without a value" do
|
64
|
+
background = Background.new(
|
65
|
+
comment=Comment.new(''),
|
66
|
+
line=2,
|
67
|
+
keyword="",
|
68
|
+
name=nil,
|
69
|
+
steps=[])
|
70
|
+
lambda{ background.name }.should_not raise_error
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "failures in a Before hook" do
|
75
|
+
|
76
|
+
before do
|
77
|
+
Before do
|
78
|
+
raise Exception, "Exception from Before hook"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should state that the background has failed" do
|
83
|
+
# Assign
|
84
|
+
background = Background.new(
|
85
|
+
comment=Comment.new(''),
|
86
|
+
line=2,
|
87
|
+
keyword="",
|
88
|
+
name="",
|
89
|
+
steps=[
|
90
|
+
Step.new(7, "Given", "y is 5")
|
91
|
+
])
|
92
|
+
background.feature = @feature
|
93
|
+
|
94
|
+
# Expect
|
95
|
+
@visitor.should_receive( :visit_exception ) do |exception, status|
|
96
|
+
exception.should be_instance_of( Exception )
|
97
|
+
exception.message.should == "Exception from Before hook"
|
98
|
+
status.should == :failed
|
99
|
+
end
|
100
|
+
|
101
|
+
# Assert
|
102
|
+
lambda{ @visitor.visit_background(background) }.should_not raise_error
|
103
|
+
background.should be_failed
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
51
107
|
end
|
108
|
+
|
52
109
|
end
|
53
110
|
end
|
@@ -335,6 +335,23 @@ module Cucumber
|
|
335
335
|
}
|
336
336
|
end
|
337
337
|
|
338
|
+
it "should detect seemingly identical tables as different" do
|
339
|
+
t1 = Table.new([
|
340
|
+
['X', 'Y'],
|
341
|
+
['2', '1']
|
342
|
+
])
|
343
|
+
t2 = Table.new([
|
344
|
+
['X', 'Y'],
|
345
|
+
[2, 1]
|
346
|
+
])
|
347
|
+
lambda{t1.diff!(t2)}.should raise_error
|
348
|
+
t1.to_s(:indent => 12, :color => false).should == %{
|
349
|
+
| X | Y |
|
350
|
+
| (-) (i) "2" | (-) (i) "1" |
|
351
|
+
| (+) (i) 2 | (+) (i) 1 |
|
352
|
+
}
|
353
|
+
end
|
354
|
+
|
338
355
|
it "should not allow mappings that match more than 1 column" do
|
339
356
|
t1 = Table.new([
|
340
357
|
['Cuke', 'Duke'],
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 4
|
9
|
+
version: 0.9.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Aslak Helles\xC3\xB8y"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-07 00:00:00 +00:00
|
18
18
|
default_executable: cucumber
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -117,10 +117,8 @@ dependencies:
|
|
117
117
|
segments:
|
118
118
|
- 2
|
119
119
|
- 0
|
120
|
-
-
|
121
|
-
|
122
|
-
- 20
|
123
|
-
version: 2.0.0.beta.20
|
120
|
+
- 1
|
121
|
+
version: 2.0.1
|
124
122
|
type: :development
|
125
123
|
prerelease: false
|
126
124
|
version_requirements: *id007
|
@@ -762,7 +760,7 @@ licenses: []
|
|
762
760
|
|
763
761
|
post_install_message: "\n\
|
764
762
|
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n\
|
765
|
-
Thank you for installing cucumber-0.9.
|
763
|
+
Thank you for installing cucumber-0.9.4.\n\
|
766
764
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading\n\
|
767
765
|
for important information about this release. Happy cuking!\n\n\
|
768
766
|
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
|
@@ -775,7 +773,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
775
773
|
requirements:
|
776
774
|
- - ">="
|
777
775
|
- !ruby/object:Gem::Version
|
778
|
-
hash:
|
776
|
+
hash: 95980206032165697
|
779
777
|
segments:
|
780
778
|
- 0
|
781
779
|
version: "0"
|
@@ -784,7 +782,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
784
782
|
requirements:
|
785
783
|
- - ">="
|
786
784
|
- !ruby/object:Gem::Version
|
787
|
-
hash:
|
785
|
+
hash: 95980206032165697
|
788
786
|
segments:
|
789
787
|
- 0
|
790
788
|
version: "0"
|
@@ -794,7 +792,7 @@ rubyforge_project:
|
|
794
792
|
rubygems_version: 1.3.7
|
795
793
|
signing_key:
|
796
794
|
specification_version: 3
|
797
|
-
summary: cucumber-0.9.
|
795
|
+
summary: cucumber-0.9.4
|
798
796
|
test_files:
|
799
797
|
- features/announce.feature
|
800
798
|
- features/api/list_step_defs_as_json.feature
|