Skip to content

Commit dd819a0

Browse files
valichviuginick1
authored andcommitted
expect actual Fixnum/Integer class name as answer
1 parent 9b2a4de commit dd819a0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

test-base/variables_test.rb

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_variable_in_object
4747
{:name => "self", :value => "test", :type => "Test", :hasChildren => true})
4848
send_ruby("v i self")
4949
assert_variables(read_variables, 1,
50-
{:name => "@y", :value => "5", :type => "Fixnum", :hasChildren => false, :kind => "instance"})
50+
{:name => "@y", :value => "5", :type => int_type_name, :hasChildren => false, :kind => "instance"})
5151
send_cont
5252
end
5353

@@ -60,7 +60,7 @@ def test_class_variables
6060
{:name => "self", :hasChildren => true})
6161
send_ruby("v i self")
6262
assert_variables(read_variables, 1,
63-
{:name => "@@class_var", :value => "55", :type => "Fixnum", :kind => "class"})
63+
{:name => "@@class_var", :value => "55", :type => int_type_name, :kind => "class"})
6464
send_cont
6565
end
6666

@@ -70,7 +70,7 @@ def test_singleton_class_variables
7070
run_to_line(3)
7171
send_ruby("v i self")
7272
assert_variables(read_variables, 1,
73-
{:name => "@@class_var", :value => "55", :type => "Fixnum", :hasChildren => false, :kind => "class"})
73+
{:name => "@@class_var", :value => "55", :type => int_type_name, :hasChildren => false, :kind => "class"})
7474
send_cont
7575
end
7676

@@ -95,7 +95,7 @@ def test_variable_local
9595
assert_not_nil variables[1].objectId
9696
send_ruby("v i " + variables[1].objectId) # 'user' variable
9797
assert_variables(read_variables, 1,
98-
{:name => "@id", :value => "22", :type => "Fixnum", :hasChildren => false})
98+
{:name => "@id", :value => "22", :type => int_type_name, :hasChildren => false})
9999
send_cont
100100
end
101101

@@ -107,7 +107,7 @@ def test_variable_instance
107107
frame_number -= 1 if Debugger::FRONT_END == "debase"
108108
send_ruby("frame #{frame_number}; v i custom_object")
109109
assert_variables(read_variables, 1,
110-
{:name => "@y", :value => "5", :type => "Fixnum", :hasChildren => false})
110+
{:name => "@y", :value => "5", :type => int_type_name, :hasChildren => false})
111111
send_cont
112112
end
113113

@@ -119,7 +119,7 @@ def test_variable_array
119119
{:name => "array", :type => "Array", :hasChildren => true})
120120
send_ruby("v i array")
121121
assert_variables(read_variables, 2,
122-
{:name => "[0]", :value => "1", :type => "Fixnum"})
122+
{:name => "[0]", :value => "1", :type => int_type_name})
123123
send_cont
124124
end
125125

@@ -152,7 +152,7 @@ def test_variable_hash_with_object_keys
152152
# get the value
153153
send_ruby("frame 1 ; v i " + elements[0].objectId)
154154
assert_variables(read_variables, 1,
155-
{:name => "@a", :value => "66", :type => "Fixnum"})
155+
{:name => "@a", :value => "66", :type => int_type_name})
156156
send_cont
157157
end
158158

@@ -179,7 +179,7 @@ def test_non_string_from_to_s
179179
create_socket ["class BugExample; def to_s; 1; end; end", "b = BugExample.new", "sleep 0.01"]
180180
run_to_line(3)
181181
send_ruby("v local")
182-
assert_variables(read_variables, 1, {:value => "ERROR: BugExample.to_s method returns Fixnum. Should return String."})
182+
assert_variables(read_variables, 1, {:value => "ERROR: BugExample.to_s method returns #{int_type_name}. Should return String."})
183183
send_cont
184184
end
185185

@@ -261,5 +261,11 @@ def assert_variables(vars, count, *expected)
261261
end
262262
end
263263

264+
private
265+
266+
def int_type_name
267+
(Fixnum || Integer).name
268+
end
269+
264270
end
265271

0 commit comments

Comments
 (0)