#674: Shoulda fails because of oddity with block_given? ---------------------------------+------------------------------------------ Reporter: mar...@… | Owner: lsansone...@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------
Comment(by mar...@…): It's more complicated. It seems as if block_given? acts like a local variable bound within the block, so that it retains its value even when the block is called at some arbitrary later point. Here's a simpler example: {{{ def called(&blk) $block = blk end def should(&blk) called do puts "In MRI, you would see true instead of #{block_given?}" end end should do "some block thing" end $block.call }}} 1.8.6 produces this: {{{ 1388 $ ruby block_given.rb In MRI, you would see true instead of true }}} instead of this from a recent 0.7: {{{ 1389 $ macruby block_given.rb In MRI, you would see true instead of false }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/674#comment:3> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel