Sha256: 6e910fe34ec8b785967732a73429e3e85f748a9620e20d9c8c39bb428bf272b6

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

#############################
# tc_fog.rb
#
# Test suite for crypt-fog.
#############################
require "test/unit"
require "crypt/fog"
include Crypt

class TC_Fog < Test::Unit::TestCase
   def setup
      @fog = Fog.new("hello")
   end

   def test_version
      assert_equal('1.0.1', Fog::VERSION)
   end

   def test_constructor
      assert_nothing_raised{ Fog.new('string') }
      assert_nothing_raised{ Fog.new('string', 55) }
      assert_kind_of(String, Fog.new('string'))
   end

   def test_class_decrypt
      assert_respond_to(Fog, :decrypt)
      assert_nothing_raised{ Fog.decrypt('string') }
      assert_nothing_raised{ Fog.decrypt('string', 66) }
      assert_equal('hello', Fog.decrypt(';8??B', 2003))
   end

   def test_instance_decrypt
      assert_respond_to(@fog, :decrypt)
      assert_nothing_raised{ @fog.decrypt }
      assert_equal('hello', @fog.decrypt)
   end

   def test_types
      assert_kind_of(Crypt::Fog, @fog)
      assert_kind_of(String, @fog.decrypt)
   end

   def teardown
      @fog = nil
   end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crypt-fog-1.0.1 test/tc_fog.rb