Skip to content

Instantly share code, notes, and snippets.

@marick
Created May 4, 2010 13:38
Show Gist options
  • Save marick/389420 to your computer and use it in GitHub Desktop.
Save marick/389420 to your computer and use it in GitHub Desktop.
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