vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb in spree-0.2.0 vs vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb in spree-0.4.0
- old
+ new
@@ -8,10 +8,15 @@
subject = "apple"
subject.should_receive(:==).with("apple").and_return(true)
subject.should == "apple"
end
+ it "should return true on success" do
+ subject = "apple"
+ (subject.should == "apple").should be_true
+ end
+
it "should fail when target.==(actual) returns false" do
subject = "apple"
Spec::Expectations.should_receive(:fail_with).with(%[expected: "orange",\n got: "apple" (using ==)], "orange", "apple")
subject.should == "orange"
end
@@ -24,15 +29,20 @@
subject = "orange"
subject.should_receive(:==).with("apple").and_return(false)
subject.should_not == "apple"
end
+ it "should return true on success" do
+ subject = "apple"
+ (subject.should_not == "orange").should be_true
+ end
+
it "should fail when target.==(actual) returns false" do
subject = "apple"
Spec::Expectations.should_receive(:fail_with).with(%[expected not: == "apple",\n got: "apple"], "apple", "apple")
subject.should_not == "apple"
end
-
+
end
describe "should ===" do
it "should delegate message to target" do