Sha256: 5c4a6cd169f8dbb5fb55e7e0ef3709c8a2b0d46c5c32c34b5ff019631898e635

Contents?: true

Size: 711 Bytes

Versions: 43

Compression:

Stored size: 711 Bytes

Contents

require 'spec_helper'

describe Berkshelf::SourceURI do
  describe "ClassMethods" do
    describe "::parse" do
      subject { described_class.parse(uri) }

      context "when the host is missing" do
        let(:uri) { "http://" }

        it "raises an InvalidSourceURI" do
          expect { subject }.to raise_error(Berkshelf::InvalidSourceURI)
        end
      end
    end
  end

  describe "#validate" do
    subject { described_class.parse(uri) }

    context "when the scheme does not match http or https" do
      let(:uri) { "ftp://riotgames.com" }

      it "raises an InvalidSourceURI" do
        expect { subject.validate }.to raise_error(Berkshelf::InvalidSourceURI)
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
berkshelf-5.5.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-5.4.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-5.3.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-5.2.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-5.1.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-5.0.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.3.5 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.3.3 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.3.2 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.3.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.3.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.2.3 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.2.2 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.2.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.2.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.1.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.1.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.0.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-4.0.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-3.3.0 spec/unit/berkshelf/source_uri_spec.rb