Sha256: 308b2863d51251d62354f6c9b64fb6496406bb24dc8d1bf919f4afa3ebdf7460

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

module Berkshelf
  describe Source do
    describe "#universe"
    describe "#cookbook"
    describe "#versions"

    describe "#==" do
      it "is the same if the uri matches" do
        first = described_class.new("http://localhost:8080")
        other = described_class.new("http://localhost:8080")

        expect(first).to eq(other)
      end

      it "is not the same if the uri is different" do
        first = described_class.new("http://localhost:8089")
        other = described_class.new("http://localhost:8080")

        expect(first).to_not eq(other)
      end
    end

    describe '.default?' do
      it 'returns true when the source is the default' do
        instance = described_class.new(Berksfile::DEFAULT_API_URL)
        expect(instance).to be_default
      end

      it 'returns true when the scheme is different' do
        instance = described_class.new('http://api.berkshelf.com')
        expect(instance).to be_default
      end

      it 'returns false when the source is not the default' do
        instance = described_class.new('http://localhost:8080')
        expect(instance).to_not be_default
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
berkshelf-3.1.3 spec/unit/berkshelf/source_spec.rb
berkshelf-3.1.2 spec/unit/berkshelf/source_spec.rb
berkshelf-3.1.1 spec/unit/berkshelf/source_spec.rb
berkshelf-3.1.0 spec/unit/berkshelf/source_spec.rb
berkshelf-3.0.1 spec/unit/berkshelf/source_spec.rb
berkshelf-3.0.0 spec/unit/berkshelf/source_spec.rb
berkshelf-3.0.0.rc1 spec/unit/berkshelf/source_spec.rb
berkshelf-3.0.0.beta9 spec/unit/berkshelf/source_spec.rb
berkshelf-3.0.0.beta8 spec/unit/berkshelf/source_spec.rb