[rspec-devel] [ rspec-Bugs-8646 ] Context Runner does not report on Non standard exceptions and return a 0 return code

noreply at rubyforge.org noreply at rubyforge.org
Wed Feb 14 00:36:32 EST 2007


Bugs item #8646, was opened at 2007-02-13 22:48
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8646&group_id=797

Category: runner module
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Brian Takita (btakita)
>Assigned to: David Chelimsky (dchelimsky)
Summary: Context Runner does not report on Non standard exceptions and return a 0 return code

Initial Comment:
This is a major bug.

This spec demonstrats the problem.

context "A Context Runner receiving an Exception" do
  specify "should report on it and return a 0 return code" do
    raise Exception
  end
end

----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-14 05:36

Message:
Fixed in trunk 1494

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-14 05:22

Message:
Actually - I see how to handle it now:

irb(main):001:0> def trap(&block)
irb(main):002:1> block.call
irb(main):003:1> rescue Exception => e
irb(main):004:1> puts e
irb(main):005:1> end
=> nil
irb(main):006:0> trap { raise RuntimeError.new }
RuntimeError
=> nil
irb(main):007:0> trap { raise Exception }
Exception
=> nil
irb(main):008:0> trap { raise Exception.new }
Exception
=> nil

Fix coming soon.

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-14 05:20

Message:
This seems to be how Ruby behaves:

irb(main):001:0> def trap(&block)
irb(main):002:1> block.call
irb(main):003:1> rescue => e
irb(main):004:1> puts e
irb(main):005:1> end
=> nil
irb(main):006:0> trap { raise "some error" }
some error
=> nil
irb(main):007:0> trap { raise RuntimeError.new }
RuntimeError
=> nil
irb(main):008:0> trap { raise Exception.new }
(irb):8:in `irb_binding': Exception (Exception)
        from (irb):2:in `call'
        from (irb):2:in `trap'
        from (irb):8:in `irb_binding'
        from /usr/local/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
        from /usr/local/lib/ruby/1.8/irb/workspace.rb:52

Not sure what we could do about it. Any ideas?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8646&group_id=797


More information about the rspec-devel mailing list