diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-11-30 21:26:52 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-11-30 21:26:52 +0100 |
commit | 1243255c3a36433041012b6107a5ac48658a0895 (patch) | |
tree | 04440f84b48999ff08d4a2a16d066d0ad731400e /spec/ruby/core/exception/to_s_spec.rb | |
parent | ab8345271eb87ff155d8bd5f22f53a4cf2902c26 (diff) | |
download | ruby-1243255c3a36433041012b6107a5ac48658a0895.tar.gz |
Update to ruby/spec@4eec3dc
Diffstat (limited to 'spec/ruby/core/exception/to_s_spec.rb')
-rw-r--r-- | spec/ruby/core/exception/to_s_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/ruby/core/exception/to_s_spec.rb b/spec/ruby/core/exception/to_s_spec.rb index 8570b18cfd..4c4c7ab432 100644 --- a/spec/ruby/core/exception/to_s_spec.rb +++ b/spec/ruby/core/exception/to_s_spec.rb @@ -19,5 +19,19 @@ describe "Exception#to_s" do end describe "NameError#to_s" do - it "needs to be reviewed for spec completeness" + it "raises its own message for an undefined variable" do + begin + puts not_defined + rescue => exception + exception.message.should =~ /undefined local variable or method `not_defined'/ + end + end + + it "raises its own message for an undefined constant" do + begin + puts NotDefined + rescue => exception + exception.message.should =~ /uninitialized constant NotDefined/ + end + end end |