spec/action/install_command_spec.rb in vagrant-notify-0.5.3 vs spec/action/install_command_spec.rb in vagrant-notify-0.5.4
- old
+ new
@@ -6,11 +6,13 @@
describe Vagrant::Notify::Action::InstallCommand do
let(:app) { lambda { |env| } }
let(:config) { mock(notify: stub(enable: true, bind_ip: "127.0.0.1")) }
let(:env) { {notify_data: {port: host_port}, machine: machine, tmp_path: tmp_path} }
let(:host_port) { 12345 }
- let(:machine) { mock(communicate: communicator, config: config, provider_name: provider_name) }
+ let(:ui) { mock(warn: true)}
+ let(:name) { 'test-vm' }
+ let(:machine) { mock(communicate: communicator, config: config, provider_name: provider_name, ui: ui, name: name) }
let(:communicator) { mock(upload: true, sudo: true) }
let(:host_ip) { '192.168.1.2' }
let(:provider_name) { 'virtualbox' }
let(:tmp_path) { Pathname.new(Dir.mktmpdir) }
let(:tmp_cmd_path) { tmp_path.join('vagrant-notify-send') }
@@ -39,7 +41,11 @@
communicator.should have_received(:sudo).with("mv /usr/bin/{notify-send,notify-send.bkp}; exit 0")
end
it 'installs command for all users' do
communicator.should have_received(:sudo).with("mv #{guest_tmp_path} #{guest_path} && chmod +x #{guest_path}")
+ end
+
+ it 'verify if ruby is installed on guest' do
+ communicator.should have_received(:sudo).with("which ruby || true")
end
end