File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
lib/google/api_client/auth
spec/google/api_client/auth Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def write_credentials(authorization=nil)
57
57
# Loads credentials and authorizes an client.
58
58
# @return [Object] Signet::OAuth2::Client or NIL
59
59
def authorize
60
- @authorization = false
60
+ @authorization = nil
61
61
cached_credentials = load_credentials
62
62
if cached_credentials && cached_credentials . size > 0
63
63
@authorization = Signet ::OAuth2 ::Client . new ( cached_credentials )
Original file line number Diff line number Diff line change 38
38
client_stub . stub ( :expired? ) . and_return ( true )
39
39
Signet ::OAuth2 ::Client . should_receive ( :new ) . and_return ( client_stub )
40
40
subject . should_receive ( :refresh_authorization )
41
- subject . authorize
41
+ auth = subject . authorize
42
+ auth . should == subject . authorization
43
+ auth . should_not be_nil
42
44
end
43
45
end
44
46
45
47
describe 'without credentials' do
46
48
47
- it 'should return false' do
49
+ it 'should return nil' do
50
+ subject . authorization . should be_nil
48
51
subject . should_receive ( :load_credentials ) . and_return ( { } )
49
- subject . authorize . should be_false
52
+ subject . authorize . should be_nil
53
+ subject . authorization . should be_nil
50
54
end
51
55
end
52
56
end
You can’t perform that action at this time.
0 commit comments