diff --git a/spec/unit/action/compress_rootfs_spec.rb b/spec/unit/action/compress_rootfs_spec.rb index bedc9c5..b1caa8f 100644 --- a/spec/unit/action/compress_rootfs_spec.rb +++ b/spec/unit/action/compress_rootfs_spec.rb @@ -5,9 +5,9 @@ require 'vagrant-lxc/action/compress_rootfs' describe Vagrant::LXC::Action::CompressRootFS do let(:app) { mock(:app, call: true) } let(:env) { {machine: machine, ui: stub(info: true)} } - let(:machine) { fire_double('Vagrant::Machine', provider: provider) } - let(:provider) { fire_double('Vagrant::LXC::Provider', driver: driver) } - let(:driver) { fire_double('Vagrant::LXC::Driver', compress_rootfs: compressed_rootfs_path) } + 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) } diff --git a/spec/unit/action/forward_ports_spec.rb b/spec/unit/action/forward_ports_spec.rb index 4c31edc..9dc2253 100644 --- a/spec/unit/action/forward_ports_spec.rb +++ b/spec/unit/action/forward_ports_spec.rb @@ -10,8 +10,8 @@ describe Vagrant::LXC::Action::ForwardPorts do let(:networks) { [[:other_config, {}], [:forwarded_port, {guest: guest_port, host: host_port}]] } let(:host_port) { 8080 } let(:guest_port) { 80 } - let(:provider) { fire_double('Vagrant::LXC::Provider', driver: driver) } - let(:driver) { fire_double('Vagrant::LXC::Driver', assigned_ip: container_ip) } + let(:provider) { instance_double('Vagrant::LXC::Provider', driver: driver) } + let(:driver) { instance_double('Vagrant::LXC::Driver', assigned_ip: container_ip) } let(:container_ip) { '10.0.1.234' } let(:pid) { 'a-pid' } diff --git a/spec/unit/action/setup_package_files_spec.rb b/spec/unit/action/setup_package_files_spec.rb index c5a4c7b..3c9a986 100644 --- a/spec/unit/action/setup_package_files_spec.rb +++ b/spec/unit/action/setup_package_files_spec.rb @@ -5,9 +5,9 @@ require 'vagrant-lxc/action/setup_package_files' describe Vagrant::LXC::Action::SetupPackageFiles do let(:app) { mock(:app, call: true) } 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(: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') } subject { described_class.new(app, env) } diff --git a/spec/unit/driver_spec.rb b/spec/unit/driver_spec.rb index f657648..b062bb9 100644 --- a/spec/unit/driver_spec.rb +++ b/spec/unit/driver_spec.rb @@ -9,7 +9,7 @@ describe Vagrant::LXC::Driver do let(:unknown_container) { described_class.new('unknown', cli) } let(:valid_container) { described_class.new('valid', cli) } 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 expect { @@ -37,7 +37,7 @@ describe Vagrant::LXC::Driver do let(:template_opts) { {'--some' => 'random-option'} } let(:config_file) { '/path/to/lxc-config-from-box' } 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) } @@ -60,7 +60,7 @@ describe Vagrant::LXC::Driver do end 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) } @@ -75,7 +75,7 @@ describe Vagrant::LXC::Driver do let(:customizations) { [['a', '1'], ['b', '2']] } let(:internal_customization) { ['internal', 'customization'] } 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) } @@ -95,7 +95,7 @@ describe Vagrant::LXC::Driver do end 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) } @@ -123,7 +123,7 @@ describe Vagrant::LXC::Driver do describe 'state' do 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) } @@ -136,7 +136,7 @@ describe Vagrant::LXC::Driver do # This ip is set on the sample-ip-addr-output fixture let(:ip) { "10.0.254.137" } 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) }