vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb in spree-0.5.1 vs vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb in spree-0.6.0
- old
+ new
@@ -18,11 +18,11 @@
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
-
+
end
describe "should_not ==" do
it "should delegate message to target" do
@@ -164,5 +164,28 @@
4.should <= 3
end
end
+describe Spec::Matchers::PositiveOperatorMatcher do
+
+ it "should work when the target has implemented #send" do
+ o = Object.new
+ def o.send(*args); raise "DOH! Library developers shouldn't use #send!" end
+ lambda {
+ o.should == o
+ }.should_not raise_error
+ end
+
+end
+
+describe Spec::Matchers::NegativeOperatorMatcher do
+
+ it "should work when the target has implemented #send" do
+ o = Object.new
+ def o.send(*args); raise "DOH! Library developers shouldn't use #send!" end
+ lambda {
+ o.should_not == :foo
+ }.should_not raise_error
+ end
+
+end