Sha256: 06f868761f7b8e825ebe3d49221387405f9c4fbb8a3ca0e40a0fdf7a9c23ec1a

Contents?: true

Size: 1 KB

Versions: 18

Compression:

Stored size: 1 KB

Contents

require 'unit_helper'

require 'vagrant-lxc/plugin'
require 'vagrant-lxc/provider'
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)                { double(Vagrant::Machine, provider: provider) }
  let(:provider)               { double(Vagrant::LXC::Provider, driver: driver) }
  let(:driver)                 { 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
    expect(driver).to have_received(:compress_rootfs)
  end

  it 'sets export.temp_dir on action env' do
    expect(env['package.rootfs']).to eq(compressed_rootfs_path)
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
vagrant-lxc-1.4.3 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.4.2 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.4.1 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-2.1-patch-1.4.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.4.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.3.1 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.3.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.2.4 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.2.3 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.2.2 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.2.1 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.2.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.1.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.0.1 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.0.0 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.0.0.alpha.3 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.0.0.alpha.2 spec/unit/action/compress_rootfs_spec.rb
vagrant-lxc-1.0.0.alpha.1 spec/unit/action/compress_rootfs_spec.rb