summaryrefslogtreecommitdiff
path: root/test/test_delegate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_delegate.rb')
-rw-r--r--test/test_delegate.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_delegate.rb b/test/test_delegate.rb
index 6448ef90ddc..58fefea6083 100644
--- a/test/test_delegate.rb
+++ b/test/test_delegate.rb
@@ -154,4 +154,18 @@ class TestDelegateClass < Test::Unit::TestCase
end.new(Object.new)
assert_equal("foo", d.send(:foo))
end
+
+ def test_unset_simple_delegator
+ d = SimpleDelegator.allocate
+ assert_raise_with_message(ArgumentError, /not delegated/) {
+ d.__getobj__
+ }
+ end
+
+ def test_unset_delegate_class
+ d = IV.allocate
+ assert_raise_with_message(ArgumentError, /not delegated/) {
+ d.__getobj__
+ }
+ end
end