Files
ubicloud/spec/prog/vm/prep_host_spec.rb
Burak Velioglu 82541eee1c Colour the prompt of the VmHost for production hosts
Make the prompt color red for production hosts to
warn the operator.
2023-11-24 10:12:59 +03:00

22 lines
605 B
Ruby

# frozen_string_literal: true
require_relative "../../spec_helper"
RSpec.describe Prog::Vm::PrepHost do
subject(:ph) {
described_class.new(Strand.new)
}
describe "#start" do
it "prepare host" do
sshable = instance_double(Sshable)
vm_host = instance_double(VmHost, ubid: "vmhostubid")
expect(sshable).to receive(:cmd).with("sudo host/bin/prep_host.rb #{vm_host.ubid} test")
expect(ph).to receive(:sshable).and_return(sshable)
expect(ph).to receive(:vm_host).and_return(vm_host)
expect { ph.start }.to exit({"msg" => "host prepared"})
end
end
end