Created
May 4, 2010 13:38
-
-
Save marick/389420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def should(&a_block_that_is_never_called) | |
stash_block { | |
puts "block_given? is #{block_given?}." | |
} | |
end | |
def stash_block(&block) | |
$block = block | |
end | |
def call_stashed_block_without_taking_a_block_yourself | |
$block.call | |
end | |
should do "something, but not in this test" end | |
call_stashed_block_without_taking_a_block_yourself |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment