Skip to content

Commit

Permalink
Strengthen test
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Jun 29, 2023
1 parent f8b5eea commit 08ce687
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions gems/aws-sdk-core/spec/aws/sso_credentials_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ module Aws
)
end

let(:in_one_hour) { Time.now + 60 * 60 }
let(:one_hour_ago) { Time.now - 60 * 60 }
let(:time) { Time.at(Time.now.to_i) }
let(:in_one_hour) { time + 60 * 60 }
let(:one_hour_ago) { time - 60 * 60 }
let(:expiration) { in_one_hour }

let(:sso_resp) do
{
role_credentials: {
access_key_id: 'akid',
secret_access_key: 'secret',
session_token: 'session',
expiration: expiration.to_i * 1000
access_key_id: 'akid',
secret_access_key: 'secret',
session_token: 'session',
expiration: expiration.to_i * 1000
}
}
end
Expand Down Expand Up @@ -137,9 +138,10 @@ def mock_token_file(start_url, cached_token)
end

describe '#expiration' do
it 'is a time' do
it 'parses expiration as Time' do
sso_creds = SSOCredentials.new(sso_opts)
expect(sso_creds.expiration).to be_a(Time)
expect(sso_creds.expiration).to eq(expiration)
end
end
end
Expand Down

0 comments on commit 08ce687

Please sign in to comment.