spec/cucumber/step_mother_spec.rb in aslakhellesoy-cucumber-0.2.2.1 vs spec/cucumber/step_mother_spec.rb in aslakhellesoy-cucumber-0.2.2.2
- old
+ new
@@ -17,19 +17,35 @@
end
format = @step_mother.step_match("it snows in april").format_args("[%s]")
format.should == "it [snows] in [april]"
end
- it "should raise Ambiguous error when multiple step definitions match" do
+ it "should raise Ambiguous error with guess hint when multiple step definitions match" do
@step_mother.Given(/Three (.*) mice/) {|disability|}
@step_mother.Given(/Three blind (.*)/) {|animal|}
lambda do
@step_mother.step_match("Three blind mice")
end.should raise_error(Ambiguous, %{Ambiguous match of "Three blind mice":
spec/cucumber/step_mother_spec.rb:23:in `/Three (.*) mice/'
spec/cucumber/step_mother_spec.rb:24:in `/Three blind (.*)/'
+
+You can run again with --guess to make Cucumber be more smart about it
+})
+ end
+
+ it "should not show --guess hint when --guess is used" do
+ @step_mother.options = {:guess => true}
+ @step_mother.Given(/Three (.*) mice/) {|disability|}
+ @step_mother.Given(/Three cute (.*)/) {|animal|}
+
+ lambda do
+ @step_mother.step_match("Three cute mice")
+ end.should raise_error(Ambiguous, %{Ambiguous match of "Three cute mice":
+
+spec/cucumber/step_mother_spec.rb:39:in `/Three (.*) mice/'
+spec/cucumber/step_mother_spec.rb:40:in `/Three cute (.*)/'
})
end
it "should not raise Ambiguous error when multiple step definitions match, but --guess is enabled" do