Sha256: 319a5e7ba3abb56f0bc28d9178d0d4757a77d59260ca62afc944baebc68e675e
Contents?: true
Size: 1.56 KB
Versions: 6
Compression:
Stored size: 1.56 KB
Contents
require 'spec_helper' describe Ridley::Bootstrapper::Context do let(:host) { "reset.riotgames.com" } let(:options) do { server_url: "https://api.opscode.com/organizations/vialstudios", validator_client: "chef-validator", validator_path: fixtures_path.join("reset.pem").to_s, encrypted_data_bag_secret_path: fixtures_path.join("reset.pem").to_s } end describe "ClassMethods" do subject { Ridley::Bootstrapper::Context } describe "::create" do context "when the best connection is SSH" do it "sets template_binding to a Ridley::UnixTemplateBinding" do Ridley::HostConnector.stub(:best_connector_for).and_return(Ridley::HostConnector::SSH) context = subject.create(host, options) context.template_binding.should be_a(Ridley::UnixTemplateBinding) end end context "when the best connection is WinRM" do it "sets template_binding to a Ridley::WindowsTemplateBinding" do Ridley::HostConnector.stub(:best_connector_for).and_return(Ridley::HostConnector::WinRM) context = subject.create(host, options) context.template_binding.should be_a(Ridley::WindowsTemplateBinding) end end context "when there is no good connection option" do it "raises an error" do Ridley::HostConnector.stub(:best_connector_for).and_return(nil) expect { context = subject.create(host, options) }.to raise_error(Ridley::Errors::HostConnectionError) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems