From 09208a0d28ecb33ea0720f1ebff04d7df795f174 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 13 Jul 2013 13:41:39 -0300 Subject: [PATCH] mock/stub -> double --- spec/unit/action/clear_forwarded_ports_spec.rb | 6 +++--- spec/unit/action/compress_rootfs_spec.rb | 4 ++-- spec/unit/action/forward_ports_spec.rb | 6 +++--- spec/unit/action/handle_box_metadata_spec.rb | 8 ++++---- spec/unit/action/setup_package_files_spec.rb | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/unit/action/clear_forwarded_ports_spec.rb b/spec/unit/action/clear_forwarded_ports_spec.rb index c111032..af1380e 100644 --- a/spec/unit/action/clear_forwarded_ports_spec.rb +++ b/spec/unit/action/clear_forwarded_ports_spec.rb @@ -3,9 +3,9 @@ require 'unit_helper' require 'vagrant-lxc/action/clear_forwarded_ports' describe Vagrant::LXC::Action::ClearForwardedPorts do - let(:app) { mock(:app, call: true) } - let(:env) { {machine: machine, ui: stub(info: true)} } - let(:machine) { mock(:machine, data_dir: data_dir) } + let(:app) { double(:app, call: true) } + let(:env) { {machine: machine, ui: double(info: true)} } + let(:machine) { double(:machine, data_dir: data_dir) } let!(:data_dir) { Pathname.new(Dir.mktmpdir) } let(:pids_dir) { data_dir.join('pids') } let(:pid) { 'a-pid' } diff --git a/spec/unit/action/compress_rootfs_spec.rb b/spec/unit/action/compress_rootfs_spec.rb index b1caa8f..2a70ba4 100644 --- a/spec/unit/action/compress_rootfs_spec.rb +++ b/spec/unit/action/compress_rootfs_spec.rb @@ -3,8 +3,8 @@ require 'unit_helper' 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(: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) } diff --git a/spec/unit/action/forward_ports_spec.rb b/spec/unit/action/forward_ports_spec.rb index 9dc2253..c9c6c70 100644 --- a/spec/unit/action/forward_ports_spec.rb +++ b/spec/unit/action/forward_ports_spec.rb @@ -3,9 +3,9 @@ require 'unit_helper' require 'vagrant-lxc/action/forward_ports' describe Vagrant::LXC::Action::ForwardPorts do - let(:app) { mock(:app, call: true) } - let(:env) { {machine: machine, ui: stub(info: true)} } - let(:machine) { mock(:machine) } + let(:app) { double(:app, call: true) } + let(:env) { {machine: machine, ui: double(info: true)} } + let(:machine) { double(:machine) } let!(:data_dir) { Pathname.new(Dir.mktmpdir) } let(:networks) { [[:other_config, {}], [:forwarded_port, {guest: guest_port, host: host_port}]] } let(:host_port) { 8080 } diff --git a/spec/unit/action/handle_box_metadata_spec.rb b/spec/unit/action/handle_box_metadata_spec.rb index 578fbf9..973948b 100644 --- a/spec/unit/action/handle_box_metadata_spec.rb +++ b/spec/unit/action/handle_box_metadata_spec.rb @@ -5,10 +5,10 @@ require 'vagrant-lxc/errors' require 'vagrant-lxc/action/handle_box_metadata' describe Vagrant::LXC::Action::HandleBoxMetadata do - let(:app) { mock(:app, call: true) } - let(:env) { {machine: machine, ui: stub(info: true)} } - let(:machine) { mock(:machine, box: box) } - let(:box) { mock(:box, name: 'box-name', metadata: metadata, directory: box_directory) } + let(:app) { double(:app, call: true) } + let(:env) { {machine: machine, ui: double(info: true)} } + let(:machine) { double(:machine, box: box) } + let(:box) { double(:box, name: 'box-name', metadata: metadata, directory: box_directory) } let(:box_directory) { Pathname.new('/path/to/box') } let(:version) { '2' } let(:metadata) { {'template-opts' => {'--foo' => 'bar'}, 'version' => version} } diff --git a/spec/unit/action/setup_package_files_spec.rb b/spec/unit/action/setup_package_files_spec.rb index 3c9a986..6c1c042 100644 --- a/spec/unit/action/setup_package_files_spec.rb +++ b/spec/unit/action/setup_package_files_spec.rb @@ -3,8 +3,8 @@ require 'unit_helper' 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(:app) { double(:app, call: true) } + let(:env) { {machine: machine, tmp_path: tmp_path, ui: double(info: true), 'package.rootfs' => rootfs_path} } let(:machine) { instance_double('Vagrant::Machine', box: box) } let!(:tmp_path) { Pathname.new(Dir.mktmpdir) } let(:box) { instance_double('Vagrant::Box', directory: tmp_path.join('box')) }