Skip to content

Commit

Permalink
Stub out logger so tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 14, 2008
1 parent ad450f3 commit 0209777
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/open_id_authentication_test.rb
Expand Up @@ -11,7 +11,8 @@ def params() {} end
def test_authentication_should_fail_when_the_identity_server_is_missing
open_id_consumer = mock()
open_id_consumer.expects(:begin).raises(OpenID::OpenIDError)
@controller.stubs(:open_id_consumer).returns(open_id_consumer)
@controller.expects(:open_id_consumer).returns(open_id_consumer)
@controller.expects(:logger).returns(mock(:error => true))

@controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
assert result.missing?
Expand All @@ -22,7 +23,8 @@ def test_authentication_should_fail_when_the_identity_server_is_missing
def test_authentication_should_fail_when_the_identity_server_times_out
open_id_consumer = mock()
open_id_consumer.expects(:begin).raises(Timeout::Error, "Identity Server took too long.")
@controller.stubs(:open_id_consumer).returns(open_id_consumer)
@controller.expects(:open_id_consumer).returns(open_id_consumer)
@controller.expects(:logger).returns(mock(:error => true))

@controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
assert result.missing?
Expand All @@ -31,7 +33,6 @@ def test_authentication_should_fail_when_the_identity_server_times_out
end

def test_authentication_should_begin_when_the_identity_server_is_present
@controller.stubs(:open_id_consumer).returns(stub(:begin => true))
@controller.expects(:begin_open_id_authentication)
@controller.send(:authenticate_with_open_id, "http://someone.example.com")
end
Expand Down

0 comments on commit 0209777

Please sign in to comment.