Jeff Bonhag 2fa44f5b8f
Fixes #11218: Update apk cache when installing rsync (#11220)
This ensures that rsync can be installed on an Alpine Linux machine where the
apk cache may not be current.

Display a warning if the vagrant-alpine plugin is installed, since Alpine guest
support has been merged into Vagrant core.
2019-12-17 12:34:53 -05:00

37 lines
1.2 KiB
Ruby

require_relative "../../../../base"
describe 'VagrantPlugins::GuestAlpine::Cap::RSync' do
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
allow(machine).to receive(:communicate).and_return(communicator)
end
after do
communicator.verify_expectations!
end
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:rsync_install)
end
it 'should install rsync with --update-cache flag' do
# communicator.should_receive(:sudo).with('apk add rsync')
expect(communicator).to receive(:sudo).with('apk add --update-cache rsync')
allow_message_expectations_on_nil
described_class.rsync_install(machine)
end
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:rsync_installed)
end
it 'should verify rsync installed' do
# communicator.should_receive(:test).with('test -f /usr/bin/rsync')
expect(communicator).to receive(:test).with('test -f /usr/bin/rsync')
allow_message_expectations_on_nil
described_class.rsync_installed(machine)
end
end