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

33 lines
932 B
Ruby

require File.expand_path("../../../../base", __FILE__)
describe VagrantPlugins::GuestAlpine::Plugin do
let(:manager) { double("manager") }
before do
allow(Vagrant::Plugin::Manager).to receive(:instance).and_return(manager)
end
context "when vagrant-alpine plugin is not installed" do
before do
allow(manager).to receive(:installed_plugins).and_return({})
end
it "should not display a warning" do
expect($stderr).to_not receive(:puts)
VagrantPlugins::GuestAlpine::Plugin.check_community_plugin
end
end
context "when vagrant-alpine plugin is installed" do
before do
allow(manager).to receive(:installed_plugins).and_return({ "vagrant-alpine" => {} })
end
it "should display a warning" do
expect($stderr).to receive(:puts).with(/vagrant plugin uninstall vagrant-alpine/)
VagrantPlugins::GuestAlpine::Plugin.check_community_plugin
end
end
end