spec/riak/excon_backend_spec.rb in riak-client-0.9.0.beta vs spec/riak/excon_backend_spec.rb in riak-client-0.9.0.beta2
- old
+ new
@@ -21,18 +21,18 @@
$mock_server = DrbMockServer
$mock_server.maybe_start
describe Riak::Client::ExconBackend do
def setup_http_mock(method, uri, options={})
- method = method.to_s.upcase
- uri = URI.parse(uri)
- path = uri.path || "/"
- query = uri.query || ""
- status = options[:status] ? Array(options[:status]).first.to_i : 200
- body = options[:body] || []
+ method = method.to_s.upcase
+ uri = URI.parse(uri)
+ path = uri.path || "/"
+ query = uri.query || ""
+ body = options[:body] || []
headers = options[:headers] || {}
- headers['Content-Type'] ||= "text/plain"
+ headers['Content-Type'] ||= "text/plain"
+ status = options[:status] ? Array(options[:status]).first.to_i : 200
@_mock_set = [status, headers, method, path, query, body]
$mock_server.expect(*@_mock_set)
end
before :each do
@@ -71,6 +71,7 @@
@backend.post(200, "/riak/", "foo", file, {})
$mock_server.satisfied.should be_true
end.should_not raise_error
end
end
+
end