Sha256: 38e4b364f3f6d409208e039ece0cc1f888c671f8d95596e83836d108108aeca0

Contents?: true

Size: 590 Bytes

Versions: 6

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

describe SecretService do

  describe '.secret' do

    let(:store) { double('store') }

    before do
      SecretService::Store.stub :new => store
    end

    it 'should delegate to the store' do
      store.should_receive(:get).with('source secret').and_return('final secret')
      SecretService.secret('source secret').should == 'final secret'
    end

    it 'should cache' do
      store.should_receive(:get).exactly(:once).and_return('final secret')
      SecretService.secret('source secret')
      SecretService.secret('source secret')
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
secret_service-0.1.5 spec/shared/secret_service/secret_service_spec.rb
secret_service-0.1.4 spec/shared/secret_service/secret_service_spec.rb
secret_service-0.1.3 spec/shared/secret_service/secret_service_spec.rb
secret_service-0.1.2 spec/shared/secret_service/secret_service_spec.rb
secret_service-0.1.1 spec/shared/secret_service/secret_service_spec.rb
secret_service-0.1.0 spec/shared/secret_service/secret_service_spec.rb