spec/keystore_spec.rb in slosilo-0.4.1 vs spec/keystore_spec.rb in slosilo-1.0.0
- old
+ new
@@ -8,9 +8,17 @@
it "handles Slosilo::Keys" do
subject.put(:test, key)
adapter['test'].to_der.should == rsa.to_der
end
+ it "refuses to store a key with a nil id" do
+ expect { subject.put(nil, key) }.to raise_error(ArgumentError)
+ end
+
+ it "refuses to store a key with an empty id" do
+ expect { subject.put('', key) }.to raise_error(ArgumentError)
+ end
+
it "passes the Slosilo key to the adapter" do
adapter.should_receive(:put_key).with "test", key
subject.put :test, key
end
end