test/base32_test.rb in base32-0.1.1 vs test/base32_test.rb in base32-0.1.2

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (c) 2007 Samuel Tesla +# Copyright (c) 2007-2009 Samuel Tesla # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -21,14 +21,18 @@ require 'test/unit' require 'base32' class TestBase32 < Test::Unit::TestCase def assert_decoding(encoded, plain) - assert_equal(plain, Base32.decode(encoded)) + decoded = Base32.decode(encoded) + assert_equal(plain, decoded) + assert_equal(decoded.size, Base32Test.strlen(decoded)) end def assert_encoding(encoded, plain) - assert_equal(encoded, Base32.encode(plain)) + actual = Base32.encode(plain) + assert_equal(encoded, actual) + assert_equal(actual.size, Base32Test.strlen(actual)) end def assert_encode_and_decode(encoded, plain) assert_encoding(encoded, plain) assert_decoding(encoded, plain)