Created
March 7, 2010 18:11
-
-
Save floehopper/324519 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
require 'test/unit' | |
require 'mocha' | |
class MyTest < Test::Unit::TestCase | |
class X | |
class << self | |
def foo(&block) | |
append_before_filter do | |
bar &block | |
end | |
end | |
def append_before_filter(&block); end | |
end | |
end | |
def test_me | |
X.expects(:bar).yields | |
X.stubs(:append_before_filter).yields | |
my_block_called = false | |
X.foo do | |
my_block_called = true | |
end | |
assert my_block_called | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment