Sha256: 8b6e7184a3adcbe8bc5240681ce006f2a7e5049d6a40a2266e7791915d8d9cf4

Contents?: true

Size: 989 Bytes

Versions: 9

Compression:

Stored size: 989 Bytes

Contents

require 'unit_helper'

require 'vagrant-lxc/action/compress_rootfs'

describe Vagrant::LXC::Action::CompressRootFS do
  let(:app)                    { double(:app, call: true) }
  let(:env)                    { {machine: machine, ui: double(info: true)} }
  let(:machine)                { instance_double('Vagrant::Machine', provider: provider) }
  let(:provider)               { instance_double('Vagrant::LXC::Provider', driver: driver) }
  let(:driver)                 { instance_double('Vagrant::LXC::Driver', compress_rootfs: compressed_rootfs_path) }
  let(:compressed_rootfs_path) { '/path/to/rootfs.tar.gz' }

  subject { described_class.new(app, env) }

  before do
    provider.stub_chain(:state, :id).and_return(:stopped)
    subject.call(env)
  end

  it "asks the driver to compress container's rootfs" do
    driver.should have_received(:compress_rootfs)
  end

  it 'sets export.temp_dir on action env' do
    env['package.rootfs'].should == compressed_rootfs_path
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-lxc-0.8.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.7.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.6.4 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.6.3 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.6.2 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.6.1 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.6.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.5.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-0.4.0 spec/unit/action/compress_rootfs_spec.rb