Sha256: 8e33dcb0f4e1f91c4a0213e57781d7d389e855d5268d5b37212788964129ad9c

Contents?: true

Size: 998 Bytes

Versions: 54

Compression:

Stored size: 998 Bytes

Contents

#--
# Author:: Daniel DeLeo (<dan@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require "spec_helper"
describe URI do

  describe "when a URI contains an IPv6 literal" do

    let(:ipv6_uri) do
      URI.parse("https://[2a00:1450:4009:809::1008]:8443")
    end

    it "returns the hostname without brackets" do
      expect(ipv6_uri.hostname).to eq("2a00:1450:4009:809::1008")
    end

  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
chef-15.17.4-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.17.4 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.7-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.7 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.4-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.4 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.2-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.16.2 spec/unit/monkey_patches/uri_spec.rb
chef-15.15.0-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.15.0 spec/unit/monkey_patches/uri_spec.rb
chef-16.6.14-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-16.6.14 spec/unit/monkey_patches/uri_spec.rb
chef-16.5.77 spec/unit/monkey_patches/uri_spec.rb
chef-16.5.77-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-16.5.64 spec/unit/monkey_patches/uri_spec.rb
chef-16.5.64-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-15.14.0 spec/unit/monkey_patches/uri_spec.rb
chef-15.14.0-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb
chef-16.4.41 spec/unit/monkey_patches/uri_spec.rb
chef-16.4.41-universal-mingw32 spec/unit/monkey_patches/uri_spec.rb