diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-09 11:07:01 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-01 15:36:20 +0900 |
commit | 3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (patch) | |
tree | b4697ea23f16f340589d27b4f4c046233b2bd106 /spec/ruby/core/kernel | |
parent | 151f8be40d385ada2ebf7feb84210ed7db7ef4df (diff) | |
download | ruby-3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2.tar.gz |
Use FrozenError instead of frozen_error_class
Diffstat (limited to 'spec/ruby/core/kernel')
-rw-r--r-- | spec/ruby/core/kernel/autoload_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/kernel/extend_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/kernel/instance_variable_set_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/kernel/taint_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/kernel/trust_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/kernel/untaint_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/kernel/untrust_spec.rb | 4 |
7 files changed, 16 insertions, 16 deletions
diff --git a/spec/ruby/core/kernel/autoload_spec.rb b/spec/ruby/core/kernel/autoload_spec.rb index 68732a69ef..8d56021fa8 100644 --- a/spec/ruby/core/kernel/autoload_spec.rb +++ b/spec/ruby/core/kernel/autoload_spec.rb @@ -57,8 +57,8 @@ describe "Kernel#autoload" do end describe "when Object is frozen" do - it "raises a #{frozen_error_class} before defining the constant" do - ruby_exe(fixture(__FILE__, "autoload_frozen.rb")).should == "#{frozen_error_class} - nil" + it "raises a FrozenError before defining the constant" do + ruby_exe(fixture(__FILE__, "autoload_frozen.rb")).should == "FrozenError - nil" end end diff --git a/spec/ruby/core/kernel/extend_spec.rb b/spec/ruby/core/kernel/extend_spec.rb index 9f98b3681f..47b22f3a18 100644 --- a/spec/ruby/core/kernel/extend_spec.rb +++ b/spec/ruby/core/kernel/extend_spec.rb @@ -72,8 +72,8 @@ describe "Kernel#extend" do -> { @frozen.extend }.should raise_error(ArgumentError) end - it "raises a #{frozen_error_class}" do - -> { @frozen.extend @module }.should raise_error(frozen_error_class) + it "raises a FrozenError" do + -> { @frozen.extend @module }.should raise_error(FrozenError) end end end diff --git a/spec/ruby/core/kernel/instance_variable_set_spec.rb b/spec/ruby/core/kernel/instance_variable_set_spec.rb index c5a4085530..12b2185878 100644 --- a/spec/ruby/core/kernel/instance_variable_set_spec.rb +++ b/spec/ruby/core/kernel/instance_variable_set_spec.rb @@ -82,12 +82,12 @@ describe "Kernel#instance_variable_set" do @frozen.ivar.should equal(:origin) end - it "raises a #{frozen_error_class} when passed replacement is identical to stored object" do - -> { @frozen.instance_variable_set(:@ivar, :origin) }.should raise_error(frozen_error_class) + it "raises a FrozenError when passed replacement is identical to stored object" do + -> { @frozen.instance_variable_set(:@ivar, :origin) }.should raise_error(FrozenError) end - it "raises a #{frozen_error_class} when passed replacement is different from stored object" do - -> { @frozen.instance_variable_set(:@ivar, :replacement) }.should raise_error(frozen_error_class) + it "raises a FrozenError when passed replacement is different from stored object" do + -> { @frozen.instance_variable_set(:@ivar, :replacement) }.should raise_error(FrozenError) end end end diff --git a/spec/ruby/core/kernel/taint_spec.rb b/spec/ruby/core/kernel/taint_spec.rb index 6de009a46c..2d2b34d0d0 100644 --- a/spec/ruby/core/kernel/taint_spec.rb +++ b/spec/ruby/core/kernel/taint_spec.rb @@ -14,9 +14,9 @@ describe "Kernel#taint" do o.tainted?.should == true end - it "raises #{frozen_error_class} on an untainted, frozen object" do + it "raises FrozenError on an untainted, frozen object" do o = Object.new.freeze - -> { o.taint }.should raise_error(frozen_error_class) + -> { o.taint }.should raise_error(FrozenError) end it "does not raise an error on a tainted, frozen object" do diff --git a/spec/ruby/core/kernel/trust_spec.rb b/spec/ruby/core/kernel/trust_spec.rb index 13f085f420..dbc05b45d4 100644 --- a/spec/ruby/core/kernel/trust_spec.rb +++ b/spec/ruby/core/kernel/trust_spec.rb @@ -14,9 +14,9 @@ describe "Kernel#trust" do o.untrusted?.should == false end - it "raises #{frozen_error_class} on an untrusted, frozen object" do + it "raises FrozenError on an untrusted, frozen object" do o = Object.new.untrust.freeze - -> { o.trust }.should raise_error(frozen_error_class) + -> { o.trust }.should raise_error(FrozenError) end it "does not raise an error on a trusted, frozen object" do diff --git a/spec/ruby/core/kernel/untaint_spec.rb b/spec/ruby/core/kernel/untaint_spec.rb index 58485fcc58..df9e3144a0 100644 --- a/spec/ruby/core/kernel/untaint_spec.rb +++ b/spec/ruby/core/kernel/untaint_spec.rb @@ -14,9 +14,9 @@ describe "Kernel#untaint" do o.tainted?.should == false end - it "raises #{frozen_error_class} on a tainted, frozen object" do + it "raises FrozenError on a tainted, frozen object" do o = Object.new.taint.freeze - -> { o.untaint }.should raise_error(frozen_error_class) + -> { o.untaint }.should raise_error(FrozenError) end it "does not raise an error on an untainted, frozen object" do diff --git a/spec/ruby/core/kernel/untrust_spec.rb b/spec/ruby/core/kernel/untrust_spec.rb index c6eb79af1c..c5a36e1a1d 100644 --- a/spec/ruby/core/kernel/untrust_spec.rb +++ b/spec/ruby/core/kernel/untrust_spec.rb @@ -14,9 +14,9 @@ describe "Kernel#untrust" do o.untrusted?.should == true end - it "raises #{frozen_error_class} on a trusted, frozen object" do + it "raises FrozenError on a trusted, frozen object" do o = Object.new.freeze - -> { o.untrust }.should raise_error(frozen_error_class) + -> { o.untrust }.should raise_error(FrozenError) end it "does not raise an error on an untrusted, frozen object" do |