diff --git a/lib/openid/server.rb b/lib/openid/server.rb index 8fa1513d..6589495c 100644 --- a/lib/openid/server.rb +++ b/lib/openid/server.rb @@ -1240,7 +1240,7 @@ def initialize(server) # Raises ProtocolError when the query does not seem to be a valid # OpenID request. def decode(query) - if query.nil? or query.length == 0 + if query.nil? or query.empty? return nil end diff --git a/test/test_cryptutil.rb b/test/test_cryptutil.rb index 2f272545..33c83cf8 100644 --- a/test/test_cryptutil.rb +++ b/test/test_cryptutil.rb @@ -8,14 +8,14 @@ class CryptUtilTestCase < Minitest::Test def test_rand # If this is not true, the rest of our test won't work - assert(BIG.is_a?(Bignum)) + assert(BIG.is_a?(Integer)) # It's possible that these will be small enough for fixnums, but # extraorindarily unlikely. a = OpenID::CryptUtil.rand(BIG) b = OpenID::CryptUtil.rand(BIG) - assert(a.is_a?(Bignum)) - assert(b.is_a?(Bignum)) + assert(a.is_a?(Integer)) + assert(b.is_a?(Integer)) refute_equal(a, b) end