summaryrefslogtreecommitdiff
path: root/test/ruby/test_shapes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_shapes.rb')
-rw-r--r--test/ruby/test_shapes.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb
index 591fdbe4a3..7849ca546b 100644
--- a/test/ruby/test_shapes.rb
+++ b/test/ruby/test_shapes.rb
@@ -5,6 +5,8 @@ require 'json'
# These test the functionality of object shapes
class TestShapes < Test::Unit::TestCase
+ MANY_IVS = 80
+
class IVOrder
def expected_ivs
%w{ @a @b @c @d @e @f @g @h @i @j @k }
@@ -149,7 +151,7 @@ class TestShapes < Test::Unit::TestCase
def test_too_many_ivs_on_class
obj = Class.new
- (RubyVM::Shape::SHAPE_MAX_NUM_IVS + 1).times do
+ (MANY_IVS + 1).times do
obj.instance_variable_set(:"@a#{_1}", 1)
end
@@ -159,10 +161,10 @@ class TestShapes < Test::Unit::TestCase
def test_removing_when_too_many_ivs_on_class
obj = Class.new
- (RubyVM::Shape::SHAPE_MAX_NUM_IVS + 2).times do
+ (MANY_IVS + 2).times do
obj.instance_variable_set(:"@a#{_1}", 1)
end
- (RubyVM::Shape::SHAPE_MAX_NUM_IVS + 2).times do
+ (MANY_IVS + 2).times do
obj.remove_instance_variable(:"@a#{_1}")
end
@@ -172,10 +174,10 @@ class TestShapes < Test::Unit::TestCase
def test_removing_when_too_many_ivs_on_module
obj = Module.new
- (RubyVM::Shape::SHAPE_MAX_NUM_IVS + 2).times do
+ (MANY_IVS + 2).times do
obj.instance_variable_set(:"@a#{_1}", 1)
end
- (RubyVM::Shape::SHAPE_MAX_NUM_IVS + 2).times do
+ (MANY_IVS + 2).times do
obj.remove_instance_variable(:"@a#{_1}")
end