Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/dchelimsky/rspec.git
Search Repo:
Click here to lend your support to: rspec and make a donation at www.pledgie.com !
Steps match properly when containing two params sharing a prefix
pat-maddox (author)
Sat Jul 19 00:32:15 -0700 2008
commit  134c0f94e94f89938a941af5d74d9b303036fe08
tree    be97dbb305b45ba4520506867d70622154461625
parent  d84231200d1b09ed4d21c82487a6bf4cc29509f6
...
60
61
62
63
 
64
65
66
...
60
61
62
 
63
64
65
66
0
@@ -60,7 +60,7 @@ module Spec
0
           expression = string_or_regexp.source
0
         end
0
         while expression =~ PARAM_PATTERN
0
- expression.gsub!($2, "(.*?)")
0
+ expression.sub!($2, "(.*?)")
0
         end
0
         @expression = Regexp.new("\\A#{expression}\\Z", Regexp::MULTILINE)
0
       end
...
32
33
34
 
 
 
 
 
35
36
37
...
32
33
34
35
36
37
38
39
40
41
42
0
@@ -32,6 +32,11 @@ module Spec
0
         step = Step.new("1 $one 2 $two 3 $three 4") {}
0
         step.matches?("1 a 2 b 3 c 4").should be_true
0
       end
0
+
0
+ it "should match a text string with two params sharing a prefix" do
0
+ step = Step.new("I am cool $n times out of $n_total")
0
+ step.matches?("I am cool 3 times out of 7").should be_true
0
+ end
0
       
0
       it "should match a text string with a param at the beginning" do
0
         step = Step.new("$one 2 3") {}

Comments

    No one has commented yet.