rumm 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. checksums.yaml +14 -6
  2. data/.gitignore +2 -1
  3. data/app/controllers/attachments_controller.rb +21 -11
  4. data/app/controllers/containers_controller.rb +8 -2
  5. data/app/controllers/databases_controller.rb +7 -2
  6. data/app/controllers/files_controller.rb +13 -2
  7. data/app/controllers/instances_controller.rb +10 -4
  8. data/app/controllers/nodes_controller.rb +11 -5
  9. data/app/controllers/volumes_controller.rb +9 -5
  10. data/app/forms/attachments/attach_detach_show_form.rb +8 -0
  11. data/app/forms/containers/create_form.rb +5 -0
  12. data/app/forms/databases/create_form.rb +6 -0
  13. data/app/forms/files/create_form.rb +5 -0
  14. data/app/forms/files/download_form.rb +5 -0
  15. data/app/forms/instances/create_form.rb +11 -0
  16. data/app/forms/loadbalancers/create_form.rb +2 -2
  17. data/app/forms/nodes/create_form.rb +12 -0
  18. data/app/forms/users/create_form.rb +1 -1
  19. data/app/forms/volumes/create_form.rb +10 -0
  20. data/app/help/create_attachment_on_server.txt +14 -0
  21. data/app/help/create_container.txt +1 -0
  22. data/app/help/{create_database.txt → create_database_on_dbinstance.txt} +3 -3
  23. data/app/help/create_dbinstance.txt +3 -3
  24. data/app/help/create_file_in_container.txt +14 -0
  25. data/app/help/create_node_on_loadbalancer.txt +17 -0
  26. data/app/help/create_server.txt +4 -4
  27. data/app/help/{create_user.txt → create_user_on_dbinstance.txt} +0 -0
  28. data/app/help/create_volume.txt +4 -2
  29. data/app/help/destroy_attachment_on_server.txt +14 -0
  30. data/app/help/{destroy_database.txt → destroy_database_on_dbinstance.txt} +0 -0
  31. data/app/help/{destroy_file.txt → destroy_file_in_container.txt} +0 -0
  32. data/app/help/{destroy_node.txt → destroy_node_on_loadbalancer.txt} +0 -0
  33. data/app/help/destroy_user_on_dbinstance.txt +15 -0
  34. data/app/help/download_file_in_container.txt +15 -0
  35. data/app/help/routes.rb +4 -3
  36. data/app/help/show_attachment_on_server.txt +14 -0
  37. data/app/help/{show_attachments.txt → show_attachments_on_server.txt} +0 -0
  38. data/app/help/{show_database.txt → show_database_on_dbinstance.txt} +0 -0
  39. data/app/help/{show_databases.txt → show_databases_on_dbinstance.txt} +0 -0
  40. data/app/help/{show_file.txt → show_file_in_container.txt} +0 -0
  41. data/app/help/{show_files.txt → show_files_in_container.txt} +0 -0
  42. data/app/help/{show_node.txt → show_node_in_loadbalancer.txt} +0 -0
  43. data/app/help/show_user_on_dbinstance.txt +15 -0
  44. data/app/help/{show_users.txt → show_users_on_dbinstance.txt} +0 -0
  45. data/app/providers/compute_provider.rb +2 -1
  46. data/app/providers/containers_provider.rb +2 -1
  47. data/app/providers/databases_provider.rb +2 -1
  48. data/app/providers/instances_provider.rb +2 -1
  49. data/app/providers/loadbalancers_provider.rb +2 -1
  50. data/app/providers/nodes_provider.rb +2 -1
  51. data/app/providers/volumes_provider.rb +2 -1
  52. data/app/routes.rb +5 -4
  53. data/app/views/attachments/attach.txt.erb +4 -1
  54. data/app/views/attachments/detach.txt.erb +1 -1
  55. data/app/views/attachments/index.txt.erb +10 -2
  56. data/app/views/attachments/show.txt.erb +3 -1
  57. data/app/views/containers/create.txt.erb +1 -1
  58. data/app/views/containers/destroy.txt.erb +1 -1
  59. data/app/views/containers/index.txt.erb +7 -1
  60. data/app/views/databases/create.txt.erb +1 -1
  61. data/app/views/databases/destroy.txt.erb +1 -1
  62. data/app/views/databases/index.txt.erb +2 -1
  63. data/app/views/files/create.txt.erb +1 -2
  64. data/app/views/files/destroy.txt.erb +1 -1
  65. data/app/views/files/download.txt.erb +1 -1
  66. data/app/views/files/index.txt.erb +9 -1
  67. data/app/views/files/show.txt.erb +2 -1
  68. data/app/views/instances/create.txt.erb +1 -1
  69. data/app/views/instances/destroy.txt.erb +1 -1
  70. data/app/views/instances/index.txt.erb +2 -1
  71. data/app/views/instances/show.txt.erb +4 -1
  72. data/app/views/loadbalancers/create.txt.erb +1 -1
  73. data/app/views/loadbalancers/destroy.txt.erb +1 -1
  74. data/app/views/loadbalancers/index.txt.erb +1 -0
  75. data/app/views/nodes/create.txt.erb +1 -1
  76. data/app/views/nodes/destroy.txt.erb +1 -1
  77. data/app/views/nodes/index.txt.erb +7 -2
  78. data/app/views/nodes/show.txt.erb +6 -1
  79. data/app/views/users/index.txt.erb +4 -3
  80. data/app/views/volumes/create.txt.erb +1 -1
  81. data/app/views/volumes/destroy.txt.erb +1 -1
  82. data/app/views/volumes/index.txt.erb +8 -1
  83. data/app/views/volumes/show.txt.erb +7 -1
  84. data/lib/rumm/version.rb +1 -1
  85. data/rumm.gemspec +3 -3
  86. data/spec/features/attachments_spec.rb +33 -0
  87. data/spec/features/containers_spec.rb +30 -0
  88. data/spec/features/databases_spec.rb +29 -0
  89. data/spec/features/dbinstances_spec.rb +30 -0
  90. data/spec/features/files_spec.rb +50 -0
  91. data/spec/features/help_spec.rb +2 -2
  92. data/spec/features/loadbalancers_spec.rb +30 -0
  93. data/spec/features/login_spec.rb +21 -17
  94. data/spec/features/nodes_spec.rb +35 -0
  95. data/spec/features/servers_spec.rb +7 -13
  96. data/spec/features/volumes_spec.rb +29 -0
  97. data/spec/fixtures/cassettes/attachments/create.yml +305 -0
  98. data/spec/fixtures/cassettes/attachments/destroy.yml +342 -0
  99. data/spec/fixtures/cassettes/attachments/show-all.yml +145 -0
  100. data/spec/fixtures/cassettes/attachments/show.yml +309 -0
  101. data/spec/fixtures/cassettes/authentication/successful-login.yml +78 -0
  102. data/spec/fixtures/cassettes/{unsuccessful-login.yml → authentication/unsuccessful-login.yml} +3 -3
  103. data/spec/fixtures/cassettes/containers/create.yml +212 -0
  104. data/spec/fixtures/cassettes/containers/destroy.yml +211 -0
  105. data/spec/fixtures/cassettes/containers/show-all.yml +92 -0
  106. data/spec/fixtures/cassettes/containers/show.yml +92 -0
  107. data/spec/fixtures/cassettes/databases/create.yml +171 -0
  108. data/spec/fixtures/cassettes/databases/destroy.yml +206 -0
  109. data/spec/fixtures/cassettes/databases/show-all.yml +171 -0
  110. data/spec/fixtures/cassettes/databases/show.yml +171 -0
  111. data/spec/fixtures/cassettes/files/create.yml +129 -0
  112. data/spec/fixtures/cassettes/files/destroy.yml +166 -0
  113. data/spec/fixtures/cassettes/files/download.yml +132 -0
  114. data/spec/fixtures/cassettes/files/show-all.yml +175 -0
  115. data/spec/fixtures/cassettes/files/show.yml +133 -0
  116. data/spec/fixtures/cassettes/instances/create.yml +87 -0
  117. data/spec/fixtures/cassettes/instances/destroy.yml +128 -0
  118. data/spec/fixtures/cassettes/instances/show-all.yml +87 -0
  119. data/spec/fixtures/cassettes/instances/show.yml +128 -0
  120. data/spec/fixtures/cassettes/loadbalancers/create.yml +81 -0
  121. data/spec/fixtures/cassettes/loadbalancers/destroy.yml +114 -0
  122. data/spec/fixtures/cassettes/loadbalancers/show-all.yml +81 -0
  123. data/spec/fixtures/cassettes/loadbalancers/show.yml +81 -0
  124. data/spec/fixtures/cassettes/nodes/create.yml +159 -0
  125. data/spec/fixtures/cassettes/nodes/destroy.yml +192 -0
  126. data/spec/fixtures/cassettes/nodes/show-all.yml +159 -0
  127. data/spec/fixtures/cassettes/nodes/show.yml +159 -0
  128. data/spec/fixtures/cassettes/{create-server.yml → servers/create.yml} +2452 -3032
  129. data/spec/fixtures/cassettes/servers/destroy.yml +130 -0
  130. data/spec/fixtures/cassettes/servers/show-all.yml +81 -0
  131. data/spec/fixtures/cassettes/servers/show.yml +183 -0
  132. data/spec/fixtures/cassettes/volumes/create.yml +83 -0
  133. data/spec/fixtures/cassettes/volumes/destroy.yml +114 -0
  134. data/spec/fixtures/cassettes/volumes/show-all.yml +83 -0
  135. data/spec/fixtures/cassettes/volumes/show.yml +83 -0
  136. data/spec/spec_helper.rb +37 -7
  137. metadata +135 -62
  138. data/app/help/attach_volume.txt +0 -15
  139. data/app/help/create_node.txt +0 -14
  140. data/app/help/detach_volume.txt +0 -15
  141. data/spec/fixtures/cassettes/destroy-server.yml +0 -130
  142. data/spec/fixtures/cassettes/show-server.yml +0 -183
  143. data/spec/fixtures/cassettes/show-servers.yml +0 -81
  144. data/spec/fixtures/cassettes/successful-login.yml +0 -78
@@ -1 +1,6 @@
1
- <%= this.id %>
1
+ id: <%= this.id %>
2
+ address: <%= this.address %>
3
+ port: <%= this.port %>
4
+ condition: <%= this.condition %>
5
+ status: <%= this.status %>
6
+ weight: <%= this.weight %>
@@ -1,7 +1,8 @@
1
1
  <% if this.empty? %>
2
- You don't have any users yet.
2
+ you don't have any users on this dbinstance, but you can create one by running:
3
+ rumm create user on dbinstance <dbinstance_name>
3
4
  <% else %>
4
5
  <% this.each do |user| %>
5
- <%= user.name %>, <%= user.databases.inspect %>
6
+ <%= user.name %>, <%= user.databases.inspect %>
7
+ <% end %>
6
8
  <% end %>
7
- <% end %>
@@ -1 +1 @@
1
- created volume: <%= this.display_name %>
1
+ Created volume: <%= this.display_name %>
@@ -1 +1 @@
1
- requested destruction of volume <%= this %>
1
+ Requested destruction of volume <%= this %>
@@ -1,5 +1,12 @@
1
+ Volumes:
1
2
  <% this.each do |volume| %>
2
- id: <%= volume.display_name %>
3
+ id: <%= volume.id %>
4
+ display name: <%= volume.display_name %>
5
+ display description: <%= volume.display_description %>
6
+ size: <%= volume.size %>
7
+ volume type: <%= volume.volume_type %>
8
+ attachments: <%= volume.attachments %>
9
+ created at: <%= volume.created_at %>
3
10
  <% end %>
4
11
 
5
12
 
@@ -1 +1,7 @@
1
- <%= this.display_name %>
1
+ id: <%= this.id %>
2
+ display name: <%= this.display_name %>
3
+ display description: <%= this.display_description %>
4
+ size: <%= this.size %>
5
+ volume type: <%= this.volume_type %>
6
+ attachments: <%= this.attachments %>
7
+ created at: <%= this.created_at %>
@@ -1,3 +1,3 @@
1
1
  module Rumm
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["cowboyd@thefrontside.net"]
11
11
  spec.description = %q{Lift heavy things inside your Rackspace}
12
12
  spec.summary = %q{CLI and API for managing Rackspace infrastructure}
13
- spec.homepage = "https://github.com/rackerlabs/rumm"
13
+ spec.homepage = "https://github.com/rackspace/rumm"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = ">= 1.9.3"
22
22
 
23
- spec.add_dependency "mvcli", "~> 0.0.13"
24
- spec.add_dependency "fog", "~> 1.12.0"
23
+ spec.add_dependency "mvcli", "~> 0.0.16"
24
+ spec.add_dependency "fog", "~> 1.15.0"
25
25
  spec.add_dependency "netrc"
26
26
  end
@@ -0,0 +1,33 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the attachments api" do
4
+ context "with credentials are present" do
5
+
6
+ include_context "netrc"
7
+
8
+ context "to create" do
9
+ When { VCR.use_cassette('attachments/create') { run "rumm create attachment on server silly-saffron --volume jumping-jellybean" }}
10
+ Then { all_stdout =~ /Attached volume/ }
11
+ And { last_exit_status.should eql 0 }
12
+ end
13
+
14
+ context "to show" do
15
+ When { VCR.use_cassette('attachments/show') { run "rumm show attachment on server silly-saffron --volume jumping-jellybean" }}
16
+ Then { all_stdout =~ /device/ }
17
+ And { last_exit_status.should eql 0 }
18
+ end
19
+
20
+ context "to show all" do
21
+ #Given { pending "Not working, some sort of error in forms" }
22
+ When { VCR.use_cassette('attachments/show-all') { run "rumm show attachments on server silly-saffron" }}
23
+ Then { all_stdout =~ /Attachments/}
24
+ And { last_exit_status.should eql 0 }
25
+ end
26
+
27
+ context "to destroy" do
28
+ When { VCR.use_cassette('attachments/destroy') { run "rumm destroy attachment on server silly-saffron --volume jumping-jellybean" }}
29
+ Then { all_stdout =~ /Detached volume/}
30
+ And { last_exit_status.should eql 0 }
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the containers api" do
4
+
5
+ include_context "netrc"
6
+
7
+ context "to create" do
8
+ When { VCR.use_cassette('containers/create') { run "rumm create container --name cruising-crouton" }}
9
+ Then { all_stdout =~ /Created container/ }
10
+ And { last_exit_status.should eql 0 }
11
+ end
12
+
13
+ context "to show" do
14
+ When { VCR.use_cassette('containers/show') { run "rumm show container cruising-crouton" }}
15
+ Then { all_stdout =~ /cruising-crouton/ }
16
+ And { last_exit_status.should eql 0 }
17
+ end
18
+
19
+ context "to show all" do
20
+ When { VCR.use_cassette('containers/show-all') { run "rumm show containers" }}
21
+ Then { all_stdout =~ /Containers:/}
22
+ And { last_exit_status.should eql 0 }
23
+ end
24
+
25
+ context "to destroy" do
26
+ When { VCR.use_cassette('containers/destroy') { run "rumm destroy container cruising-crouton" }}
27
+ Then { all_stdout =~ /Requested destruction/}
28
+ And { last_exit_status.should eql 0 }
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the databases api" do
4
+ include_context "netrc"
5
+
6
+ context "to create" do
7
+ When { VCR.use_cassette('databases/create') { run "rumm create database on dbinstance decided-irony --name dancing-bear" }}
8
+ Then { all_stdout =~ /Created database/ }
9
+ And { last_exit_status.should eql 0 }
10
+ end
11
+
12
+ context "to show" do
13
+ When { VCR.use_cassette('databases/show') { run "rumm show database dancing-bear on dbinstance decided-irony" }}
14
+ Then { all_stdout =~ /dancing-bear/ }
15
+ And { last_exit_status.should eql 0 }
16
+ end
17
+
18
+ context "to show all" do
19
+ When { VCR.use_cassette('databases/show-all') { run "rumm show databases on dbinstance decided-irony" }}
20
+ Then { all_stdout =~ /Databases/}
21
+ And { last_exit_status.should eql 0 }
22
+ end
23
+
24
+ context "to destroy" do
25
+ When { VCR.use_cassette('databases/destroy') { run "rumm destroy database dancing-bear on dbinstance decided-irony" }}
26
+ Then { all_stdout =~ /Destroyed/}
27
+ And { last_exit_status.should eql 0 }
28
+ end
29
+ end
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the instance api" do
4
+
5
+ include_context "netrc"
6
+
7
+ context "to create" do
8
+ When { VCR.use_cassette('instances/create') { run "rumm create dbinstance --name dancing-idol" }}
9
+ Then { all_stdout =~ /Created database instance/ }
10
+ And { last_exit_status.should eql 0 }
11
+ end
12
+
13
+ context "to show" do
14
+ When { VCR.use_cassette('instances/show') { run "rumm show dbinstance dancing-idol" }}
15
+ Then { all_stdout =~ /dancing-idol/ }
16
+ And { last_exit_status.should eql 0 }
17
+ end
18
+
19
+ context "to show all" do
20
+ When { VCR.use_cassette('instances/show-all') { run "rumm show dbinstances" }}
21
+ Then { all_stdout =~ /Database instances:/}
22
+ And { last_exit_status.should eql 0 }
23
+ end
24
+
25
+ context "to destroy" do
26
+ When { VCR.use_cassette('instances/destroy') { run "rumm destroy dbinstance dancing-idol" }}
27
+ Then { all_stdout =~ /Requested destruction/}
28
+ And { last_exit_status.should eql 0 }
29
+ end
30
+ end
@@ -0,0 +1,50 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the files api" do
4
+
5
+ include_context "netrc"
6
+
7
+ context "to create" do
8
+ Given do
9
+ `touch ~/test`
10
+ `echo "the cake is a lie" >> ~/test`
11
+ end
12
+
13
+ When { VCR.use_cassette('files/create') { run "rumm create file test in container colorful-cat --file \"#{File.expand_path "~" + "/test" }\"" }}
14
+ Then { all_stderr == "" }
15
+ Then { all_stdout =~ /Created file/ }
16
+ And { last_exit_status.should eql 0 }
17
+ end
18
+
19
+ context "to show" do
20
+ When { VCR.use_cassette('files/show') { run "rumm show file test in container colorful-cat" }}
21
+ Then { all_stderr == "" }
22
+ Then { all_stdout =~ /test/ }
23
+ And { last_exit_status.should eql 0 }
24
+ end
25
+
26
+ context "to show all" do
27
+ When { VCR.use_cassette('files/show-all') { run "rumm show files in container colorful-cat" }}
28
+ Then { all_stderr == ""}
29
+ Then { all_stdout =~ /Files:/}
30
+ And { last_exit_status.should eql 0 }
31
+ end
32
+
33
+ context "to download" do
34
+ When { VCR.use_cassette('files/download') { run "rumm download file test in container colorful-cat --destination download-test" }}
35
+ Then { all_stderr == "" }
36
+ Then { all_stdout =~ /Downloaded/ }
37
+ And { last_exit_status.should eql 0 }
38
+
39
+ after do
40
+ `rm #{File.expand_path '~'}/download-test`
41
+ end
42
+ end
43
+
44
+ context "to destroy" do
45
+ When { VCR.use_cassette('files/destroy') { run "rumm destroy file test in container colorful-cat" }}
46
+ Then { all_stderr == "" }
47
+ Then { all_stdout =~ /Requested destruction/}
48
+ And { last_exit_status.should eql 0 }
49
+ end
50
+ end
@@ -134,8 +134,8 @@ describe "interactive learning" do
134
134
  # --nodes[1][address]: 'xxx' -> IPAddr::InvalidAddressError: invalid address
135
135
 
136
136
  Given {rumm "create loadbalancer --node 10.0.0.1:999999 --node %%^:80 --port=-1"}
137
- Then { stderr.match "port: port must be between 0 and 65,535" }
138
- Then { stderr.match /nodes\[0\].port: port must be between 0 and 65,535/ }
137
+ Then { stderr.match "port: must be between 0 and 65,535" }
138
+ Then { stderr.match /nodes\[0\].port: must be between 0 and 65,535/ }
139
139
  Then { stderr.match /nodes\[1\].address:/}
140
140
  end
141
141
 
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the load balancers api" do
4
+
5
+ include_context "netrc"
6
+
7
+ context "to create" do
8
+ When { VCR.use_cassette('loadbalancers/create') { run "rumm create loadbalancer --name likable-bear --node 166.78.114.25:80" }}
9
+ Then { all_stdout =~ /Created load balancer/ }
10
+ And { last_exit_status.should eql 0 }
11
+ end
12
+
13
+ context "to show" do
14
+ When { VCR.use_cassette('loadbalancers/show') { run "rumm show loadbalancer likable-bear" }}
15
+ Then { all_stdout =~ /likable-bear/ }
16
+ And { last_exit_status.should eql 0 }
17
+ end
18
+
19
+ context "to show all" do
20
+ When { VCR.use_cassette('loadbalancers/show-all') { run "rumm show loadbalancers" }}
21
+ Then { all_stdout =~ /Loadbalancers:/}
22
+ And { last_exit_status.should eql 0 }
23
+ end
24
+
25
+ context "to destroy" do
26
+ When { VCR.use_cassette('loadbalancers/destroy') { run "rumm destroy loadbalancer likable-bear" }}
27
+ Then { all_stdout =~ /Requested destruction/}
28
+ And { last_exit_status.should eql 0 }
29
+ end
30
+ end
@@ -1,20 +1,23 @@
1
1
  require "spec_helper"
2
2
  require "netrc"
3
+ require 'io/console'
3
4
 
4
5
  describe "logging in" do
5
- Given do
6
- #@announce_dir = true
7
- #@announce_cmd = true
8
- #@announce_env = true
9
- #@announce_stdout = true
10
- #@announce_stderr = true
11
- @home = Pathname(set_env "HOME", File.expand_path(current_dir))
6
+ include_context "netrc"
7
+ before do
8
+ run "rumm logout"
12
9
  end
13
10
  context "interactively with valid credentials" do
14
11
  When do
15
- VCR.use_cassette('successful-login') do
16
- will_type ENV['RACKSPACE_USERNAME'] || "<username>"
17
- will_type ENV['RACKSPACE_PASSWORD'] || "<valid-password>"
12
+ VCR.use_cassette('authentication/successful-login') do
13
+ if VCR.current_cassette.recording?
14
+ print "\nUsername: "
15
+ username = $stdin.gets.chomp
16
+ print "Password: "
17
+ password = $stdin.noecho(&:gets).chomp
18
+ end
19
+ will_type username || "<username>"
20
+ will_type password || "<password>"
18
21
  run_interactive "rumm login"
19
22
  stop_process @interactive
20
23
  end
@@ -22,16 +25,17 @@ describe "logging in" do
22
25
  Then {last_exit_status == 0}
23
26
 
24
27
  context "places your login credentials in your .netrc" do
25
- Then do
26
- n = Netrc.read
27
- user, pass = n["api.rackspace.com"]
28
- user != nil and pass != nil
29
- end
28
+ Given(:netrc) { Netrc.read["api.rackspace.com"] }
29
+ Given(:user) {netrc.first}
30
+ Given(:password) {netrc.last}
31
+
32
+ Then { user != nil }
33
+ And { password != nil }
30
34
  end
31
35
  end
32
36
 
33
37
  context "logging out" do
34
- When {VCR.use_cassette('successful-logout') {run "rumm logout"}}
38
+ When {run "rumm logout"}
35
39
  Then {last_exit_status == 0}
36
40
 
37
41
  context "removes your login credentials from .netrc" do
@@ -43,7 +47,7 @@ describe "logging in" do
43
47
  end
44
48
  context "interactively with invalid credentials" do
45
49
  When do
46
- VCR.use_cassette("unsuccessful-login") do
50
+ VCR.use_cassette("authentication/unsuccessful-login") do
47
51
  will_type "nil"
48
52
  will_type "nil"
49
53
  run_interactive "rum login"
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe "using the nodes api" do
4
+ $id = "test"
5
+ include_context "netrc"
6
+
7
+ context "to create" do
8
+ When { VCR.use_cassette('nodes/create') { run "rumm create node on loadbalancer laughing-barrel --address 198.61.221.220 --condition ENABLED --port: 80" }}
9
+ Then { all_stdout =~ /Created node/ }
10
+ And { last_exit_status.should eql 0 }
11
+
12
+ after do
13
+ $id = all_stdout.match(/\d+/)[0]
14
+ end
15
+ end
16
+
17
+
18
+ context "to show" do
19
+ When { VCR.use_cassette('nodes/show') { run "rumm show node #{$id} on loadbalancer laughing-barrel" }}
20
+ Then { all_stdout =~ /id:/ }
21
+ And { last_exit_status.should eql 0 }
22
+ end
23
+
24
+ context "to show all" do
25
+ When { VCR.use_cassette('nodes/show-all') { run "rumm show nodes on loadbalancer laughing-barrel" }}
26
+ Then { all_stdout =~ /Nodes/}
27
+ And { last_exit_status.should eql 0 }
28
+ end
29
+
30
+ context "to destroy" do
31
+ When { VCR.use_cassette('nodes/destroy') { run "rumm destroy node #{$id} on loadbalancer laughing-barrel" }}
32
+ Then { all_stdout =~ /Destroyed/}
33
+ And { last_exit_status.should eql 0 }
34
+ end
35
+ end
@@ -2,17 +2,11 @@ require "spec_helper"
2
2
 
3
3
  describe "using the server api" do
4
4
  context "with credentials are present" do
5
- Given(:home) {Pathname(set_env "HOME", File.expand_path(current_dir))}
6
- Given do
7
- File.open(home.join('.netrc'), "w") do |f|
8
- f.chmod 0600
9
- f.puts "machine api.rackspace.com"
10
- f.puts " login #{ENV['RACKSPACE_USERNAME'] || '<rackspace-username>'}"
11
- f.puts " password #{ENV['RACKSPACE_API_KEY'] || '<rackspace-api-key>'}"
12
- end
13
- end
5
+
6
+ include_context "netrc"
7
+
14
8
  context "when I list all my servers (and I don't have any')" do
15
- When {VCR.use_cassette('show-servers') {run "rumm show servers"}}
9
+ When {VCR.use_cassette('servers/show-all') {run "rumm show servers"}}
16
10
  Then {all_stdout =~ /you don't have any servers/}
17
11
  And {last_exit_status.should eql 0}
18
12
  end
@@ -23,16 +17,16 @@ describe "using the server api" do
23
17
  FileUtils.mkdir_p private_key.dirname, mode: 0700
24
18
  `echo -e "y\n" | ssh-keygen -t rsa -C "test@example.com" -N "testing" -f "#{private_key}"`
25
19
  end
26
- When {VCR.use_cassette('create-server') {run "rumm create server --name silly-saffron"}}
20
+ When {VCR.use_cassette('servers/create') {run "rumm create server --name silly-saffron"}}
27
21
  Then {all_stdout =~ /created server/}
28
22
  And {last_exit_status.should eql 0}
29
23
  end
30
24
  context "when I show a server" do
31
- When {VCR.use_cassette('show-server') {run "rumm show server silly-saffron"}}
25
+ When {VCR.use_cassette('servers/show') {run "rumm show server silly-saffron"}}
32
26
  Then {last_exit_status.should eql 0}
33
27
  end
34
28
  context "when I destroy a server that exists" do
35
- When {VCR.use_cassette('destroy-server') {run "rumm destroy server silly-saffron"}}
29
+ When {VCR.use_cassette('servers/destroy') {run "rumm destroy server silly-saffron"}}
36
30
  Then {all_stdout =~ /destruction/}
37
31
  And {last_exit_status.should eql 0}
38
32
  end