fire_double was deprecated in favor of instance_double
This commit is contained in:
parent
4bd6bffcb6
commit
c14ca57d17
4 changed files with 14 additions and 14 deletions
|
@ -5,9 +5,9 @@ require 'vagrant-lxc/action/compress_rootfs'
|
||||||
describe Vagrant::LXC::Action::CompressRootFS do
|
describe Vagrant::LXC::Action::CompressRootFS do
|
||||||
let(:app) { mock(:app, call: true) }
|
let(:app) { mock(:app, call: true) }
|
||||||
let(:env) { {machine: machine, ui: stub(info: true)} }
|
let(:env) { {machine: machine, ui: stub(info: true)} }
|
||||||
let(:machine) { fire_double('Vagrant::Machine', provider: provider) }
|
let(:machine) { instance_double('Vagrant::Machine', provider: provider) }
|
||||||
let(:provider) { fire_double('Vagrant::LXC::Provider', driver: driver) }
|
let(:provider) { instance_double('Vagrant::LXC::Provider', driver: driver) }
|
||||||
let(:driver) { fire_double('Vagrant::LXC::Driver', compress_rootfs: compressed_rootfs_path) }
|
let(:driver) { instance_double('Vagrant::LXC::Driver', compress_rootfs: compressed_rootfs_path) }
|
||||||
let(:compressed_rootfs_path) { '/path/to/rootfs.tar.gz' }
|
let(:compressed_rootfs_path) { '/path/to/rootfs.tar.gz' }
|
||||||
|
|
||||||
subject { described_class.new(app, env) }
|
subject { described_class.new(app, env) }
|
||||||
|
|
|
@ -10,8 +10,8 @@ describe Vagrant::LXC::Action::ForwardPorts do
|
||||||
let(:networks) { [[:other_config, {}], [:forwarded_port, {guest: guest_port, host: host_port}]] }
|
let(:networks) { [[:other_config, {}], [:forwarded_port, {guest: guest_port, host: host_port}]] }
|
||||||
let(:host_port) { 8080 }
|
let(:host_port) { 8080 }
|
||||||
let(:guest_port) { 80 }
|
let(:guest_port) { 80 }
|
||||||
let(:provider) { fire_double('Vagrant::LXC::Provider', driver: driver) }
|
let(:provider) { instance_double('Vagrant::LXC::Provider', driver: driver) }
|
||||||
let(:driver) { fire_double('Vagrant::LXC::Driver', assigned_ip: container_ip) }
|
let(:driver) { instance_double('Vagrant::LXC::Driver', assigned_ip: container_ip) }
|
||||||
let(:container_ip) { '10.0.1.234' }
|
let(:container_ip) { '10.0.1.234' }
|
||||||
let(:pid) { 'a-pid' }
|
let(:pid) { 'a-pid' }
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ require 'vagrant-lxc/action/setup_package_files'
|
||||||
describe Vagrant::LXC::Action::SetupPackageFiles do
|
describe Vagrant::LXC::Action::SetupPackageFiles do
|
||||||
let(:app) { mock(:app, call: true) }
|
let(:app) { mock(:app, call: true) }
|
||||||
let(:env) { {machine: machine, tmp_path: tmp_path, ui: stub(info: true), 'package.rootfs' => rootfs_path} }
|
let(:env) { {machine: machine, tmp_path: tmp_path, ui: stub(info: true), 'package.rootfs' => rootfs_path} }
|
||||||
let(:machine) { fire_double('Vagrant::Machine', box: box) }
|
let(:machine) { instance_double('Vagrant::Machine', box: box) }
|
||||||
let!(:tmp_path) { Pathname.new(Dir.mktmpdir) }
|
let!(:tmp_path) { Pathname.new(Dir.mktmpdir) }
|
||||||
let(:box) { fire_double('Vagrant::Box', directory: tmp_path.join('box')) }
|
let(:box) { instance_double('Vagrant::Box', directory: tmp_path.join('box')) }
|
||||||
let(:rootfs_path) { tmp_path.join('rootfs-amd64.tar.gz') }
|
let(:rootfs_path) { tmp_path.join('rootfs-amd64.tar.gz') }
|
||||||
|
|
||||||
subject { described_class.new(app, env) }
|
subject { described_class.new(app, env) }
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe Vagrant::LXC::Driver do
|
||||||
let(:unknown_container) { described_class.new('unknown', cli) }
|
let(:unknown_container) { described_class.new('unknown', cli) }
|
||||||
let(:valid_container) { described_class.new('valid', cli) }
|
let(:valid_container) { described_class.new('valid', cli) }
|
||||||
let(:new_container) { described_class.new(nil) }
|
let(:new_container) { described_class.new(nil) }
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', list: ['valid']) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', list: ['valid']) }
|
||||||
|
|
||||||
it 'raises a ContainerNotFound error if an unknown container name gets provided' do
|
it 'raises a ContainerNotFound error if an unknown container name gets provided' do
|
||||||
expect {
|
expect {
|
||||||
|
@ -37,7 +37,7 @@ describe Vagrant::LXC::Driver do
|
||||||
let(:template_opts) { {'--some' => 'random-option'} }
|
let(:template_opts) { {'--some' => 'random-option'} }
|
||||||
let(:config_file) { '/path/to/lxc-config-from-box' }
|
let(:config_file) { '/path/to/lxc-config-from-box' }
|
||||||
let(:rootfs_tarball) { '/path/to/cache/rootfs.tar.gz' }
|
let(:rootfs_tarball) { '/path/to/cache/rootfs.tar.gz' }
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', :create => true, :name= => true) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', :create => true, :name= => true) }
|
||||||
|
|
||||||
subject { described_class.new(nil, cli) }
|
subject { described_class.new(nil, cli) }
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ describe Vagrant::LXC::Driver do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'destruction' do
|
describe 'destruction' do
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', destroy: true) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', destroy: true) }
|
||||||
|
|
||||||
subject { described_class.new('name', cli) }
|
subject { described_class.new('name', cli) }
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ describe Vagrant::LXC::Driver do
|
||||||
let(:customizations) { [['a', '1'], ['b', '2']] }
|
let(:customizations) { [['a', '1'], ['b', '2']] }
|
||||||
let(:internal_customization) { ['internal', 'customization'] }
|
let(:internal_customization) { ['internal', 'customization'] }
|
||||||
let(:rootfs) { ['rootfs', subject.rootfs_path.to_s] }
|
let(:rootfs) { ['rootfs', subject.rootfs_path.to_s] }
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', start: true) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', start: true) }
|
||||||
|
|
||||||
subject { described_class.new('name', cli) }
|
subject { described_class.new('name', cli) }
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ describe Vagrant::LXC::Driver do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'halt' do
|
describe 'halt' do
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', shutdown: true) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', shutdown: true) }
|
||||||
|
|
||||||
subject { described_class.new('name', cli) }
|
subject { described_class.new('name', cli) }
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ describe Vagrant::LXC::Driver do
|
||||||
|
|
||||||
describe 'state' do
|
describe 'state' do
|
||||||
let(:cli_state) { :something }
|
let(:cli_state) { :something }
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', state: cli_state) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', state: cli_state) }
|
||||||
|
|
||||||
subject { described_class.new('name', cli) }
|
subject { described_class.new('name', cli) }
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ describe Vagrant::LXC::Driver do
|
||||||
# This ip is set on the sample-ip-addr-output fixture
|
# This ip is set on the sample-ip-addr-output fixture
|
||||||
let(:ip) { "10.0.254.137" }
|
let(:ip) { "10.0.254.137" }
|
||||||
let(:ifconfig_output) { File.read('spec/fixtures/sample-ip-addr-output') }
|
let(:ifconfig_output) { File.read('spec/fixtures/sample-ip-addr-output') }
|
||||||
let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', :attach => ifconfig_output) }
|
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', :attach => ifconfig_output) }
|
||||||
|
|
||||||
subject { described_class.new('name', cli) }
|
subject { described_class.new('name', cli) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue