spec/bogus/stubbing/shadow_spec.rb in bogus-0.1.5 vs spec/bogus/stubbing/shadow_spec.rb in bogus-0.1.6
- old
+ new
@@ -9,16 +9,16 @@
before do
shadow.run(:foo, "a", "b") rescue nil # for when the method raises an error
end
it "returns the called methods" do
- expect(shadow.has_received(:foo, ["a", "b"])).to be_true
+ expect(shadow.has_received(:foo, ["a", "b"])).to be(true)
end
it "does not return true for interactions that did not happen" do
- expect(shadow.has_received(:foo, ["a", "c"])).to be_false
- expect(shadow.has_received(:bar, ["a", "c"])).to be_false
+ expect(shadow.has_received(:foo, ["a", "c"])).to be(false)
+ expect(shadow.has_received(:bar, ["a", "c"])).to be(false)
end
end
end
context "unrecorded interactions" do
@@ -79,11 +79,11 @@
end
it "allows spying on calls using any args" do
shadow.run(:foo, "a", "c")
- expect(shadow.has_received(:foo, [Bogus::AnyArgs])).to be_true
+ expect(shadow.has_received(:foo, [Bogus::AnyArgs])).to be(true)
end
end
context "interactions that take anything" do
before do
@@ -101,11 +101,11 @@
end
it "allows spying on calls using anything in args" do
shadow.run(:foo, "a", "b")
- expect(shadow.has_received(:foo, [Bogus::Anything, "b"])).to be_true
+ expect(shadow.has_received(:foo, [Bogus::Anything, "b"])).to be(true)
end
end
context "stubbed interactions" do
before do
@@ -175,10 +175,10 @@
expect(shadow.run(:foo, "a", "c")).to be_a_default_return_value
end
it "contributes towards unsatisfied interactions" do
interactions = shadow.unsatisfied_interactions
- expect(interactions).to have(1).item
+ expect(interactions.size).to eq(1)
expect(interactions.first.method).to eq(:foo)
expect(interactions.first.args).to eq(["a", "b"])
end
it "removes the staisfied expectations from unsatisfied interactions" do