step_master 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/step_master/matcher.rb +2 -2
- data/lib/step_master/step_item.rb +1 -1
- data/lib/step_master.rb +1 -1
- data/spec/step_helper/matcher_spec.rb +39 -10
- metadata +1 -1
data/History.txt
CHANGED
data/lib/step_master/matcher.rb
CHANGED
data/lib/step_master.rb
CHANGED
@@ -74,7 +74,17 @@ module StepMaster
|
|
74
74
|
it "should match \"Given I want \"123\"\"" do
|
75
75
|
@matcher.is_match?("Given I want \"!@@\"").should be_true
|
76
76
|
end
|
77
|
-
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "with step with a comment" do
|
80
|
+
before :each do
|
81
|
+
@matcher << %q~Given /^this$/i do |name| # This is a comment~
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should correctly match" do
|
85
|
+
@matcher.is_match?("Given this").should be_true
|
86
|
+
end
|
87
|
+
end
|
78
88
|
end
|
79
89
|
|
80
90
|
|
@@ -284,7 +294,7 @@ module StepMaster
|
|
284
294
|
|
285
295
|
|
286
296
|
|
287
|
-
describe "with
|
297
|
+
describe "with step with a comment" do
|
288
298
|
before :each do
|
289
299
|
@matcher << %q~Given /^this$/i do |name| # This is a comment~
|
290
300
|
end
|
@@ -292,20 +302,39 @@ module StepMaster
|
|
292
302
|
it "should correctly auto-complete" do
|
293
303
|
@matcher.complete("Given").should have(1).result
|
294
304
|
end
|
295
|
-
|
296
|
-
|
297
|
-
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
308
|
+
describe "#where_is?" do
|
309
|
+
describe "with step with a comment" do
|
310
|
+
before :each do
|
311
|
+
@matcher << %q~Given /^this$/i do |name| # This is a comment~
|
298
312
|
end
|
299
313
|
|
300
314
|
it "should return the original line with where_is?" do
|
301
315
|
@matcher.where_is?("Given this").should include(%q~Given /^this$/i do |name| # This is a comment~)
|
302
316
|
end
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
describe Matcher do
|
322
|
+
describe "swith a pre-parsed match table" do
|
307
323
|
|
324
|
+
before :each do
|
325
|
+
p = Possible.new
|
326
|
+
p[si = StepItem.new("Given")] = Possible.new
|
327
|
+
p[si][si2 = StepItem.new(" ")] = Possible.new()
|
328
|
+
(p[si][si2][StepItem.new("this")] = Possible.new()).terminal!("Given this")
|
329
|
+
|
330
|
+
@matcher = Matcher.new(p)
|
331
|
+
end
|
308
332
|
|
309
|
-
|
333
|
+
it "should be able to perform a simple match" do
|
334
|
+
@matcher.is_match?("Given this").should be_true
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
310
338
|
end
|
339
|
+
|
311
340
|
end
|