Skip to content

Commit

Permalink
[project @ Store tests: separate cleanup tests from other store tests]
Browse files Browse the repository at this point in the history
Ignore-this: 49ce6bc616af0deb063d8b1a9633ee0a
  • Loading branch information
tailor committed Jun 29, 2009
1 parent 32b73cf commit 3df3125
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test_stores.rb
Expand Up @@ -49,7 +49,6 @@ def _check_remove(url, handle, expected)
end

def test_store
server_url = "http://www.myopenid.com/openid"
assoc = _gen_assoc(issued=0)

# Make sure that a missing association returns no result
Expand Down Expand Up @@ -134,7 +133,9 @@ def test_store
_check_remove(server_url, assoc2.handle, false)
_check_remove(server_url, assoc.handle, false)
_check_remove(server_url, assoc3.handle, false)
end

def test_assoc_cleanup
assocValid1 = _gen_assoc(-3600, 7200)
assocValid2 = _gen_assoc(-5)
assocExpired1 = _gen_assoc(-7200, 3600)
Expand All @@ -156,8 +157,11 @@ def _check_use_nonce(nonce, expected, server_url, msg='')
assert_equal(expected, actual, msg)
end

def server_url
"http://www.myopenid.com/openid"
end

def test_nonce
server_url = "http://www.myopenid.com/openid"
[server_url, ''].each{|url|
nonce1 = Nonce::mk_nonce

Expand All @@ -170,7 +174,9 @@ def test_nonce
_check_use_nonce(old_nonce, false, url, "Old nonce #{old_nonce.inspect} passed")

}
end

def test_nonce_cleanup
now = Time.now.to_i
old_nonce1 = Nonce::mk_nonce(now - 20000)
old_nonce2 = Nonce::mk_nonce(now - 10000)
Expand Down

0 comments on commit 3df3125

Please sign in to comment.