summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--range.c8
-rw-r--r--test/ruby/test_range.rb3
2 files changed, 3 insertions, 8 deletions
diff --git a/range.c b/range.c
index dbb3dcb..5897557 100644
--- a/range.c
+++ b/range.c
@@ -988,18 +988,10 @@ rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
}
else {
VALUE x;
-#if 0
- /* TODO: fix spec/mspec/lib/mspec/mocks/mock.rb:Mock.verify_call */
b = rb_check_funcall(range, id_beg, 0, 0);
if (b == Qundef) return (int)Qfalse;
e = rb_check_funcall(range, id_end, 0, 0);
if (e == Qundef) return (int)Qfalse;
-#else
- if (!rb_respond_to(range, id_beg)) return (int)Qfalse;
- if (!rb_respond_to(range, id_end)) return (int)Qfalse;
- b = rb_funcall(range, id_beg, 0);
- e = rb_funcall(range, id_end, 0);
-#endif
x = rb_check_funcall(range, rb_intern("exclude_end?"), 0, 0);
if (x == Qundef) return (int)Qfalse;
excl = RTEST(x);
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 5823810..77d026c 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -393,6 +393,9 @@ class TestRange < Test::Unit::TestCase
o.exclude_end = false
assert_nil([0][o])
assert_raise(RangeError) { [0][o] = 1 }
+ class << o
+ private :begin, :end
+ end
o.begin = 10
o.end = 10
assert_nil([0][o])