spec/spec/expectations/fail_with_spec.rb in rspec-1.2.6 vs spec/spec/expectations/fail_with_spec.rb in rspec-1.2.7

- old
+ new

@@ -62,10 +62,27 @@ @differ.should_not_receive(:diff_as_object) lambda { Spec::Expectations.fail_with "the message", lambda {}, lambda {} }.should fail_with("the message") end - + + after(:each) do + Spec::Expectations.differ = @old_differ + end +end + +describe Spec::Expectations, "#fail_with with a nil message" do + before(:each) do + @old_differ = Spec::Expectations.differ + Spec::Expectations.differ = nil + end + + it "should handle just a message" do + lambda { + Spec::Expectations.fail_with nil + }.should raise_error(ArgumentError, /Failure message is nil\. Does your matcher define the appropriate failure_message_for_\* method to return a string\?/) + end + after(:each) do Spec::Expectations.differ = @old_differ end end