mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
IAM::Users#current
This commit is contained in:
parent
d0f6ae984d
commit
b037c3a86f
2 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,10 @@ module Fog
|
|||
load(data['Users']) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
def current
|
||||
new(service.get_user.body['User'])
|
||||
end
|
||||
|
||||
def get(identity)
|
||||
data = service.get_user(identity).body['User']
|
||||
new(data) # data is an attribute hash
|
||||
|
|
|
@ -38,6 +38,10 @@ Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
|
|||
@iam.users.get(@user_one_name).id == @user_one_name
|
||||
end
|
||||
|
||||
tests('#current').succeeds do
|
||||
@iam.users.current
|
||||
end
|
||||
|
||||
tests('#get',"returns nil if the user doesn't exists").succeeds do
|
||||
@iam.users.get('non-exists') == nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue