-
-
Save bmizerany/8063 to your computer and use it in GitHub Desktop.
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
helpers do | |
def rest | |
@rest ||= RestClient.new('http://foo.org') | |
end | |
end | |
get '/' do | |
rest.put '/foo' | |
'hey' | |
end |
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
describe 'My App' do | |
setup do | |
@rest = mock("rest") | |
RestClient.any_instance.expects(:new).return(@rest) | |
end | |
it 'should do a PUT to "/foo"' do | |
@rest.should_receive(:put).with('foo') | |
get_it '/' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment