diff options
Diffstat (limited to 'spec/ruby/core/kernel/fail_spec.rb')
| -rw-r--r-- | spec/ruby/core/kernel/fail_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/kernel/fail_spec.rb b/spec/ruby/core/kernel/fail_spec.rb index a5948cefae..ac379b67d5 100644 --- a/spec/ruby/core/kernel/fail_spec.rb +++ b/spec/ruby/core/kernel/fail_spec.rb @@ -3,11 +3,11 @@ require_relative 'fixtures/classes' describe "Kernel#fail" do it "is a private method" do - Kernel.should have_private_instance_method(:fail) + Kernel.private_instance_methods(false).should.include?(:fail) end it "raises a RuntimeError" do - lambda { fail }.should raise_error(RuntimeError) + -> { fail }.should.raise(RuntimeError) end it "accepts an Object with an exception method returning an Exception" do @@ -15,16 +15,16 @@ describe "Kernel#fail" do def obj.exception(msg) StandardError.new msg end - lambda { fail obj, "..." }.should raise_error(StandardError, "...") + -> { fail obj, "..." }.should.raise(StandardError, "...") end it "instantiates the specified exception class" do error_class = Class.new(RuntimeError) - lambda { fail error_class }.should raise_error(error_class) + -> { fail error_class }.should.raise(error_class) end it "uses the specified message" do - lambda { + -> { begin fail "the duck is not irish." rescue => e @@ -33,7 +33,7 @@ describe "Kernel#fail" do else raise Exception end - }.should raise_error(RuntimeError) + }.should.raise(RuntimeError) end end |
