aslakhellesoy-cucumber 0.3.102.1 → 0.3.102.2
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 +3 -0
- data/examples/java/README.textile +3 -3
- data/lib/cucumber/rb_support/regexp_argument_matcher.rb +2 -1
- data/lib/cucumber/step_match.rb +1 -0
- data/lib/cucumber/version.rb +1 -1
- data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +5 -0
- data/spec/cucumber/step_match_spec.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
|
@@ -10,6 +10,9 @@ Using this release on a Rails project requires a rerun of script/generate cucumb
|
|
|
10
10
|
* Added back a way to globally turn off transactions.
|
|
11
11
|
* Renamed @allow_rescue tag to @allow-rescue.
|
|
12
12
|
|
|
13
|
+
=== Bugfixes
|
|
14
|
+
* Gracefully handle cases when optional regexp groups are not matched. Ex: /should( not)? be flashed '([^']*?)'$/ (Aslak Hellesøy)
|
|
15
|
+
|
|
13
16
|
== 2009-09-22
|
|
14
17
|
|
|
15
18
|
This release has some changes in the Rails support, so make sure you run "script/generate cucumber" after you upgrade.
|
|
@@ -11,8 +11,8 @@ h2. Running the scenarios
|
|
|
11
11
|
|
|
12
12
|
Open a shell in this directory (java) and execute the following command:
|
|
13
13
|
|
|
14
|
-
<pre
|
|
15
|
-
ant
|
|
16
|
-
</code></pre>
|
|
14
|
+
<pre>ant</pre>
|
|
17
15
|
|
|
18
16
|
There is a deliberate error. See if you can fix it!
|
|
17
|
+
|
|
18
|
+
Also see "Cuke4Duke":http://wiki.github.com/aslakhellesoy/cuke4duke for more powerful JVM and Java support for Cucumber.
|
data/lib/cucumber/step_match.rb
CHANGED
data/lib/cucumber/version.rb
CHANGED
|
@@ -8,6 +8,11 @@ module Cucumber
|
|
|
8
8
|
arguments = RegexpArgumentMatcher.arguments_from(/I (\w+) (\w+)/, "I like fish")
|
|
9
9
|
arguments.map{|argument| [argument.val, argument.pos]}.should == [["like", 2], ["fish", 7]]
|
|
10
10
|
end
|
|
11
|
+
|
|
12
|
+
it "should create 2 arguments when first group is optional" do
|
|
13
|
+
arguments = RegexpArgumentMatcher.arguments_from(/should( not)? be flashed '([^']*?)'$/, "I should be flashed 'Login failed.'")
|
|
14
|
+
arguments.map{|argument| [argument.val, argument.pos]}.should == [[nil, nil], ["Login failed.", 21]]
|
|
15
|
+
end
|
|
11
16
|
end
|
|
12
17
|
end
|
|
13
18
|
end
|
|
@@ -31,5 +31,10 @@ module Cucumber
|
|
|
31
31
|
m = stepdef(/I (\w+) (\d+) (\w+) this (\w+)/).step_match("I ate 1 egg this morning", nil)
|
|
32
32
|
m.format_args(lambda{|m| "<span>#{m}</span>"}).should == "I <span>ate</span> <span>1</span> <span>egg</span> this <span>morning</span>"
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
it "should format groups even when first group is optional and not matched" do
|
|
36
|
+
m = stepdef(/should( not)? be flashed '([^']*?)'$/).step_match("I should be flashed 'Login failed.'", nil)
|
|
37
|
+
m.format_args("<span>%s</span>").should == "I should be flashed '<span>Login failed.</span>'"
|
|
38
|
+
end
|
|
34
39
|
end
|
|
35
40
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aslakhellesoy-cucumber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.102.
|
|
4
|
+
version: 0.3.102.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "Aslak Helles\xC3\xB8y"
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-09-
|
|
12
|
+
date: 2009-09-24 00:00:00 -07:00
|
|
13
13
|
default_executable: cucumber
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|