lib/certmeister/test/memory_store_interface.rb in certmeister-1.2.1 vs lib/certmeister/test/memory_store_interface.rb in certmeister-2.0.0
- old
+ new
@@ -30,9 +30,24 @@
subject.store('axl.hetzner.africa', "cert")
expect(subject.remove('axl.hetzner.africa')).to be true
expect(subject.fetch('axl.hetzner.africa')).to be_nil
end
+ it "is enumerable" do
+ expect(subject).to be_a(Enumerable)
+ end
+
+ it "iterates certificates by cn" do
+ subject.store('axl.hetzner.africa', "hetzner-cert")
+ subject.store('axl.starjuice.net', "hetzner-cert")
+ received = {}
+ subject.each do |cn, cert|
+ expect(received).to_not include(cn)
+ received[cn] = cert
+ end
+ expect(received).to eql({'axl.hetzner.africa' => "hetzner-cert", 'axl.starjuice.net' => "hetzner-cert"})
+ end
+
it "returns false when removing a non-existent CN" do
expect(subject.remove('axl.hetzner.africa')).to be false
end
it "returns true from health_check when healthy" do