Commit 63fa2be

mo khan <mo@mokhan.ca>
2014-07-25 20:02:32
add spec for reading out the secret.
1 parent 553f420
Changed files (1)
spec/lib/show_command_spec.rb
@@ -0,0 +1,16 @@
+module In
+  describe ShowCommand do
+    subject { ShowCommand.new(storage) }
+    let(:storage) { PStore.new(Tempfile.new('blah').path) }
+
+    it "retrieves the secret associated with the key given" do
+      secret = SecureRandom.uuid
+      storage.transaction do
+        storage['production'] = secret
+      end
+
+      result = subject.run(['production'])
+      expect(result).to eql(secret)
+    end
+  end
+end