dumbwaiter 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dumbwaiter/mock.rb +0 -8
- data/lib/dumbwaiter/user_profile.rb +1 -0
- data/lib/dumbwaiter/version.rb +1 -1
- data/spec/lib/dumbwaiter/user_profile_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 144e43406270d861ff03250b42717c1fca4cb17a
|
4
|
+
data.tar.gz: 90cf16676be9fdc75536391367a8f043aa4260a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 326d414c33245ea31395736b969ed59b59cf7640c8e727b742805405cedfa91a5efc5d05d1b83381ddb3b156d96fdb4590f2fb8bcdd86802271665ffdad806a1
|
7
|
+
data.tar.gz: a877c62dd926ec4b2befa11eda73a5b013acff804ba817243bd67d583fc3e81bf1c36688ca8825a5a5f2b9d28da5695264c577117eeee781f19f4e6d201985f8
|
data/lib/dumbwaiter/mock.rb
CHANGED
@@ -86,14 +86,6 @@ class Dumbwaiter::Mock
|
|
86
86
|
instance
|
87
87
|
end
|
88
88
|
|
89
|
-
def create_instance(params = {})
|
90
|
-
params[:stack_id] ||= create_stack.stack_id
|
91
|
-
params[:layer_id] ||= create_layer.layer_id
|
92
|
-
instance = OpenStruct.new(params.merge(instance_id: make_id))
|
93
|
-
instances << instance
|
94
|
-
instance
|
95
|
-
end
|
96
|
-
|
97
89
|
def create_user_profile(params = {})
|
98
90
|
params[:iam_user_arn] ||= Faker::Name.first_name.downcase
|
99
91
|
params[:ssh_username] ||= Faker::Name.first_name.downcase
|
@@ -6,6 +6,7 @@ class Dumbwaiter::UserProfile
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.find(iam_user_arn, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
|
9
|
+
return nil if iam_user_arn.nil?
|
9
10
|
unless cache.has_key?(iam_user_arn)
|
10
11
|
cache[iam_user_arn] = opsworks.describe_user_profiles(iam_user_arns: [iam_user_arn]).user_profiles.detect { |p| p.iam_user_arn == iam_user_arn }
|
11
12
|
end
|
data/lib/dumbwaiter/version.rb
CHANGED
@@ -22,5 +22,16 @@ describe Dumbwaiter::UserProfile do
|
|
22
22
|
Dumbwaiter::UserProfile.find("schwarz", fake_opsworks)
|
23
23
|
Dumbwaiter::UserProfile.find("schwarz", fake_opsworks)
|
24
24
|
end
|
25
|
+
|
26
|
+
context "when the incoming user arn is nil" do
|
27
|
+
it "returns nil" do
|
28
|
+
Dumbwaiter::UserProfile.find(nil, fake_opsworks).should be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
it "does not ask opsworks for the user profile" do
|
32
|
+
fake_opsworks.should_not_receive(:describe_user_profiles)
|
33
|
+
Dumbwaiter::UserProfile.find(nil, fake_opsworks)
|
34
|
+
end
|
35
|
+
end
|
25
36
|
end
|
26
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumbwaiter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doc Ritezel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|