diff options
author | Benoit Daloze <eregontp@gmail.com> | 2023-07-06 16:34:28 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2023-07-06 18:27:13 +0200 |
commit | 055f7219bc4ace48270b09630626305784d5a87e (patch) | |
tree | 08868c111f4628a8605bfcdf11dd7105d12af13e /spec | |
parent | 9ee1877e4ab535253b4f61302b9102d20e11db5a (diff) | |
download | ruby-055f7219bc4ace48270b09630626305784d5a87e.tar.gz |
Improve ArgumentError message for Module#set_temporary_name
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/module/set_temporary_name_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/module/set_temporary_name_spec.rb b/spec/ruby/core/module/set_temporary_name_spec.rb index 93a02a4143..f5886a3398 100644 --- a/spec/ruby/core/module/set_temporary_name_spec.rb +++ b/spec/ruby/core/module/set_temporary_name_spec.rb @@ -29,14 +29,14 @@ ruby_version_is "3.3" do it "can't assign a constant name as a temporary name" do m = Module.new - -> { m.set_temporary_name("Object") }.should raise_error(ArgumentError, "name must not be valid constant path") + -> { m.set_temporary_name("Object") }.should raise_error(ArgumentError, "the temporary name must not be a constant path to avoid confusion") end it "can't assign a constant path as a temporary name" do m = Module.new - -> { m.set_temporary_name("A::B") }.should raise_error(ArgumentError, "name must not be valid constant path") - -> { m.set_temporary_name("::A") }.should raise_error(ArgumentError, "name must not be valid constant path") - -> { m.set_temporary_name("::A::B") }.should raise_error(ArgumentError, "name must not be valid constant path") + -> { m.set_temporary_name("A::B") }.should raise_error(ArgumentError, "the temporary name must not be a constant path to avoid confusion") + -> { m.set_temporary_name("::A") }.should raise_error(ArgumentError, "the temporary name must not be a constant path to avoid confusion") + -> { m.set_temporary_name("::A::B") }.should raise_error(ArgumentError, "the temporary name must not be a constant path to avoid confusion") end it "can't assign name to permanent module" do |