mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Use ruby_version_is
As the markers for spec/mspec/tool/remove_old_guards.rb.
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -26,7 +26,7 @@ describe "FrozenError#message" do
|
||||
object = Object.new
|
||||
object.freeze
|
||||
|
||||
msg_class = RUBY_VERSION >= "4" ? "Object" : "object"
|
||||
msg_class = ruby_version_is("4.0") ? "Object" : "object"
|
||||
|
||||
-> {
|
||||
def object.x; end
|
||||
|
||||
@@ -97,7 +97,7 @@ describe "An instance method" do
|
||||
def foo; end
|
||||
end
|
||||
}.should raise_error(FrozenError) { |e|
|
||||
msg_class = RUBY_VERSION >= "4" ? "Module" : "module"
|
||||
msg_class = ruby_version_is("4.0") ? "Module" : "module"
|
||||
e.message.should == "can't modify frozen #{msg_class}: #{e.receiver}"
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ describe "An instance method" do
|
||||
def foo; end
|
||||
end
|
||||
}.should raise_error(FrozenError){ |e|
|
||||
msg_class = RUBY_VERSION >= "4" ? "Class" : "class"
|
||||
msg_class = ruby_version_is("4.0") ? "Class" : "class"
|
||||
e.message.should == "can't modify frozen #{msg_class}: #{e.receiver}"
|
||||
}
|
||||
end
|
||||
@@ -285,7 +285,7 @@ describe "A singleton method definition" do
|
||||
it "raises FrozenError with the correct class name" do
|
||||
obj = Object.new
|
||||
obj.freeze
|
||||
msg_class = RUBY_VERSION >= "4" ? "Object" : "object"
|
||||
msg_class = ruby_version_is("4.0") ? "Object" : "object"
|
||||
-> { def obj.foo; end }.should raise_error(FrozenError, "can't modify frozen #{msg_class}: #{obj}")
|
||||
|
||||
obj = Object.new
|
||||
|
||||
Reference in new issue
Block a user