guests/suse: Configure rsync in one command
This commit is contained in:
parent
c259032f80
commit
c9f21a1852
|
@ -7,9 +7,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.rsync_install(machine)
|
def self.rsync_install(machine)
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.sudo("zypper -n install rsync")
|
||||||
comm.sudo("zypper -n install rsync")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
require_relative "../../../../base"
|
||||||
|
|
||||||
|
describe "VagrantPlugins::GuestSUSE::Cap::RSync" do
|
||||||
|
let(:caps) do
|
||||||
|
VagrantPlugins::GuestSUSE::Plugin
|
||||||
|
.components
|
||||||
|
.guest_capabilities[:suse]
|
||||||
|
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
|
||||||
|
comm.expect_command("zypper -n install rsync")
|
||||||
|
cap.rsync_install(machine)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe ".rsync_installed" do
|
||||||
|
let(:cap) { caps.get(:rsync_installed) }
|
||||||
|
|
||||||
|
it "checks if rsync is installed" do
|
||||||
|
comm.expect_command("test -f /usr/bin/rsync")
|
||||||
|
cap.rsync_installed(machine)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue