Sha256: 6e33bb8213a2af9af7dd366f88bc149cbe4a67a2c3b45036cd201081036765af

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

require "test_helper"

describe SecureCompare do
  it "should return true for equal strings" do
    SecureCompare.secure_compare("abc", "abc").must_equal(true)
  end

  it "should return false for not equal strings" do
    SecureCompare.secure_compare("abc", "def").must_equal(false)
  end

  it "should respond to compare" do
    SecureCompare.must_respond_to(:compare)
  end

  it "should add secure_compare to anything that includes it" do
    klass = Class.new
    klass.send(:include, SecureCompare)
    klass.private_instance_methods.include?(:secure_compare).must_equal(true)
  end

  it "should add secure_compare to anything that extends it" do
    klass = Class.new
    klass.send(:extend, SecureCompare)
    klass.private_methods.include?(:secure_compare).must_equal(true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
securecompare-1.0.0 test/securecompare_test.rb