Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 07dd72a740
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.457 kb
require 'spec_helper'
describe Mocktra do
it 'works' do
Mocktra('www.example.com') do
get '/foo' do
'FOO!!'
end
post '/foo' do
params.inspect
end
end
require 'httpclient'
client = HTTPClient.new
res = client.get("http://www.example.com/foo")
res.body.should == 'FOO!!'
res = client.post("http://www.example.com/foo", 'bar' => 'baz')
res.body.should == '{"bar"=>"baz"}'
end
end
Jump to Line
Something went wrong with that request. Please try again.