summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/storage_spec.rb14
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