Sha256: 460e77e4069ea5aefba42bcddbe78d24327be749695c7c29701b5868e79f65e6

Contents?: true

Size: 868 Bytes

Versions: 3

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper'

describe Palimpsest::Component do

  subject(:component) { Palimpsest::Component.new }

  describe "#install" do

    it "fails if no source path" do
      component.install_path = 'install/path'
      expect { component.install }.to raise_error RuntimeError
    end

    it "fails if no install path" do
      component.source_path = 'src/path'
      expect { component.install }.to raise_error RuntimeError
    end

    it "moves the component to the install path" do
      component.source_path = 'src/path'
      component.install_path = 'install/path'
      allow(Dir).to receive(:[]).with('src/path/*').and_return( %w(src/path/1 src/path/2) )
      expect(FileUtils).to receive(:mkdir_p).with('install/path')
      expect(FileUtils).to receive(:mv).with(%w(src/path/1 src/path/2), 'install/path')
      component.install
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
palimpsest-0.2.0 spec/component_spec.rb
palimpsest-0.1.1 spec/component_spec.rb
palimpsest-0.1.0 spec/component_spec.rb