Skip to content

Instantly share code, notes, and snippets.

@sr
Created August 29, 2008 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sr/7961 to your computer and use it in GitHub Desktop.
Save sr/7961 to your computer and use it in GitHub Desktop.
$rest = RestClient.new('http://foo.org')
get '/' do
$rest.put '/foo'
'hey'
end
describe 'My App' do
before(:each) do
@rest = mock('rest client')
RestClient.stub!(:new).and_return(@rest)
end
it 'should init restc client' do
RestClient.should_receive(:new).and_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