Sha256: 969b0956a4475fa41f9bbe322d2948bffa8082562f7f570222696e3466d43b4f

Contents?: true

Size: 1.38 KB

Versions: 41

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

describe Ridley::BootstrapContext::Base 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: File.read(fixtures_path.join("reset.pem")),
      chef_version: "11.4.0"
    }
  end

  describe "ClassMethods" do
    subject { described_class }

    describe ":included" do
      context "when a class includes Ridley::BootstrapBinding" do
        it "should have a validate_options class method`" do
          subject.methods.should include(:validate_options)
        end
      end
    end

    describe ":validate_options" do
      context "when server_url is not specified" do
        let(:options) { Hash.new }

        it "raises an ArgumentError" do
          expect {
            subject.validate_options(options)
          }.to raise_error(Ridley::Errors::ArgumentError)
        end
      end
    end

    context "when validator_path is not specified" do
      let(:options) do
        {
          server_url: "https://api.opscode.com/organizations/vialstudios"
        }
      end

      it "raises an ArgumentError" do
        expect {
          subject.validate_options(options)
        }.to raise_error(Ridley::Errors::ArgumentError)
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
ridley-3.0.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-3.0.0.rc1 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.5.1 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.5.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.4.4 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.4.3 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.4.2 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.4.1 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.4.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.3.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.2.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.1.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-2.0.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.7.1 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.7.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.6.0 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.5.3 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.2.6 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.5.2 spec/unit/ridley/bootstrap_context_spec.rb
ridley-1.5.1 spec/unit/ridley/bootstrap_context_spec.rb