Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions spec/sham_rack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class NetHttpProhibited < StandardError; end
end

it "can be accessed using open-uri" do
response = open("http://www.greetings.com")
response = URI.open("http://www.greetings.com")
expect(response.status).to eq(["200", "OK"])
expect(response.read).to eq("Hello, world")
end
Expand Down Expand Up @@ -74,7 +74,7 @@ class NetHttpProhibited < StandardError; end
["200 OK", { "Content-type" => "text/plain" }, ["Easy, huh?"]]
end

expect(open("http://simple.xyz").read).to eq("Easy, huh?")
expect(URI.open("http://simple.xyz").read).to eq("Easy, huh?")

end

Expand All @@ -96,7 +96,7 @@ class NetHttpProhibited < StandardError; end

ShamRack.at("hello.xyz").mount(GreetingApp.new)

expect(open("http://hello.xyz").read).to eq("Hello, world")
expect(URI.open("http://hello.xyz").read).to eq("Hello, world")

end

Expand All @@ -110,7 +110,7 @@ class NetHttpProhibited < StandardError; end
ShamRack.at("gone.xyz").unmount

expect do
open("http://gone.xyz").read
URI.open("http://gone.xyz").read
end.to raise_error(NetHttpProhibited)

end
Expand All @@ -127,7 +127,7 @@ class NetHttpProhibited < StandardError; end
end

it "mounts an app created using Rack::Builder" do
expect(open("http://rackup.xyz").read).to eq("HELLO, WORLD")
expect(URI.open("http://rackup.xyz").read).to eq("HELLO, WORLD")
end

it "returns the app" do
Expand All @@ -147,7 +147,7 @@ class NetHttpProhibited < StandardError; end
end

it "mounts associated block as a Sinatra app" do
expect(open("http://sinatra.xyz/hello/stranger").read).to eq("Hello, stranger")
expect(URI.open("http://sinatra.xyz/hello/stranger").read).to eq("Hello, stranger")
end

it "returns the app" do
Expand Down Expand Up @@ -334,7 +334,7 @@ def env

it "is valid" do

open("http://env.xyz/blah?q=abc")
URI.open("http://env.xyz/blah?q=abc")

expect(env["REQUEST_METHOD"]).to eq("GET")
expect(env["SCRIPT_NAME"]).to eq("")
Expand Down