Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Squash test warnings

  • Loading branch information...
commit a13426b08bc2031e03133df6590b159251adf460 1 parent e92a8ce
@raggi raggi authored
View
36 test/spec_mime.rb
@@ -4,47 +4,47 @@
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
View
6 test/spec_response.rb
@@ -290,19 +290,19 @@ def object_with_each.each
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
View
4 test/spec_server.rb
@@ -19,12 +19,12 @@ def with_stderr
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
View
10 test/spec_utils.rb
@@ -282,17 +282,17 @@ def kcodeu
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
Please sign in to comment.
Something went wrong with that request. Please try again.