# encoding: utf-8 require_relative 'test_helper' require 'vcr' VCR.configure do |c| c.cassette_library_dir = "#{File.dirname(__FILE__)}/fixtures-vcr" c.hook_into :webmock end class HttpTest < Test::Unit::TestCase def test_get_with_redirection VCR.use_cassette('http_test') do google = Http.get("http://google.de") assert google.starts_with?("") end end def test_get_body_and_headers VCR.use_cassette('http_test') do body, headers = Http.get_body_and_headers("http://google.de", 0) assert body.starts_with?("") assert_equal ["text/html; charset=ISO-8859-1"], headers["content-type"] assert_equal "UTF-8", body.encoding.name end end end