Sha256: 68c47fe40c05be9ed688cb78a2188661bfe3fb5424dd9ae65aae8c6c8b7a31d0

Contents?: true

Size: 807 Bytes

Versions: 20

Compression:

Stored size: 807 Bytes

Contents

require_relative "../test_helper"

module Paths
  class HTTPTest < Minitest::Test
    describe IOStreams::Paths::HTTP do
      let :url do
        "http://example.com/index.html?count=10"
      end

      let :ssl_url do
        "https://example.com/index.html?count=10"
      end

      describe ".open" do
        it "reads http" do
          result = IOStreams::Paths::HTTP.new(url).read
          assert_includes result, "<html>"
        end

        it "reads https" do
          result = IOStreams::Paths::HTTP.new(ssl_url).read
          assert_includes result, "<html>"
        end

        it "does not support streams" do
          assert_raises URI::InvalidURIError do
            io = StringIO.new
            IOStreams::Paths::HTTP.new(io)
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
iostreams-1.10.3 test/paths/http_test.rb
iostreams-1.10.2 test/paths/http_test.rb
iostreams-1.10.1 test/paths/http_test.rb
iostreams-1.10.0 test/paths/http_test.rb
iostreams-1.9.0 test/paths/http_test.rb
iostreams-1.8.0 test/paths/http_test.rb
iostreams-1.7.0 test/paths/http_test.rb
iostreams-1.6.2 test/paths/http_test.rb
iostreams-1.6.1 test/paths/http_test.rb
iostreams-1.6.0 test/paths/http_test.rb
iostreams-1.5.1 test/paths/http_test.rb
iostreams-1.5.0 test/paths/http_test.rb
iostreams-1.4.0 test/paths/http_test.rb
iostreams-1.3.3 test/paths/http_test.rb
iostreams-1.3.2 test/paths/http_test.rb
iostreams-1.3.1 test/paths/http_test.rb
iostreams-1.3.0 test/paths/http_test.rb
iostreams-1.2.1 test/paths/http_test.rb
iostreams-1.2.0 test/paths/http_test.rb
iostreams-1.1.1 test/paths/http_test.rb