Sha256: abd089cc2ed6f1a4947a70264eafd315a82e9c0d7f13fbf420b141aa655a0eb0

Contents?: true

Size: 1.43 KB

Versions: 9

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'

describe Ridley::BootstrapBinding 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 do
      Class.new do
        include Ridley::BootstrapBinding
      end
    end

    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

9 entries across 9 versions & 1 rubygems

Version Path
ridley-0.12.4 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.12.3 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.12.2 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.12.1 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.12.0 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.11.2 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.12.0.rc1 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.11.1 spec/unit/ridley/mixin/bootstrap_binding_spec.rb
ridley-0.11.0.rc1 spec/unit/ridley/mixin/bootstrap_binding_spec.rb