nephophobia 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/README.md +4 -0
  2. data/lib/nephophobia/client.rb +3 -3
  3. data/lib/nephophobia/compute.rb +70 -2
  4. data/lib/nephophobia/credential.rb +0 -19
  5. data/lib/nephophobia/project.rb +3 -0
  6. data/lib/nephophobia/role.rb +3 -0
  7. data/lib/nephophobia/user.rb +20 -0
  8. data/lib/nephophobia/version.rb +1 -1
  9. data/nephophobia.gemspec +2 -2
  10. data/test/cassettes/compute_allocate_address.yml +55 -0
  11. data/test/cassettes/compute_allocate_address_when_not_available.yml +30 -0
  12. data/test/cassettes/compute_associate_address.yml +136 -0
  13. data/test/cassettes/compute_disassociate_address.yml +163 -0
  14. data/test/cassettes/compute_release_address.yml +55 -0
  15. data/test/cassettes/project_add_member.yml +12 -12
  16. data/test/cassettes/project_all.yml +3 -3
  17. data/test/cassettes/project_all_with_user_name.yml +22 -22
  18. data/test/cassettes/project_create.yml +12 -12
  19. data/test/cassettes/project_destroy.yml +12 -12
  20. data/test/cassettes/project_find.yml +3 -3
  21. data/test/cassettes/project_find_with_invalid_project_name.yml +3 -3
  22. data/test/cassettes/project_member.yml +16 -16
  23. data/test/cassettes/project_members.yml +10 -10
  24. data/test/cassettes/project_members_with_invalid_project_name.yml +3 -3
  25. data/test/cassettes/project_remove_member.yml +12 -12
  26. data/test/cassettes/role_all.yml +15 -15
  27. data/test/cassettes/role_all_with_project_name.yml +15 -15
  28. data/test/cassettes/role_all_without_roles.yml +12 -12
  29. data/test/cassettes/role_create.yml +12 -12
  30. data/test/cassettes/role_create_with_project_name.yml +12 -12
  31. data/test/cassettes/role_create_with_project_name_and_role_name.yml +12 -12
  32. data/test/cassettes/role_destroy.yml +12 -12
  33. data/test/cassettes/role_destroy_with_project_name.yml +12 -12
  34. data/test/cassettes/role_destroy_with_project_name_and_role_name.yml +12 -12
  35. data/test/cassettes/user_create.yml +6 -6
  36. data/test/cassettes/user_credentials.yml +190 -0
  37. data/test/cassettes/user_destroy.yml +6 -6
  38. data/test/cassettes/user_find.yml +9 -9
  39. data/test/cassettes/user_find_with_invalid_user_name.yml +3 -3
  40. data/test/cassettes/user_register.yml +19 -19
  41. data/test/cassettes/user_register_asserts.yml +10 -10
  42. data/test/lib/nephophobia/compute_test.rb +104 -9
  43. data/test/lib/nephophobia/credential_test.rb +4 -17
  44. data/test/lib/nephophobia/user_test.rb +31 -0
  45. data/test/test_helper.rb +11 -0
  46. metadata +16 -4
@@ -33,6 +33,37 @@ describe Nephophobia::User do
33
33
  end
34
34
  end
35
35
 
36
+ describe "#credentials" do
37
+ before do
38
+ VCR.use_cassette "user_credentials" do
39
+ @project_one = "foo_project"
40
+ @project_two = "bar_project"
41
+ @client = ::Client.trunk_with(:admin)
42
+
43
+ @client.user.create @user_name
44
+ @client.project.create @project_one, @user_name
45
+ @client.project.create @project_two, @user_name
46
+ end
47
+ end
48
+
49
+ after do
50
+ VCR.use_cassette "user_credentials" do
51
+ @client.project.destroy @project_one
52
+ @client.project.destroy @project_two
53
+ @client.user.destroy @user_name
54
+ end
55
+ end
56
+
57
+ it "returns the credentials for a given 'user_name' for the specified 'project_name'." do
58
+ VCR.use_cassette "user_credentials" do
59
+ response = @client.user.credentials @user_name, @project_one
60
+
61
+ response.must_match %r{BEGIN CERTIFICATE}
62
+ response.must_match %r{:#{@project_one}}
63
+ end
64
+ end
65
+ end
66
+
36
67
  describe "#destroy" do
37
68
  it "destroys the user name" do
38
69
  VCR.use_cassette "user_destroy" do
data/test/test_helper.rb CHANGED
@@ -37,6 +37,17 @@ class Client
37
37
 
38
38
  Nephophobia::Client.new client_options.merge options
39
39
  end
40
+
41
+ def self.trunk_with type, options = {}
42
+ client_options = case type
43
+ when :admin ; {
44
+ :access_key => "2ea76797-229c-4e52-a21b-f30513cb91a6",
45
+ :secret_key => "3d16b391-820f-4f5c-893b-0f65d5f35312",
46
+ }
47
+ end.merge(:host => "10.3.170.35", :project => "sandbox")
48
+
49
+ Nephophobia::Client.new client_options.merge options
50
+ end
40
51
  end
41
52
 
42
53
  class Time
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nephophobia
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Dewey
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-05-17 00:00:00 -07:00
14
+ date: 2011-05-27 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -82,7 +82,7 @@ dependencies:
82
82
  version_requirements: *id006
83
83
  description: This gem is a simple binding to the EC2 API. It has specific extensions to allow extra functionality provided by OpenStack.
84
84
  email:
85
- - jdewey@attinteractive.com
85
+ - john@dewey.ws
86
86
  - jkleinpeter@attinteractive.com
87
87
  executables: []
88
88
 
@@ -111,11 +111,16 @@ files:
111
111
  - nephophobia.gemspec
112
112
  - test/cassettes/compute_all.yml
113
113
  - test/cassettes/compute_all_with_filter.yml
114
+ - test/cassettes/compute_allocate_address.yml
115
+ - test/cassettes/compute_allocate_address_when_not_available.yml
116
+ - test/cassettes/compute_associate_address.yml
114
117
  - test/cassettes/compute_create.yml
115
118
  - test/cassettes/compute_create_with_optional_params.yml
116
119
  - test/cassettes/compute_destroy.yml
120
+ - test/cassettes/compute_disassociate_address.yml
117
121
  - test/cassettes/compute_find.yml
118
122
  - test/cassettes/compute_reboot.yml
123
+ - test/cassettes/compute_release_address.yml
119
124
  - test/cassettes/compute_vnc_url.yml
120
125
  - test/cassettes/credential_all.yml
121
126
  - test/cassettes/credential_all_without_keys.yml
@@ -145,6 +150,7 @@ files:
145
150
  - test/cassettes/role_destroy_with_project_name.yml
146
151
  - test/cassettes/role_destroy_with_project_name_and_role_name.yml
147
152
  - test/cassettes/user_create.yml
153
+ - test/cassettes/user_credentials.yml
148
154
  - test/cassettes/user_destroy.yml
149
155
  - test/cassettes/user_find.yml
150
156
  - test/cassettes/user_find_with_invalid_user_name.yml
@@ -161,7 +167,7 @@ files:
161
167
  - test/lib/nephophobia_test.rb
162
168
  - test/test_helper.rb
163
169
  has_rdoc: true
164
- homepage: ""
170
+ homepage: http://github.com/retr0h/nephophobia
165
171
  licenses: []
166
172
 
167
173
  post_install_message:
@@ -191,11 +197,16 @@ summary: Bindings to EC2/OpenStack
191
197
  test_files:
192
198
  - test/cassettes/compute_all.yml
193
199
  - test/cassettes/compute_all_with_filter.yml
200
+ - test/cassettes/compute_allocate_address.yml
201
+ - test/cassettes/compute_allocate_address_when_not_available.yml
202
+ - test/cassettes/compute_associate_address.yml
194
203
  - test/cassettes/compute_create.yml
195
204
  - test/cassettes/compute_create_with_optional_params.yml
196
205
  - test/cassettes/compute_destroy.yml
206
+ - test/cassettes/compute_disassociate_address.yml
197
207
  - test/cassettes/compute_find.yml
198
208
  - test/cassettes/compute_reboot.yml
209
+ - test/cassettes/compute_release_address.yml
199
210
  - test/cassettes/compute_vnc_url.yml
200
211
  - test/cassettes/credential_all.yml
201
212
  - test/cassettes/credential_all_without_keys.yml
@@ -225,6 +236,7 @@ test_files:
225
236
  - test/cassettes/role_destroy_with_project_name.yml
226
237
  - test/cassettes/role_destroy_with_project_name_and_role_name.yml
227
238
  - test/cassettes/user_create.yml
239
+ - test/cassettes/user_credentials.yml
228
240
  - test/cassettes/user_destroy.yml
229
241
  - test/cassettes/user_find.yml
230
242
  - test/cassettes/user_find_with_invalid_user_name.yml