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-3.0.0.beta3 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-3.0.0.beta2 spec/unit/berkshelf/source_uri_spec.rb
berkshelf-3.0.0.beta1 spec/unit/berkshelf/source_uri_spec.rb