features/safe_stubbing/spies.feature in bogus-0.1.4 vs features/safe_stubbing/spies.feature in bogus-0.1.5
- old
+ new
@@ -41,12 +41,12 @@
it "studies using books from library" do
student = Student.new(library)
student.study("Moby Dick", "Sherlock Holmes")
- library.should have_received.checkout("Moby Dick")
- library.should have_received.checkout("Sherlock Holmes")
+ expect(library).to have_received.checkout("Moby Dick")
+ expect(library).to have_received.checkout("Sherlock Holmes")
end
end
"""
Scenario: Spying on methods that do not exist
@@ -61,11 +61,11 @@
it "studies using books from library" do
student = Student.new(library)
student.study("Moby Dick")
- library.should_not have_received.return_book("Moby Dick")
+ expect(library).not_to have_received.return_book("Moby Dick")
end
end
"""
Scenario: Spying on methods with wrong number of arguments
@@ -80,11 +80,11 @@
it "studies using books from library" do
student = Student.new(library)
student.study("Moby Dick", "Sherlock Holmes")
- library.should_not have_received.checkout("Moby Dick",
+ expect(library).not_to have_received.checkout("Moby Dick",
"Sherlock Holmes")
end
end
"""
@@ -98,13 +98,13 @@
fake(:library)
it "studies using books from library" do
stub(library).checkout("Moby Dick") { "checked out" }
- library.checkout("Moby Dick").should == "checked out"
+ expect(library.checkout("Moby Dick")).to eq("checked out")
- library.should have_received.checkout("Moby Dick")
+ expect(library).to have_received.checkout("Moby Dick")
end
end
"""
Scenario: Spying on attribute writers
@@ -136,9 +136,9 @@
fake(:canvas)
it "sets the background to red" do
Popup.alert("No such file!", canvas)
- canvas.should have_received(:background_color=, "red")
+ expect(canvas).to have_received(:background_color=, "red")
end
end
"""