Commit 9428722

mokha <mokha@cisco.com>
2018-12-03 04:16:34
require a name for a totp
1 parent f74e6d2
Changed files (2)
lib
spec
lib/tfa/cli.rb
@@ -24,7 +24,7 @@ module TFA
     end
 
     desc "totp NAME", "generate a Time based One Time Password using the secret associated with the given NAME."
-    def totp(name = nil)
+    def totp(name)
       TotpCommand.new(storage).run(name)
     end
 
spec/lib/cli_spec.rb
@@ -61,17 +61,6 @@ module TFA
           expect(subject.totp(key)).to eql(code_for(dev_secret))
         end
       end
-
-      context "when no key is given" do
-        it "returns a time based one time password for all keys" do
-          subject.add(SecureRandom.uuid, dev_secret)
-          subject.add(SecureRandom.uuid, prod_secret)
-
-          result = subject.totp.to_s
-          expect(result).to include(code_for(dev_secret))
-          expect(result).to include(code_for(prod_secret))
-        end
-      end
     end
 
     describe "#destroy" do