Sha256: bf1f0670789a8aad5702520996b6f882540358a6f750d1402924233a800efeed

Contents?: true

Size: 711 Bytes

Versions: 13

Compression:

Stored size: 711 Bytes

Contents

require "spec_helper"

describe Arrthorizer::Registry do
  subject(:registry) { Arrthorizer::Registry.new }

  context "when the requested value is not in the Registry" do
    context "and no default value was specified" do
      it "raises an Arrthorizer::Registry::NotFound" do
        expect {
          registry.fetch("some_value")
        }.to raise_error(Arrthorizer::Registry::NotFound)
      end
    end

    context "and a default value was specified" do
      subject(:registry) { Arrthorizer::Registry.new }
      let(:default) { :default }

      it "returns the default" do
        actual = registry.fetch("some_value") { default }
        expect(actual).to eq(default)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
arrthorizer-0.4.2 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.4.1 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.3.2 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.3.1 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.3.0 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.2.1 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.2.0 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.3 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.2 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.1 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.0 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.0.pre2 spec/integration/registry/missing_handler_spec.rb
arrthorizer-0.1.0.pre spec/integration/registry/missing_handler_spec.rb