Sha256: 76096331013f96d9b9b51e1338a21189bcac40b2f11092e61e6d0913f6efda51

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

Stored size: 736 Bytes

Contents

require 'helper'

class TestKanokoConfigure < Minitest::Test
  def setup
    @config = Kanoko::Configure.new
  end

  def test_hash_proc_by_default_error
    @config.digest_func = nil
    @config.secret_key = nil
    assert_raises(Kanoko::ConfigureError){ @config.hash_proc.call }

    @config.digest_func = "sha1"
    @config.secret_key = nil
    assert_raises(Kanoko::ConfigureError){ @config.hash_proc.call }

    @config.digest_func = nil
    @config.secret_key = "test"
    assert_raises(Kanoko::ConfigureError){ @config.hash_proc.call }
  end

  def test_hash_proc_by_default
    @config.digest_func = "sha1"
    @config.secret_key = "test"
    assert_equal "yrYrwA2D_XJwEyaWOr3S8GPWtd8=", @config.hash_proc.call("aaa")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kanoko-0.1.3 test/test_configure.rb
kanoko-0.1.2 test/test_configure.rb
kanoko-0.1.1 test/test_configure.rb