cucumber 0.7.0 → 0.7.1
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/History.txt +8 -0
- data/VERSION.yml +1 -1
- data/cucumber.gemspec +3 -3
- data/examples/tickets/features/step_definitons/half_manual_steps.rb +1 -1
- data/examples/webrat/features/step_definitions/kvasir_steps.rb +1 -1
- data/features/custom_formatter.feature +45 -0
- data/features/listener_debugger_formatter.feature +1 -0
- data/features/step_definitions/cucumber_steps.rb +10 -10
- data/lib/cucumber/ast/tree_walker.rb +17 -1
- data/lib/cucumber/js_support/js_snippets.rb +1 -1
- data/lib/cucumber/rb_support/rb_language.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.7.1 (2010-05-03)
|
2
|
+
|
3
|
+
=== Bugfixes
|
4
|
+
* Add backwards compatibility fix (with deprecation warning) for legacy 0.6.4 formatters. (Aslak Hellesøy)
|
5
|
+
|
6
|
+
=== Changed Features
|
7
|
+
* Ruby and Javascript snippets will use "([^"]*)" instead of "([^\"]*)"$/ (Aslak Hellesøy)
|
8
|
+
|
1
9
|
== 0.7.0 (2010-05-02)
|
2
10
|
|
3
11
|
This release is an important milestone for Cucumber. A new parser (the gherkin gem) parses feature
|
data/VERSION.yml
CHANGED
data/cucumber.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cucumber}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Aslak Helles\303\270y"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-03}
|
13
13
|
s.default_executable = %q{cucumber}
|
14
14
|
s.description = %q{Behaviour Driven Development with elegance and joy}
|
15
15
|
s.email = %q{cukes@googlegroups.com}
|
@@ -541,7 +541,7 @@ Gem::Specification.new do |s|
|
|
541
541
|
|
542
542
|
(::) U P G R A D I N G (::)
|
543
543
|
|
544
|
-
Thank you for installing cucumber-0.7.
|
544
|
+
Thank you for installing cucumber-0.7.1.
|
545
545
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
|
546
546
|
for important information about this release. Happy cuking!
|
547
547
|
|
@@ -6,6 +6,6 @@ When /^I check my mailbox$/ do
|
|
6
6
|
@answer = ask("What's in your mailbox? ", 3)
|
7
7
|
end
|
8
8
|
|
9
|
-
Then /^I should have an email containing "([
|
9
|
+
Then /^I should have an email containing "([^"]*)"$/ do |content|
|
10
10
|
@answer.should =~ Regexp.new(content)
|
11
11
|
end
|
@@ -45,3 +45,48 @@ Feature: Custom Formatter
|
|
45
45
|
$ JUST PRINT ME
|
46
46
|
|
47
47
|
"""
|
48
|
+
|
49
|
+
Scenario: Legacy pre-0.7.0 formatter
|
50
|
+
Given a standard Cucumber project directory structure
|
51
|
+
And a file named "features/f.feature" with:
|
52
|
+
"""
|
53
|
+
Feature: We like old cukes
|
54
|
+
Scenario: just print me
|
55
|
+
Given this step works
|
56
|
+
"""
|
57
|
+
And a file named "features/step_definitions/steps.rb" with:
|
58
|
+
"""
|
59
|
+
Given /^this step works$/ do
|
60
|
+
end
|
61
|
+
"""
|
62
|
+
And a file named "features/support/legacy/formator.rb" with:
|
63
|
+
"""
|
64
|
+
module Legacy
|
65
|
+
class Formator
|
66
|
+
def initialize(step_mother, io, options)
|
67
|
+
@io = io
|
68
|
+
end
|
69
|
+
|
70
|
+
def feature_name(name)
|
71
|
+
@io.puts name
|
72
|
+
end
|
73
|
+
|
74
|
+
def scenario_name(keyword, name, file_colon_line, source_indent)
|
75
|
+
@io.puts "#{keyword} #{name}"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
"""
|
80
|
+
When I run cucumber features/f.feature --format Legacy::Formator
|
81
|
+
Then STDERR should be
|
82
|
+
"""
|
83
|
+
Legacy::Formator is using a deprecated formatter API. The signature has changed to :feature_name(keyword, name) # no trailing : in keyword
|
84
|
+
Legacy::Formator is using a deprecated formatter API. The :scenario_name method does not receive trailing : in keyword
|
85
|
+
|
86
|
+
"""
|
87
|
+
Then it should pass with
|
88
|
+
"""
|
89
|
+
Feature: We like old cukes
|
90
|
+
Scenario: just print me
|
91
|
+
|
92
|
+
"""
|
@@ -21,11 +21,11 @@ Given /^the (.*) directory is empty$/ do |directory|
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
Given /^a file named "([
|
24
|
+
Given /^a file named "([^"]*)"$/ do |file_name|
|
25
25
|
create_file(file_name, '')
|
26
26
|
end
|
27
27
|
|
28
|
-
Given /^a file named "([
|
28
|
+
Given /^a file named "([^"]*)" with:$/ do |file_name, file_content|
|
29
29
|
create_file(file_name, file_content)
|
30
30
|
end
|
31
31
|
|
@@ -45,7 +45,7 @@ Given /^I am not running (?:.*) in the background$/ do
|
|
45
45
|
# no-op
|
46
46
|
end
|
47
47
|
|
48
|
-
Given /^I have environment variable (\w+) set to "([
|
48
|
+
Given /^I have environment variable (\w+) set to "([^"]*)"$/ do |variable, value|
|
49
49
|
set_env_var(variable, value)
|
50
50
|
end
|
51
51
|
|
@@ -84,22 +84,22 @@ Then /^the output should be$/ do |text|
|
|
84
84
|
last_stdout.should == text
|
85
85
|
end
|
86
86
|
|
87
|
-
Then /^"([
|
87
|
+
Then /^"([^"]*)" should contain$/ do |file, text|
|
88
88
|
strip_duration(IO.read(file)).should == text
|
89
89
|
end
|
90
90
|
|
91
|
-
Then /^"([
|
91
|
+
Then /^"([^"]*)" with junit duration "([^"]*)" should contain$/ do |actual_file, duration_replacement, text|
|
92
92
|
actual = IO.read(actual_file)
|
93
93
|
actual = replace_junit_duration(actual, duration_replacement)
|
94
94
|
actual = strip_ruby186_extra_trace(actual)
|
95
95
|
actual.should == text
|
96
96
|
end
|
97
97
|
|
98
|
-
Then /^"([
|
98
|
+
Then /^"([^"]*)" should match "([^"]*)"$/ do |file, text|
|
99
99
|
File.open(file, Cucumber.file_mode('r')).read.should =~ Regexp.new(text)
|
100
100
|
end
|
101
101
|
|
102
|
-
Then /^"([
|
102
|
+
Then /^"([^"]*)" should have the same contents as "([^"]*)"$/ do |actual_file, expected_file|
|
103
103
|
actual = IO.read(actual_file)
|
104
104
|
actual = replace_duration(actual, '0m30.005s')
|
105
105
|
# Comment out to replace expected file. Use with care!
|
@@ -123,16 +123,16 @@ Then /^STDERR should be empty$/ do
|
|
123
123
|
last_stderr.should == ""
|
124
124
|
end
|
125
125
|
|
126
|
-
Then /^"([
|
126
|
+
Then /^"([^"]*)" should exist$/ do |file|
|
127
127
|
File.exists?(file).should be_true
|
128
128
|
FileUtils.rm(file)
|
129
129
|
end
|
130
130
|
|
131
|
-
Then /^"([
|
131
|
+
Then /^"([^"]*)" should not be required$/ do |file_name|
|
132
132
|
last_stdout.should_not include("* #{file_name}")
|
133
133
|
end
|
134
134
|
|
135
|
-
Then /^"([
|
135
|
+
Then /^"([^"]*)" should be required$/ do |file_name|
|
136
136
|
last_stdout.should include("* #{file_name}")
|
137
137
|
end
|
138
138
|
|
@@ -171,7 +171,23 @@ module Cucumber
|
|
171
171
|
def send_to_all(message, *args)
|
172
172
|
@listeners.each do |listener|
|
173
173
|
if listener.respond_to?(message)
|
174
|
-
listener.
|
174
|
+
if listener.respond_to?(:feature_name) &&
|
175
|
+
(listener.method(:feature_name) rescue false) &&
|
176
|
+
listener.method(:feature_name).arity == 1
|
177
|
+
# Legacy
|
178
|
+
case message.to_sym
|
179
|
+
when :feature_name
|
180
|
+
warn("#{listener.class} is using a deprecated formatter API. The signature has changed to :feature_name(keyword, name) # no trailing : in keyword")
|
181
|
+
listener.feature_name("#{args[0]}: #{args[1]}")
|
182
|
+
when :scenario_name, :examples_name
|
183
|
+
warn("#{listener.class} is using a deprecated formatter API. The :scenario_name method does not receive trailing : in keyword")
|
184
|
+
listener.__send__(message, "#{args[0]}:", args[1], args[2], args[3])
|
185
|
+
else
|
186
|
+
listener.__send__(message, *args)
|
187
|
+
end
|
188
|
+
else
|
189
|
+
listener.__send__(message, *args)
|
190
|
+
end
|
175
191
|
end
|
176
192
|
end
|
177
193
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
8
|
+
- 1
|
9
|
+
version: 0.7.1
|
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-05-
|
17
|
+
date: 2010-05-03 00:00:00 +02:00
|
18
18
|
default_executable: cucumber
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -720,7 +720,7 @@ post_install_message: |+
|
|
720
720
|
|
721
721
|
(::) U P G R A D I N G (::)
|
722
722
|
|
723
|
-
Thank you for installing cucumber-0.7.
|
723
|
+
Thank you for installing cucumber-0.7.1.
|
724
724
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
|
725
725
|
for important information about this release. Happy cuking!
|
726
726
|
|