Sha256: 13c370b93512bfd3f3a9ad25436e938f2e0343de78f5b9fc628c22a4b57cf8fa

Contents?: true

Size: 380 Bytes

Versions: 3

Compression:

Stored size: 380 Bytes

Contents

require 'helper'

class TestMechanizeFileConnection < Test::Unit::TestCase

  def test_request
    uri = URI.parse "file://#{File.expand_path __FILE__}"
    conn = Mechanize::FileConnection.new

    body = ''

    conn.request uri, nil do |response|
      response.read_body do |part|
        body << part
      end
    end

    assert_equal File.read(__FILE__), body
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mechanize-2.0 test/test_mechanize_file_response.rb
mechanize-2.0.pre.2 test/test_mechanize_file_response.rb
mechanize-2.0.pre.1 test/test_mechanize_file_response.rb