test/tc_fog.rb in crypt-fog-1.0.0 vs test/tc_fog.rb in crypt-fog-1.0.1

- old
+ new

@@ -1,53 +1,46 @@ ############################# # tc_fog.rb # # Test suite for crypt-fog. ############################# -base = File.basename(Dir.pwd) - -if base == "test" || base =~ /crypt-fog/ - Dir.chdir("..") if base == "test" - $LOAD_PATH.unshift Dir.pwd - $LOAD_PATH.unshift Dir.pwd + "/lib" -end - require "test/unit" require "crypt/fog" include Crypt class TC_Fog < Test::Unit::TestCase def setup - @f = Fog.new("hello") + @fog = Fog.new("hello") end def test_version - assert_equal("1.0.0", Fog::VERSION, "Bad 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_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)) + 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(@f, :decrypt) - assert_nothing_raised{ @f.decrypt } - assert_equal("hello", @f.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, @f) - assert_kind_of(String, @f.decrypt) + assert_kind_of(Crypt::Fog, @fog) + assert_kind_of(String, @fog.decrypt) end def teardown - @f = nil + @fog = nil end end