diff options
Diffstat (limited to 'spec/ruby/core/regexp/initialize_spec.rb')
-rw-r--r-- | spec/ruby/core/regexp/initialize_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/regexp/initialize_spec.rb b/spec/ruby/core/regexp/initialize_spec.rb index 36fd5c7bf2..ae188fb9c2 100644 --- a/spec/ruby/core/regexp/initialize_spec.rb +++ b/spec/ruby/core/regexp/initialize_spec.rb @@ -5,8 +5,16 @@ describe "Regexp#initialize" do Regexp.should have_private_method(:initialize) end - it "raises a SecurityError on a Regexp literal" do - -> { //.send(:initialize, "") }.should raise_error(SecurityError) + ruby_version_is ""..."2.7" do + it "raises a SecurityError on a Regexp literal" do + -> { //.send(:initialize, "") }.should raise_error(SecurityError) + end + end + + ruby_version_is "2.7" do + it "raises a FrozenError on a Regexp literal" do + -> { //.send(:initialize, "") }.should raise_error(FrozenError) + end end it "raises a TypeError on an initialized non-literal Regexp" do |