Created
July 8, 2014 09:21
-
-
Save anonymous/122a450b1c96c606bbe1 to your computer and use it in GitHub Desktop.
Another Scrap from scrapfy.io
This file contains hidden or 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
# Model | |
def method(argument, &block) | |
SomeLibrary.new.other_method(argument, &block) | |
end | |
# Test | |
should '#method' do | |
block = -> {} | |
block = Proc.new {} | |
lib = mock('Library') | |
lib.expects(:other_method).with(:arg, block) | |
SomeLibrary.expects(:new).returns(lib) | |
@instance.method(:arg, &block) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment