Sha256: e3c6d7e36a958dc1a5099d912c7b7025b1d55ea785eb326fdc077a20ab3f965c

Contents?: true

Size: 923 Bytes

Versions: 3

Compression:

Stored size: 923 Bytes

Contents

require File.expand_path("../../../../../base", __FILE__)

describe "VagrantPlugins::GuestTinyCore::Cap::ChangeHostName" do
  let(:described_class) do
    VagrantPlugins::GuestTinyCore::Plugin.components.guest_capabilities[:tinycore].get(:change_host_name)
  end
  let(:machine) { double("machine") }
  let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
  let(:old_hostname) { 'boot2docker' }

  before do
    allow(machine).to receive(:communicate).and_return(communicator)
    communicator.stub_command('hostname -f', stdout: old_hostname)
  end

  after do
    communicator.verify_expectations!
  end

  describe ".change_host_name" do
    it "refreshes the hostname service with the sethostname command" do
      communicator.expect_command(%q(/usr/bin/sethostname newhostname.newdomain.tld))
      described_class.change_host_name(machine, 'newhostname.newdomain.tld')
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
vagrant-unbundled-1.8.1.2 test/unit/plugins/guests/tinycore/cap/change_host_name_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/guests/tinycore/cap/change_host_name_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/test/unit/plugins/guests/tinycore/cap/change_host_name_test.rb