summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/delegate/delegator/equal_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/delegate/delegator/equal_spec.rb')
-rw-r--r--spec/rubyspec/library/delegate/delegator/equal_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/rubyspec/library/delegate/delegator/equal_spec.rb b/spec/rubyspec/library/delegate/delegator/equal_spec.rb
new file mode 100644
index 0000000000..9333d6a303
--- /dev/null
+++ b/spec/rubyspec/library/delegate/delegator/equal_spec.rb
@@ -0,0 +1,13 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "Delegator#equal?" do
+ it "returns true only when compared with the delegator" do
+ obj = mock('base')
+ delegator = DelegateSpecs::Delegator.new(obj)
+ obj.should_not_receive(:equal?)
+ delegator.equal?(obj).should be_false
+ delegator.equal?(nil).should be_false
+ delegator.equal?(delegator).should be_true
+ end
+end