Sha256: 222966d6ae1be1128c1e001a9add94b18d0adb5fad0f734ea4c08822439180bd

Contents?: true

Size: 509 Bytes

Versions: 4

Compression:

Stored size: 509 Bytes

Contents

require 'spec_helper'

describe ROTP::HOTP do
  before(:all) { @counter = 1234 }

  subject { ROTP::HOTP.new('a' * 32) }

  it "should generate a number given a time" do
    subject.at(@counter).should == 161024
  end
  it "should generate a number as a string" do
    subject.at(@counter, true).should == "161024"
  end
  it "should verify a number" do
    subject.verify(161024, @counter).should be_true
  end
  it "should verify a string" do
    subject.verify("161024", @counter).should be_true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rotp-1.4.6 spec/hotp_spec.rb
rotp-1.4.5 spec/hotp_spec.rb
rotp-1.4.4 spec/hotp_spec.rb
rotp-1.4.3 spec/hotp_spec.rb