summaryrefslogtreecommitdiff
path: root/spec/functional/tiny_server_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functional/tiny_server_spec.rb')
-rw-r--r--spec/functional/tiny_server_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/functional/tiny_server_spec.rb b/spec/functional/tiny_server_spec.rb
index 9540234ba6..3e394f335e 100644
--- a/spec/functional/tiny_server_spec.rb
+++ b/spec/functional/tiny_server_spec.rb
@@ -26,7 +26,7 @@ describe TinyServer::API do
end
it "is a Singleton" do
- expect {TinyServer::API.new}.to raise_error
+ expect { TinyServer::API.new }.to raise_error
end
it "clears the router" do
@@ -39,26 +39,26 @@ describe TinyServer::API do
@api.get("/foo/bar", 200, "hello foobar")
# WEBrick gives you the full URI with host, Thin only gave the part after scheme+host+port
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => "http://localhost:1974/foo/bar")
- expect(response).to eq([200, {"Content-Type" => "application/json"}, [ "hello foobar" ]])
+ expect(response).to eq([200, { "Content-Type" => "application/json" }, [ "hello foobar" ]])
end
it "creates a route for a request with a block" do
block_called = false
@api.get("/bar/baz", 200) { block_called = true; "hello barbaz" }
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => "http://localhost:1974/bar/baz")
- expect(response).to eq([200, {"Content-Type" => "application/json"}, [ "hello barbaz" ]])
+ expect(response).to eq([200, { "Content-Type" => "application/json" }, [ "hello barbaz" ]])
expect(block_called).to be_truthy
end
it "returns debugging info for 404s" do
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => "/no_such_thing")
expect(response[0]).to eq(404)
- expect(response[1]).to eq({"Content-Type" => "application/json"})
+ expect(response[1]).to eq({ "Content-Type" => "application/json" })
expect(response[2]).to be_a_kind_of(Array)
response_obj = Chef::JSONCompat.from_json(response[2].first)
expect(response_obj["message"]).to eq("no data matches the request for /no_such_thing")
- expect(response_obj["available_routes"]).to eq({"GET"=>[], "PUT"=>[], "POST"=>[], "DELETE"=>[]})
- expect(response_obj["request"]).to eq({"REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"/no_such_thing"})
+ expect(response_obj["available_routes"]).to eq({ "GET" => [], "PUT" => [], "POST" => [], "DELETE" => [] })
+ expect(response_obj["request"]).to eq({ "REQUEST_METHOD" => "GET", "REQUEST_URI" => "/no_such_thing" })
end
end