@@ -96,14 +96,14 @@ def baz_class_method; end
9696
9797 def test_print_constants
9898 rbi = Tree . new
99- rbi << Const . new ( "Foo" , "42 ")
100- rbi << Const . new ( "Bar" , "'foo'" )
101- rbi << Const . new ( "Baz" , "Bar" )
99+ rbi << Const . new ( "Foo" , type : "Integer ")
100+ rbi << Const . new ( "Bar" , type : Type . boolean )
101+ rbi << Const . new ( "Baz" )
102102
103103 assert_equal ( <<~RBI , rbi . string )
104- Foo = 42
105- Bar = 'foo'
106- Baz = Bar
104+ Foo = T.let(T.unsafe(nil), Integer)
105+ Bar = T.let(T.unsafe(nil), T::Boolean)
106+ Baz = T.unsafe(nil)
107107 RBI
108108 end
109109
@@ -300,9 +300,9 @@ def foo; end
300300 def test_print_t_enums
301301 rbi = TEnum . new ( "Foo" )
302302 block = TEnumBlock . new
303- block << Const . new ( "A" , "new" )
304- block << Const . new ( "B" , "new" )
305- block << Const . new ( "C" , "new ")
303+ block << Const . new ( "A" )
304+ block << Const . new ( "B" )
305+ block << Const . new ( "C" , type : "Integer ")
306306 block << Method . new ( "bar" )
307307 rbi << block
308308 rbi << Method . new ( "baz" )
@@ -312,7 +312,7 @@ class Foo < T::Enum
312312 enums do
313313 A = new
314314 B = new
315- C = new
315+ C = T.let(T.unsafe(nil), Integer)
316316 def bar; end
317317 end
318318
@@ -401,7 +401,7 @@ def test_print_nodes_with_comments
401401 rbi << Module . new ( "Foo" , comments : comments_single )
402402 rbi << Class . new ( "Bar" , comments : comments_multi )
403403 rbi << SingletonClass . new ( comments : comments_single )
404- rbi << Const . new ( "Foo" , "42" , comments : comments_multi )
404+ rbi << Const . new ( "Foo" , comments : comments_multi )
405405 rbi << Include . new ( "A" , comments : comments_single )
406406 rbi << Extend . new ( "A" , comments : comments_multi )
407407
@@ -418,8 +418,8 @@ def test_print_nodes_with_comments
418418
419419 enum = TEnum . new ( "Foo" , comments : comments_multi )
420420 enum << TEnumBlock . new ( comments : comments_single ) do |block |
421- block << Const . new ( "A" , "new" )
422- block << Const . new ( "B" , "new" )
421+ block << Const . new ( "A" )
422+ block << Const . new ( "B" )
423423 end
424424
425425 rbi << enum
@@ -442,7 +442,7 @@ class << self; end
442442
443443 # This is a
444444 # Multiline Comment
445- Foo = 42
445+ Foo = T.unsafe(nil)
446446
447447 # This is a single line comment
448448 include A
@@ -1092,7 +1092,7 @@ def test_print_nodes_locations
10921092 rbi << SingletonClass . new ( loc : loc )
10931093 rbi << TEnum . new ( "TE" , loc : loc )
10941094 rbi << TStruct . new ( "TS" , loc : loc )
1095- rbi << Const . new ( "C" , "42" , loc : loc )
1095+ rbi << Const . new ( "C" , loc : loc )
10961096 rbi << Extend . new ( "E" , loc : loc )
10971097 rbi << Include . new ( "I" , loc : loc )
10981098 rbi << Send . new ( "foo" , loc : loc )
@@ -1114,7 +1114,7 @@ class TE < T::Enum; end
11141114 # file.rbi:1:3-2:4
11151115 class TS < T::Struct; end
11161116 # file.rbi:1:3-2:4
1117- C = 42
1117+ C = T.unsafe(nil)
11181118 # file.rbi:1:3-2:4
11191119 extend E
11201120 # file.rbi:1:3-2:4
0 commit comments