summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Tucker <jftucker@gmail.com>2013-01-13 13:37:30 -0800
committerJames Tucker <jftucker@gmail.com>2013-01-13 13:37:30 -0800
commita13426b08bc2031e03133df6590b159251adf460 (patch)
treee05c6a07021814f7f73e0d389c35f0cfa3265e78
parente92a8ce5b10502c8e0beb5f37af71d21414c6947 (diff)
downloadrack-a13426b08bc2031e03133df6590b159251adf460.tar.gz
Squash test warnings
-rw-r--r--test/spec_mime.rb36
-rw-r--r--test/spec_response.rb6
-rw-r--r--test/spec_server.rb4
-rw-r--r--test/spec_utils.rb10
4 files changed, 28 insertions, 28 deletions
diff --git a/test/spec_mime.rb b/test/spec_mime.rb
index 3da787bf..231bf35b 100644
--- a/test/spec_mime.rb
+++ b/test/spec_mime.rb
@@ -4,47 +4,47 @@ describe Rack::Mime do
it "should return the fallback mime-type for files with no extension" do
fallback = 'image/jpg'
- Rack::Mime.mime_type(File.extname('no_ext'), fallback).should == fallback
+ Rack::Mime.mime_type(File.extname('no_ext'), fallback).should.equal fallback
end
it "should always return 'application/octet-stream' for unknown file extensions" do
unknown_ext = File.extname('unknown_ext.abcdefg')
- Rack::Mime.mime_type(unknown_ext).should == 'application/octet-stream'
+ Rack::Mime.mime_type(unknown_ext).should.equal 'application/octet-stream'
end
it "should return the mime-type for a given extension" do
# sanity check. it would be infeasible test every single mime-type.
- Rack::Mime.mime_type(File.extname('image.jpg')).should == 'image/jpeg'
+ Rack::Mime.mime_type(File.extname('image.jpg')).should.equal 'image/jpeg'
end
it "should support null fallbacks" do
- Rack::Mime.mime_type('.nothing', nil).should == nil
+ Rack::Mime.mime_type('.nothing', nil).should.equal nil
end
it "should match exact mimes" do
- Rack::Mime.match?('text/html', 'text/html').should == true
- Rack::Mime.match?('text/html', 'text/meme').should == false
- Rack::Mime.match?('text', 'text').should == true
- Rack::Mime.match?('text', 'binary').should == false
+ Rack::Mime.match?('text/html', 'text/html').should.equal true
+ Rack::Mime.match?('text/html', 'text/meme').should.equal false
+ Rack::Mime.match?('text', 'text').should.equal true
+ Rack::Mime.match?('text', 'binary').should.equal false
end
it "should match class wildcard mimes" do
- Rack::Mime.match?('text/html', 'text/*').should == true
- Rack::Mime.match?('text/plain', 'text/*').should == true
- Rack::Mime.match?('application/json', 'text/*').should == false
- Rack::Mime.match?('text/html', 'text').should == true
+ Rack::Mime.match?('text/html', 'text/*').should.equal true
+ Rack::Mime.match?('text/plain', 'text/*').should.equal true
+ Rack::Mime.match?('application/json', 'text/*').should.equal false
+ Rack::Mime.match?('text/html', 'text').should.equal true
end
it "should match full wildcards" do
- Rack::Mime.match?('text/html', '*').should == true
- Rack::Mime.match?('text/plain', '*').should == true
- Rack::Mime.match?('text/html', '*/*').should == true
- Rack::Mime.match?('text/plain', '*/*').should == true
+ Rack::Mime.match?('text/html', '*').should.equal true
+ Rack::Mime.match?('text/plain', '*').should.equal true
+ Rack::Mime.match?('text/html', '*/*').should.equal true
+ Rack::Mime.match?('text/plain', '*/*').should.equal true
end
it "should match type wildcard mimes" do
- Rack::Mime.match?('text/html', '*/html').should == true
- Rack::Mime.match?('text/plain', '*/plain').should == true
+ Rack::Mime.match?('text/html', '*/html').should.equal true
+ Rack::Mime.match?('text/plain', '*/plain').should.equal true
end
end
diff --git a/test/spec_response.rb b/test/spec_response.rb
index afc2528f..ebffa733 100644
--- a/test/spec_response.rb
+++ b/test/spec_response.rb
@@ -290,19 +290,19 @@ describe Rack::Response do
res.status = 204
_, _, b = res.finish
res.body.should.be.closed
- b.should.not == res.body
+ b.should.not.equal res.body
res.body = StringIO.new
res.status = 205
_, _, b = res.finish
res.body.should.be.closed
- b.should.not == res.body
+ b.should.not.equal res.body
res.body = StringIO.new
res.status = 304
_, _, b = res.finish
res.body.should.be.closed
- b.should.not == res.body
+ b.should.not.equal res.body
end
it "wraps the body from #to_ary to prevent infinite loops" do
diff --git a/test/spec_server.rb b/test/spec_server.rb
index 49605763..82495bd8 100644
--- a/test/spec_server.rb
+++ b/test/spec_server.rb
@@ -19,12 +19,12 @@ describe Rack::Server do
it "overrides :config if :app is passed in" do
server = Rack::Server.new(:app => "FOO")
- server.app.should == "FOO"
+ server.app.should.equal "FOO"
end
should "prefer to use :builder when it is passed in" do
server = Rack::Server.new(:builder => "run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['success']] }")
- server.app.class.should == Proc
+ server.app.class.should.equal Proc
Rack::MockRequest.new(server.app).get("/").body.to_s.should.equal 'success'
end
diff --git a/test/spec_utils.rb b/test/spec_utils.rb
index 0a2777a6..3f74455f 100644
--- a/test/spec_utils.rb
+++ b/test/spec_utils.rb
@@ -282,17 +282,17 @@ describe Rack::Utils do
end
should "select best quality match" do
- Rack::Utils.best_q_match("text/html", %w[text/html]).should == "text/html"
+ Rack::Utils.best_q_match("text/html", %w[text/html]).should.equal "text/html"
# More specific matches are preferred
- Rack::Utils.best_q_match("text/*;q=0.5,text/html;q=1.0", %w[text/html]).should == "text/html"
+ Rack::Utils.best_q_match("text/*;q=0.5,text/html;q=1.0", %w[text/html]).should.equal "text/html"
# Higher quality matches are preferred
- Rack::Utils.best_q_match("text/*;q=0.5,text/plain;q=1.0", %w[text/plain text/html]).should == "text/plain"
+ Rack::Utils.best_q_match("text/*;q=0.5,text/plain;q=1.0", %w[text/plain text/html]).should.equal "text/plain"
# All else equal, the available mimes are preferred in order
- Rack::Utils.best_q_match("text/*", %w[text/html text/plain]).should == "text/html"
- Rack::Utils.best_q_match("text/plain,text/html", %w[text/html text/plain]).should == "text/html"
+ Rack::Utils.best_q_match("text/*", %w[text/html text/plain]).should.equal "text/html"
+ Rack::Utils.best_q_match("text/plain,text/html", %w[text/html text/plain]).should.equal "text/html"
end
should "escape html entities [&><'\"/]" do