summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2012-10-22 11:36:30 +0100
committerLee Jarvis <ljjarvis@gmail.com>2012-10-22 11:36:30 +0100
commit0d85842fe8accd56c1ae6890292aec651f6c46ee (patch)
tree66d37a5b292953c160129c2f3e41270d4fe2d827 /test
parent47066d91e2fe624c7e3f3e348b2f21fd7d723243 (diff)
parent47521267779dcf44da533b2a14da7b4006f6f7ac (diff)
downloadslop-0d85842fe8accd56c1ae6890292aec651f6c46ee.tar.gz
Merge branch 'master' of github.com:injekt/slop
Conflicts: test/slop_test.rb
Diffstat (limited to 'test')
-rw-r--r--test/slop_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index a984803..36054be 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -418,4 +418,22 @@ class SlopTest < TestCase
assert Slop.new.private_methods.map(&:to_sym).include?(:method_missing)
end
+ test "respond_to?() arity checker is similar of other objects" do
+ slop = Slop.new
+ obj = Object.new
+
+ assert_same obj.respond_to?(:__id__), slop.respond_to?(:__id__)
+ assert_same obj.respond_to?(:__id__, false), slop.respond_to?(:__id__, false)
+ assert_same obj.respond_to?(:__id__, true), slop.respond_to?(:__id__, true)
+
+ exeption = begin
+ obj.respond_to? :__id__, false, :INVALID_ARGUMENT
+ rescue Exception
+ $!
+ end
+ assert_raises exeption.class do
+ slop.respond_to? :__id__, false, :INVALID_ARGUMENT
+ end
+ end
+
end