@@ -26,7 +26,8 @@ Feature: None
26
26
def autorescue
27
27
yield
28
28
rescue => e
29
- puts e.inspect
29
+ # Since ruby 3.2 the `#inspect` output becomes a bit different
30
+ puts e.inspect.gsub(/^#</, "").gsub(/Error:\"/, "Error: ")
30
31
end
31
32
"""
32
33
Given a file named "none_usage.rb" with:
@@ -42,6 +43,11 @@ Feature: None
42
43
def self.a_symbol(*args)
43
44
:a_symbol
44
45
end
46
+
47
+ Contract C::None => Symbol
48
+ def a_symbol(*args)
49
+ :a_symbol
50
+ end
45
51
end
46
52
"""
47
53
@@ -61,14 +67,14 @@ Feature: None
61
67
Given a file named "anything.rb" with:
62
68
"""ruby
63
69
require "./none_usage"
64
- autorescue { Example.a_symbol(nil) }
65
- autorescue { Example.a_symbol(12) }
66
- autorescue { Example.a_symbol(37.5) }
67
- autorescue { Example.a_symbol("foo") }
68
- autorescue { Example.a_symbol(:foo) }
69
- autorescue { Example.a_symbol({}) }
70
- autorescue { Example.a_symbol([]) }
71
- autorescue { Example.a_symbol(Object) }
70
+ autorescue { Example.new. a_symbol(nil) }
71
+ autorescue { Example.new. a_symbol(12) }
72
+ autorescue { Example.new. a_symbol(37.5) }
73
+ autorescue { Example.new. a_symbol("foo") }
74
+ autorescue { Example.new. a_symbol(:foo) }
75
+ autorescue { Example.new. a_symbol({}) }
76
+ autorescue { Example.new. a_symbol([]) }
77
+ autorescue { Example.new. a_symbol(Object) }
72
78
"""
73
79
When I run `ruby anything.rb`
74
80
0 commit comments