guests/omnios: Add rsync_install functionality

This commit is contained in:
Seth Vargo 2016-06-05 16:19:45 -04:00
parent c441732c59
commit d7bc7c2267
No known key found for this signature in database
GPG Key ID: 905A90C2949E8787
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,11 @@
module VagrantPlugins
module GuestOmniOS
module Cap
class RSync
def self.rsync_install(machine)
machine.communicate.sudo("pkg install rsync")
end
end
end
end
end

View File

@ -0,0 +1,29 @@
require_relative "../../../../base"
describe "VagrantPlugins::GuestOmniOS::Cap:RSync" do
let(:caps) do
VagrantPlugins::GuestOmniOS::Plugin
.components
.guest_capabilities[:omnios]
end
let(:machine) { double("machine") }
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
allow(machine).to receive(:communicate).and_return(comm)
end
after do
comm.verify_expectations!
end
describe ".rsync_install" do
let(:cap) { caps.get(:rsync_install) }
it "installs rsync" do
cap.rsync_install(machine)
expect(comm.received_commands[0]).to match(/pkg install rsync/)
end
end
end