Skip to content
Browse files

Alter tests to reflect that ShamRack.at(...).mount is the preferred API.

  • Loading branch information...
1 parent a1cfe72 commit bbc2106d2917fbd5c675a8408ea285773e219c49 @mdub committed Apr 5, 2013
Showing with 24 additions and 16 deletions.
  1. +24 −16 spec/sham_rack_spec.rb
View
40 spec/sham_rack_spec.rb
@@ -66,23 +66,9 @@ class NetHttpProhibited < StandardError; end
end
- describe ".mount" do
-
- context "with a URL" do
-
- it "raises an ArgumentError" do
- lambda do
- ShamRack.mount(GreetingApp.new, "http://www.greetings.com")
- end.should raise_error(ArgumentError, "invalid address")
- end
-
- end
-
- end
-
describe ".at" do
- describe "with a block" do
+ context "with a block" do
it "mounts associated block as an app" do
@@ -96,9 +82,19 @@ class NetHttpProhibited < StandardError; end
end
+ context "with a URL" do
+
+ it "raises an ArgumentError" do
+ lambda do
+ ShamRack.at("http://www.greetings.com")
+ end.should raise_error(ArgumentError, "invalid address")
+ end
+
+ end
+
describe "#mount" do
- it "is sugar for ShamRack.mount" do
+ it "mounts an app" do
ShamRack.at("hello.xyz").mount(GreetingApp.new)
@@ -180,6 +176,18 @@ class NetHttpProhibited < StandardError; end
end
+ describe ".mount" do
+
+ it "is deprecated, but still works" do
+
+ ShamRack.mount(GreetingApp.new, "hello.xyz")
+
+ open("http://hello.xyz").read.should == "Hello, world"
+
+ end
+
+ end
+
describe "response" do
before(:each) do

0 comments on commit bbc2106

Please sign in to comment.
Something went wrong with that request. Please try again.