aslakhellesoy-cucumber 0.1.99.2 → 0.1.99.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -10
- data/examples/tickets/features/step_definitons/tickets_steps.rb +7 -0
- data/features/cucumber_cli.feature +3 -1
- data/features/report_called_undefined_steps.feature +1 -0
- data/lib/autotest/cucumber_mixin.rb +1 -0
- data/lib/cucumber/ast/scenario.rb +4 -0
- data/lib/cucumber/ast/step.rb +16 -7
- data/lib/cucumber/cli.rb +1 -1
- data/lib/cucumber/formatters/unicode.rb +1 -1
- data/lib/cucumber/step_definition.rb +1 -1
- data/lib/cucumber/step_mother.rb +1 -1
- data/lib/cucumber/version.rb +1 -1
- data/rails_generators/cucumber/templates/cucumber +2 -1
- metadata +1 -1
data/History.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
== Git (
|
1
|
+
== Git (0.2 alpha)
|
2
2
|
|
3
3
|
This is a major rewrite of Cucumber's internals. The rewrite was done to address technical
|
4
4
|
debt and to have a codebase that is easier to evolve and maintain. There are some major
|
@@ -57,27 +57,34 @@ 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
|
+
* No output for multi-line strings (#71 Aslak Hellesøy)
|
61
|
+
* Fix cucumber/formatters/unicode flaws on Windows (#145 Michael)
|
62
|
+
* Autotest-related Bugs: YAML missing (#136 Tobias Pape)
|
63
|
+
* Overeager "rescue LoadError" hides lots of errors (#137 Jonathan del Strother)
|
60
64
|
* Pending steps in > steps called from steps (#65 Aslak Hellesøy)
|
61
65
|
|
62
66
|
=== New features
|
63
|
-
*
|
64
|
-
*
|
65
|
-
*
|
67
|
+
* Tagging scenarios and features. Pick the ones to run with --tags (#54 Aslak Hellesøy)
|
68
|
+
* Make the current scenario available to the steps. (#44 Aslak Hellesøy)
|
69
|
+
* Step definition snippets contain a 'pending' call (#84 Aslak Hellesøy)
|
70
|
+
* Call multiline steps from other steps (#144 Aslak Hellesøy)
|
71
|
+
* Run cucumber with --autoformat DIR to reformat (pretty print) all of your feature files. (Aslak Hellesøy)
|
72
|
+
* New --strict option exits with an error code if there are undefined or pending steps. (Aslak Hellesøy)
|
66
73
|
* Given, When, Then are automatically aliased to current language.
|
67
74
|
Ruby 1.8 doesn't allow non-ascii method names in the source, so unless you're on 1.9
|
68
75
|
you will have to use Given, When, Then or set up your own aliases. Here is Norwegian:
|
69
|
-
Cucumber.alias_steps(%w{Naar Saa}) # Når, Så already aliased, but can't be called.
|
70
|
-
* Run cucumber --language help to see all supported languages.
|
71
|
-
* Run cucumber --language LANG help to see keywords for a given language.
|
72
|
-
* Multiline arguments (tables and """ strings) are printed in the output
|
73
|
-
* It's no longer necessary to compile the Treetop grammar when adding a new language. Localised parser is generated at runtime.
|
76
|
+
Cucumber.alias_steps(%w{Naar Saa}) # Når, Så already aliased, but can't be called. (Aslak Hellesøy)
|
77
|
+
* Run cucumber --language help to see all supported languages. (Aslak Hellesøy)
|
78
|
+
* Run cucumber --language LANG help to see keywords for a given language. (Aslak Hellesøy)
|
79
|
+
* Multiline arguments (tables and """ strings) are printed in the output. (Aslak Hellesøy)
|
80
|
+
* It's no longer necessary to compile the Treetop grammar when adding a new language. Localised parser is generated at runtime. (Aslak Hellesøy)
|
74
81
|
|
75
82
|
=== Removed features
|
76
83
|
* "GivenScenario" is gone. Instead you can call Steps from Steps, or wait for "Background (#153)"
|
77
84
|
* "More Examples" is gone. "Scenario" + "More Examples" is no longer supported. Use "Scenario Outline" + "Examples" instead.
|
78
85
|
* Pure Ruby features are no longer supported.
|
79
86
|
|
80
|
-
== 0.1.16
|
87
|
+
== 0.1.16
|
81
88
|
|
82
89
|
Bugfix release.
|
83
90
|
|
@@ -4,6 +4,12 @@ World do
|
|
4
4
|
Object.new
|
5
5
|
end
|
6
6
|
|
7
|
+
After do |scenario|
|
8
|
+
if scenario.status.index(:failed)
|
9
|
+
# Call the BDD police
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
7
13
|
Given "be_empty" do
|
8
14
|
[1,2].should_not be_empty
|
9
15
|
end
|
@@ -16,6 +22,7 @@ Given "nested step is called" do
|
|
16
22
|
end
|
17
23
|
|
18
24
|
Given 'nested step is called using text table' do
|
25
|
+
pending
|
19
26
|
Given "I like mushroom", table(%{
|
20
27
|
| sponge | bob |
|
21
28
|
| is | cool |
|
@@ -28,9 +28,11 @@ Feature: Cucumber command line
|
|
28
28
|
@two @three
|
29
29
|
Scenario: Missing
|
30
30
|
Given missing
|
31
|
+
Undefined step: "missing" (Cucumber::StepMother::Undefined)
|
32
|
+
features/sample.feature:6:in `Given missing'
|
31
33
|
|
32
34
|
1 scenario
|
33
|
-
1
|
35
|
+
1 failed step
|
34
36
|
|
35
37
|
"""
|
36
38
|
|
data/lib/cucumber/ast/step.rb
CHANGED
@@ -82,14 +82,17 @@ module Cucumber
|
|
82
82
|
else
|
83
83
|
@status = :skipped
|
84
84
|
end
|
85
|
-
rescue StepMother::Undefined
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
rescue StepMother::Undefined => exception
|
86
|
+
if visitor.options[:strict]
|
87
|
+
exception.set_backtrace([])
|
88
|
+
failed(exception)
|
89
|
+
else
|
90
|
+
@status = :undefined
|
91
|
+
end
|
92
|
+
rescue StepMother::Pending => exception
|
93
|
+
visitor.options[:strict] ? failed(exception) : @status = :pending
|
89
94
|
rescue Exception => exception
|
90
|
-
|
91
|
-
@exception = exception
|
92
|
-
@exception.backtrace << backtrace_line unless backtrace_line.nil?
|
95
|
+
failed(exception)
|
93
96
|
end
|
94
97
|
@scenario.step_executed(self) if @scenario
|
95
98
|
end
|
@@ -125,6 +128,12 @@ module Cucumber
|
|
125
128
|
arg.arguments_replaced(arguments)
|
126
129
|
end
|
127
130
|
end
|
131
|
+
|
132
|
+
def failed(exception)
|
133
|
+
@status = :failed
|
134
|
+
@exception = exception
|
135
|
+
@exception.backtrace << backtrace_line unless backtrace_line.nil?
|
136
|
+
end
|
128
137
|
end
|
129
138
|
end
|
130
139
|
end
|
data/lib/cucumber/cli.rb
CHANGED
@@ -13,7 +13,7 @@ module Cucumber
|
|
13
13
|
class StepDefinition
|
14
14
|
def self.snippet_text(step_keyword, step_name)
|
15
15
|
escaped = Regexp.escape(step_name).gsub('\ ', ' ').gsub('/', '\/')
|
16
|
-
"#{step_keyword} /^#{escaped}$/ do\nend"
|
16
|
+
"#{step_keyword} /^#{escaped}$/ do\n pending\nend"
|
17
17
|
end
|
18
18
|
|
19
19
|
class MissingProc < StandardError
|
data/lib/cucumber/step_mother.rb
CHANGED
data/lib/cucumber/version.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
begin
|
3
3
|
load File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/cucumber/bin/cucumber")
|
4
|
-
rescue LoadError
|
4
|
+
rescue LoadError => e
|
5
|
+
raise unless e.to_s =~ /cucumber/
|
5
6
|
require "rubygems"
|
6
7
|
load File.join(Gem.bindir, "cucumber")
|
7
8
|
end
|