mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
98ef38ada4
commit
ac93cf4ff8
2 changed files with 3 additions and 3 deletions
|
@ -5,13 +5,13 @@ describe "Regexp#initialize" do
|
||||||
Regexp.should have_private_method(:initialize)
|
Regexp.should have_private_method(:initialize)
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is ""..."2.7" do
|
ruby_version_is ""..."2.8" do
|
||||||
it "raises a SecurityError on a Regexp literal" do
|
it "raises a SecurityError on a Regexp literal" do
|
||||||
-> { //.send(:initialize, "") }.should raise_error(SecurityError)
|
-> { //.send(:initialize, "") }.should raise_error(SecurityError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is "2.7" do
|
ruby_version_is "2.8" do
|
||||||
it "raises a FrozenError on a Regexp literal" do
|
it "raises a FrozenError on a Regexp literal" do
|
||||||
-> { //.send(:initialize, "") }.should raise_error(FrozenError)
|
-> { //.send(:initialize, "") }.should raise_error(FrozenError)
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe "Literal Regexps" do
|
||||||
/Hello/.should be_kind_of(Regexp)
|
/Hello/.should be_kind_of(Regexp)
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is "2.7" do
|
ruby_version_is "2.8" do
|
||||||
it "is frozen" do
|
it "is frozen" do
|
||||||
/Hello/.frozen?.should == true
|
/Hello/.frozen?.should == true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue