Sha256: 85b0e8e9c592782b408d740741e3545554681f5c118d70a5f390aff5b5787175

Contents?: true

Size: 694 Bytes

Versions: 12

Compression:

Stored size: 694 Bytes

Contents

require File.expand_path('../helper', __FILE__)

class TestCrypto < Test::Unit::TestCase
  def setup
    @fixtures = File.expand_path('../fixtures/rsa_keys', __FILE__)

    FileUtils.rm_r @fixtures, :force => true
    FileUtils.mkdir_p @fixtures
  end

  def create_keys!(bits = 4096)
    Crypto.create_keys("#{@fixtures}/rsa_key", "#{@fixtures}/rsa_key.pub", bits)
  end

  def load_keys
    @priv_key = Crypto::Key.from_file("#{@fixtures}/rsa_key")
    @pub_key =  Crypto::Key.from_file("#{@fixtures}/rsa_key.pub")
	end

  def test_create_keys
    create_keys!

    assert_not_nil File.open("#{@fixtures}/rsa_key").read
    assert_not_nil File.open("#{@fixtures}/rsa_key.pub").read
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
encbs-0.2.5.1 test/test_crypto.rb
encbs-0.2.5 test/test_crypto.rb
encbs-0.2.4.6 test/test_crypto.rb
encbs-0.2.4.5 test/test_crypto.rb
encbs-0.2.4.4 test/test_crypto.rb
encbs-0.2.4.3 test/test_crypto.rb
encbs-0.2.4.2 test/test_crypto.rb
encbs-0.2.4.1 test/test_crypto.rb
encbs-0.2.4 test/test_crypto.rb
encbs-0.2.3 test/test_crypto.rb
encbs-0.2.2 test/test_crypto.rb
encbs-0.2.1 test/test_crypto.rb