PATH:
opt
/
alt
/
ruby20
/
lib64
/
ruby
/
gems
/
2.0.0
/
gems
/
rack-1.6.4
/
test
require 'rack/mime' 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.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.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.equal 'image/jpeg' end it "should support null fallbacks" do Rack::Mime.mime_type('.nothing', nil).should.equal nil end it "should match exact mimes" do 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.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.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.equal true Rack::Mime.match?('text/plain', '*/plain').should.equal true end end
[-] spec_fastcgi.rb
[edit]
[-] spec_session_pool.rb
[edit]
[-] spec_auth_basic.rb
[edit]
[-] spec_head.rb
[edit]
[-] spec_multipart.rb
[edit]
[-] spec_builder.rb
[edit]
[-] spec_config.rb
[edit]
[-] spec_recursive.rb
[edit]
[-] spec_runtime.rb
[edit]
[-] spec_server.rb
[edit]
[+]
multipart
[-] spec_commonlogger.rb
[edit]
[-] spec_nulllogger.rb
[edit]
[-] spec_file.rb
[edit]
[-] spec_rewindable_input.rb
[edit]
[+]
registering_handler
[-] spec_sendfile.rb
[edit]
[+]
unregistered_handler
[-] spec_mock.rb
[edit]
[+]
static
[-] spec_tempfile_reaper.rb
[edit]
[-] spec_content_type.rb
[edit]
[-] spec_urlmap.rb
[edit]
[-] spec_lint.rb
[edit]
[-] spec_methodoverride.rb
[edit]
[-] spec_session_memcache.rb
[edit]
[-] spec_utils.rb
[edit]
[-] spec_content_length.rb
[edit]
[-] spec_cgi.rb
[edit]
[-] spec_auth_digest.rb
[edit]
[-] spec_thin.rb
[edit]
[-] spec_showstatus.rb
[edit]
[-] spec_lock.rb
[edit]
[-] spec_mongrel.rb
[edit]
[-] spec_etag.rb
[edit]
[-] spec_chunked.rb
[edit]
[+]
..
[-] spec_request.rb
[edit]
[-] spec_body_proxy.rb
[edit]
[-] spec_static.rb
[edit]
[-] spec_cascade.rb
[edit]
[-] spec_showexceptions.rb
[edit]
[-] spec_session_abstract_id.rb
[edit]
[-] spec_directory.rb
[edit]
[+]
rackup
[-] spec_handler.rb
[edit]
[-] spec_version.rb
[edit]
[-] testrequest.rb
[edit]
[-] spec_conditionalget.rb
[edit]
[-] spec_logger.rb
[edit]
[-] spec_mime.rb
[edit]
[-] spec_response.rb
[edit]
[-] spec_webrick.rb
[edit]
[+]
cgi
[-] gemloader.rb
[edit]
[-] spec_deflater.rb
[edit]
[-] spec_session_cookie.rb
[edit]
[-] spec_lobster.rb
[edit]
[+]
builder