Skip to content

Commit f9eb0d8

Browse files
committed
Use ruby_version_is
As the markers for spec/mspec/tool/remove_old_guards.rb.
1 parent 264c469 commit f9eb0d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/ruby/core/exception/frozen_error_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def o.x; end
2626
object = Object.new
2727
object.freeze
2828

29-
msg_class = RUBY_VERSION >= "4" ? "Object" : "object"
29+
msg_class = ruby_version_is("4.0") ? "Object" : "object"
3030

3131
-> {
3232
def object.x; end

spec/ruby/language/def_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def foo(a); end
9797
def foo; end
9898
end
9999
}.should raise_error(FrozenError) { |e|
100-
msg_class = RUBY_VERSION >= "4" ? "Module" : "module"
100+
msg_class = ruby_version_is("4.0") ? "Module" : "module"
101101
e.message.should == "can't modify frozen #{msg_class}: #{e.receiver}"
102102
}
103103

@@ -107,7 +107,7 @@ def foo; end
107107
def foo; end
108108
end
109109
}.should raise_error(FrozenError){ |e|
110-
msg_class = RUBY_VERSION >= "4" ? "Class" : "class"
110+
msg_class = ruby_version_is("4.0") ? "Class" : "class"
111111
e.message.should == "can't modify frozen #{msg_class}: #{e.receiver}"
112112
}
113113
end
@@ -285,7 +285,7 @@ def obj.==(other)
285285
it "raises FrozenError with the correct class name" do
286286
obj = Object.new
287287
obj.freeze
288-
msg_class = RUBY_VERSION >= "4" ? "Object" : "object"
288+
msg_class = ruby_version_is("4.0") ? "Object" : "object"
289289
-> { def obj.foo; end }.should raise_error(FrozenError, "can't modify frozen #{msg_class}: #{obj}")
290290

291291
obj = Object.new

0 commit comments

Comments
 (0)