vagrant/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb

31 lines
785 B
Ruby

require_relative "../../../../base"
describe "VagrantPlugins::GuestRedHat::Cap:NFSClient" do
let(:caps) do
VagrantPlugins::GuestRedHat::Plugin
.components
.guest_capabilities[:redhat]
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 ".nfs_client_install" do
let(:cap) { caps.get(:nfs_client_install) }
it "installs nfs client" do
cap.nfs_client_install(machine)
expect(comm.received_commands[0]).to match(/install nfs-utils/)
expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs/)
end
end
end