spec/macros4cuke/macro-step_spec.rb in macros4cuke-0.3.00 vs spec/macros4cuke/macro-step_spec.rb in macros4cuke-0.3.01

- old
+ new

@@ -89,10 +89,25 @@ And I click "Submit" SNIPPET text.should == expectation end + + it "should un-escape the double-quotes for phrase arguments" do + specific_phrase = %q|enter my credentials as "quotable\""| + text = subject.expand(specific_phrase, [ ['password', 'no-secret'] ]) + expectation = <<-SNIPPET + Given I landed in the homepage + When I click "Sign in" + And I fill in "Username" with "quotable"" + And I fill in "Password" with "no-secret" + And I click "Submit" +SNIPPET + text.should == expectation + end + + it "should complain when an unknown variable is used" do # Error case: there is no macro argument called <unknown> error_message = "Unknown macro-step argument 'unknown'." lambda { subject.expand(phrase_instance, [ ['unknown', 'anything'] ]) }.should raise_error(UnknownArgumentError, error_message) end \ No newline at end of file