Install rsync on Haiku
This commit is contained in:
parent
c1283c3c66
commit
a50432cf16
15
plugins/guests/haiku/cap/rsync.rb
Normal file
15
plugins/guests/haiku/cap/rsync.rb
Normal file
@ -0,0 +1,15 @@
|
||||
module VagrantPlugins
|
||||
module GuestHaiku
|
||||
module Cap
|
||||
class RSync
|
||||
def self.rsync_installed(machine)
|
||||
machine.communicate.test("test -f /bin/rsync")
|
||||
end
|
||||
|
||||
def self.rsync_install(machine)
|
||||
machine.communicate.execute("pkgman install -y rsync")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -30,6 +30,16 @@ module VagrantPlugins
|
||||
require_relative "cap/remove_public_key"
|
||||
Cap::RemovePublicKey
|
||||
end
|
||||
|
||||
guest_capability(:haiku, :rsync_install) do
|
||||
require_relative "cap/rsync"
|
||||
Cap::RSync
|
||||
end
|
||||
|
||||
guest_capability(:haiku, :rsync_installed) do
|
||||
require_relative "cap/rsync"
|
||||
Cap::RSync
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
38
test/unit/plugins/guests/haiku/cap/rsync_test.rb
Normal file
38
test/unit/plugins/guests/haiku/cap/rsync_test.rb
Normal file
@ -0,0 +1,38 @@
|
||||
require_relative "../../../../base"
|
||||
|
||||
describe "VagrantPlugins::GuestHaiku::Cap::RSync" do
|
||||
let(:caps) do
|
||||
VagrantPlugins::GuestHaiku::Plugin
|
||||
.components
|
||||
.guest_capabilities[:haiku]
|
||||
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("pkgman install -y 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 /bin/rsync")
|
||||
cap.rsync_installed(machine)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user