diff options
| author | mokha <mokha@cisco.com> | 2018-06-08 18:35:29 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-06-08 18:35:29 -0600 |
| commit | dccf02184fdc340a76fcb9bc61ed2aa5cd4160fa (patch) | |
| tree | b5130755ea10952098ae9ad2123af34fe9e34927 /spec | |
| parent | 909c088a1d758e77bbd44674f8bb8f8285ecc285 (diff) | |
extract context.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/storage_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/storage_spec.rb b/spec/storage_spec.rb index e665e42..3e9b543 100644 --- a/spec/storage_spec.rb +++ b/spec/storage_spec.rb @@ -5,10 +5,16 @@ RSpec.describe Locker::Storage do subject { described_class.new } let(:api_key) { SecureRandom.hex(32) } - it 'fetches the value that was previously stored' do - subject.store('development.api_key', api_key) - result = subject.fetch('development.api_key') - expect(result).to eql(api_key) + context "when several items are in storage" do + before :each do + subject.store('development.api_key', api_key) + subject.store('test.api_key', SecureRandom.hex(32)) + subject.store('production.api_key', SecureRandom.hex(32)) + end + + it 'fetches the value that was previously stored' do + expect(subject.fetch('development.api_key')).to eql(api_key) + end end end end |
