Sha256: 5668de6bcea58490a30ea7ee022230963d222b9c20262323e27f0560ed884f0a

Contents?: true

Size: 711 Bytes

Versions: 42

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

42 entries across 42 versions & 1 rubygems

Version Path
berkshelf-8.0.15 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.13 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.12 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.9 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.7 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.5 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.2 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-8.0.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.2.2 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.2.1 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.2.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.1.0 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.10 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.9 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.8 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.7 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-6.3.4 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.6 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-7.0.5 spec/unit/berkshelf/source_uri_spec.rb