Sha256: 82fc0487999fb11ebbf02b66c4c61701d140645754f1b082a25c49b3045296c3

Contents?: true

Size: 885 Bytes

Versions: 9

Compression:

Stored size: 885 Bytes

Contents

require "spec_helper"

module Berkshelf
  describe Location do
    let(:dependency) { double(name: "bacon") }

    describe ".init" do
      it "finds a :path location by key" do
        instance = described_class.init(dependency, path: "~/Dev/meats/bacon")
        expect(instance).to be_a(PathLocation)
      end

      it "finds a :git location by key" do
        instance = described_class.init(dependency, git: "https://foo.com/meats/bacon.git")
        expect(instance).to be_a(GitLocation)
      end

      it "finds a :github location by key" do
        instance = described_class.init(dependency, github: "meats/bacon")
        expect(instance).to be_a(GitLocation)
      end

      it "returns nil when a location cannot be found" do
        instance = described_class.init(dependency, lamesauce: "meats/bacon")
        expect(instance).to be_nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
berkshelf-8.0.15 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.13 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.12 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.9 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.7 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.5 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.2 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.1 spec/unit/berkshelf/location_spec.rb
berkshelf-8.0.0 spec/unit/berkshelf/location_spec.rb