Sha256: 3c7212223ff8c21efd0059e1a657883f068d4f7b14661739c508fbcca5b11545

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'
require 'minimart/commands/mirror'

describe Minimart::Commands::Mirror do

  let(:inventory_directory) { './inventory' }
  let(:inventory_config_path) { 'spec/fixtures/sample_inventory.yml' }

  subject do
    Minimart::Commands::Mirror.new(
    inventory_directory: inventory_directory,
    inventory_config: inventory_config_path)
  end

  describe '::new' do
    it 'should set the inventory directory' do
      expect(subject.inventory_directory).to eq inventory_directory
    end

    it 'should build an inventory config' do
      expect(subject.inventory_config).to be_a Minimart::Mirror::InventoryConfiguration
    end

    it 'should pass the inventory config file path' do
      expect(subject.inventory_config.inventory_config_path).to eq inventory_config_path
    end
  end

  describe '::execute' do
    let(:builder) { double('builder', build!: nil) }

    it 'should build an inventory' do
      expect(Minimart::Mirror::InventoryBuilder).to receive(:new).and_return builder
      subject.execute!
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.2.4 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.2.3 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.2.0 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.1.6 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.1.3 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.0.2 spec/lib/minimart/commands/mirror_spec.rb
minimart-1.0.1 spec/lib/minimart/commands/mirror_spec.rb
minimart-0.0.1 spec/lib/minimart/commands/mirror_spec.rb