spec/spec/matchers/respond_to_spec.rb in rspec-1.1.5 vs spec/spec/matchers/respond_to_spec.rb in rspec-1.1.6
- old
+ new
@@ -6,12 +6,12 @@
Object.new.should respond_to(:methods)
end
it "should fail target does not respond to :sym" do
lambda {
- Object.new.should respond_to(:some_method)
- }.should fail_with("expected target to respond to :some_method")
+ "this string".should respond_to(:some_method)
+ }.should fail_with("expected \"this string\" to respond to :some_method")
end
end
describe "should respond_to(message1, message2)" do
@@ -21,23 +21,23 @@
end
it "should fail target does not respond to first message" do
lambda {
Object.new.should respond_to('method_one', 'inspect')
- }.should fail_with('expected target to respond to "method_one"')
+ }.should fail_with(/expected #<Object:.*> to respond to "method_one"/)
end
it "should fail target does not respond to second message" do
lambda {
Object.new.should respond_to('inspect', 'method_one')
- }.should fail_with('expected target to respond to "method_one"')
+ }.should fail_with(/expected #<Object:.*> to respond to "method_one"/)
end
it "should fail target does not respond to either message" do
lambda {
Object.new.should respond_to('method_one', 'method_two')
- }.should fail_with('expected target to respond to "method_one", "method_two"')
+ }.should fail_with(/expected #<Object:.*> to respond to "method_one", "method_two"/)
end
end
describe "should_not respond_to(:sym)" do
@@ -46,9 +46,9 @@
end
it "should fail target responds to :sym" do
lambda {
Object.new.should_not respond_to(:methods)
- }.should fail_with("expected target not to respond to :methods")
+ }.should fail_with(/expected #<Object:.*> not to respond to :methods/)
end
end