Sha256: 2aa3f1341b17d0811c4a3b3608c061a426c04708f008586cb71be43a6c07afff
Contents?: true
Size: 597 Bytes
Versions: 9
Compression:
Stored size: 597 Bytes
Contents
require 'mechanize/test_case' class TestMechanizeFileResponse < Mechanize::TestCase def test_content_type Tempfile.open %w[pi .nothtml] do |tempfile| res = Mechanize::FileResponse.new tempfile.path assert_equal nil, res['content-type'] end Tempfile.open %w[pi .xhtml] do |tempfile| res = Mechanize::FileResponse.new tempfile.path assert_equal 'text/html', res['content-type'] end Tempfile.open %w[pi .html] do |tempfile| res = Mechanize::FileResponse.new tempfile.path assert_equal 'text/html', res['Content-Type'] end end end
Version data entries
9 entries across 9 versions & 1 rubygems