cf 1.1.3.rc1 → 1.1.4
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.
- data/lib/cf/cli.rb +2 -7
- data/lib/cf/cli/organization/delete.rb +4 -6
- data/lib/cf/cli/service/create.rb +23 -17
- data/lib/cf/cli/space/create.rb +43 -41
- data/lib/cf/cli/space/space.rb +49 -46
- data/lib/cf/version.rb +1 -1
- data/lib/console/console.rb +1 -1
- data/spec/cf/cli/app/delete_spec.rb +16 -28
- data/spec/cf/cli/app/instances_spec.rb +4 -5
- data/spec/cf/cli/app/push/create_spec.rb +362 -373
- data/spec/cf/cli/app/push_spec.rb +216 -215
- data/spec/cf/cli/app/rename_spec.rb +28 -31
- data/spec/cf/cli/app/scale_spec.rb +44 -41
- data/spec/cf/cli/app/start_spec.rb +194 -193
- data/spec/cf/cli/app/stats_spec.rb +55 -56
- data/spec/cf/cli/domain/map_spec.rb +105 -102
- data/spec/cf/cli/domain/unmap_spec.rb +60 -56
- data/spec/cf/cli/organization/delete_spec.rb +85 -84
- data/spec/cf/cli/organization/orgs_spec.rb +80 -83
- data/spec/cf/cli/organization/rename_spec.rb +90 -89
- data/spec/cf/cli/populators/organization_spec.rb +117 -119
- data/spec/cf/cli/populators/space_spec.rb +107 -108
- data/spec/cf/cli/populators/target_spec.rb +17 -12
- data/spec/cf/cli/route/delete_spec.rb +4 -4
- data/spec/cf/cli/route/map_spec.rb +106 -102
- data/spec/cf/cli/route/unmap_spec.rb +5 -5
- data/spec/cf/cli/service/create_spec.rb +74 -46
- data/spec/cf/cli/service/rename_spec.rb +29 -33
- data/spec/cf/cli/service/services_spec.rb +48 -48
- data/spec/cf/cli/space/base_spec.rb +39 -32
- data/spec/cf/cli/space/create_spec.rb +52 -53
- data/spec/cf/cli/space/delete_spec.rb +84 -85
- data/spec/cf/cli/space/rename_spec.rb +93 -94
- data/spec/cf/cli/space/space_spec.rb +60 -60
- data/spec/cf/cli/space/spaces_spec.rb +75 -80
- data/spec/cf/cli/space/switch_space_spec.rb +45 -48
- data/spec/cf/cli/start/info_spec.rb +4 -6
- data/spec/cf/cli/start/login_spec.rb +18 -20
- data/spec/cf/cli/start/logout_spec.rb +36 -37
- data/spec/cf/cli/start/target_spec.rb +86 -89
- data/spec/cf/cli/user/create_spec.rb +83 -84
- data/spec/cf/cli/user/passwd_spec.rb +87 -86
- data/spec/cf/cli/user/register_spec.rb +109 -108
- data/spec/cf/cli_spec.rb +305 -310
- data/spec/console/console_spec.rb +58 -58
- data/spec/factories/cfoundry/v2/domain_factory.rb +8 -0
- data/spec/factories/cfoundry/v2/route_factory.rb +8 -0
- data/spec/factories/cfoundry/v2/user_factory.rb +7 -0
- data/spec/features/org_spec.rb +11 -11
- data/spec/manifests/manifests_spec.rb +21 -21
- data/spec/manifests/plugin_spec.rb +34 -34
- data/spec/spec_helper.rb +1 -2
- data/spec/support/cli_helper.rb +5 -14
- data/spec/support/factory_girl.rb +6 -0
- data/spec/support/interact_helper.rb +5 -15
- data/spec/support/shared_examples/errors.rb +1 -1
- data/spec/tunnel/plugin_spec.rb +2 -2
- data/spec/tunnel/tunnel_spec.rb +5 -5
- metadata +36 -28
data/spec/spec_helper.rb
CHANGED
@@ -6,6 +6,7 @@ require "cfoundry/test_support"
|
|
6
6
|
require "cf"
|
7
7
|
require "cf/test_support"
|
8
8
|
require "webmock"
|
9
|
+
require "webmock/rspec"
|
9
10
|
require "ostruct"
|
10
11
|
require "fakefs/safe"
|
11
12
|
require "blue-shell"
|
@@ -38,8 +39,6 @@ RSpec.configure do |c|
|
|
38
39
|
c.include Fake::FakeMethods
|
39
40
|
c.include BlueShell::Matchers
|
40
41
|
|
41
|
-
c.mock_with :rr
|
42
|
-
|
43
42
|
if RUBY_VERSION =~ /^1\.8\.\d/
|
44
43
|
c.filter_run_excluding :ruby19 => true
|
45
44
|
end
|
data/spec/support/cli_helper.rb
CHANGED
@@ -5,15 +5,11 @@ module CliHelper
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def stub_client
|
8
|
-
|
9
|
-
stub(cli).client { client }
|
10
|
-
end
|
8
|
+
described_class.any_instance.stub(:client).and_return(client)
|
11
9
|
end
|
12
10
|
|
13
11
|
def stub_precondition
|
14
|
-
|
15
|
-
stub(cli).precondition
|
16
|
-
end
|
12
|
+
described_class.any_instance.stub(:precondition)
|
17
13
|
end
|
18
14
|
|
19
15
|
def wrap_errors
|
@@ -24,7 +20,7 @@ module CliHelper
|
|
24
20
|
|
25
21
|
def cf(argv)
|
26
22
|
Mothership.new.exit_status 0
|
27
|
-
|
23
|
+
CF::CLI.stub(:exit) { |code| code }
|
28
24
|
capture_output { CF::CLI.start(argv + ["--debug", "--no-script"]) }
|
29
25
|
end
|
30
26
|
|
@@ -60,15 +56,10 @@ module CliHelper
|
|
60
56
|
end
|
61
57
|
|
62
58
|
def mock_invoke(*args)
|
63
|
-
|
64
|
-
mock(cli).invoke *args
|
65
|
-
end
|
59
|
+
described_class.any_instance.should_receive(:invoke).with(*args)
|
66
60
|
end
|
67
61
|
|
68
62
|
def dont_allow_invoke(*args)
|
69
|
-
|
70
|
-
dont_allow(cli).invoke *args
|
71
|
-
end
|
63
|
+
described_class.any_instance.should_not_receive(:invoke).with(*args)
|
72
64
|
end
|
73
|
-
|
74
65
|
end
|
@@ -1,29 +1,19 @@
|
|
1
1
|
module InteractHelper
|
2
2
|
def stub_ask(*args, &block)
|
3
|
-
|
4
|
-
any_instance_of CF::CLI do |interactive|
|
5
|
-
a_stub = stub(interactive).ask(*args, &block)
|
6
|
-
end
|
7
|
-
a_stub
|
3
|
+
CF::CLI.any_instance.stub(:ask).with(*args, &block)
|
8
4
|
end
|
9
5
|
|
10
6
|
def mock_ask(*args, &block)
|
11
|
-
|
12
|
-
any_instance_of CF::CLI do |interactive|
|
13
|
-
a_mock = mock(interactive).ask(*args, &block)
|
14
|
-
end
|
15
|
-
a_mock
|
7
|
+
CF::CLI.any_instance.should_receive(:ask).with(*args, &block)
|
16
8
|
end
|
17
9
|
|
18
10
|
def dont_allow_ask(*args)
|
19
|
-
|
20
|
-
dont_allow(interactive).ask(*args)
|
21
|
-
end
|
11
|
+
CF::CLI.any_instance.should_not_receive(:ask).with(*args)
|
22
12
|
end
|
23
13
|
|
24
14
|
def mock_with_progress(message)
|
25
|
-
|
26
|
-
|
15
|
+
CF::CLI.any_instance.should_receive(:with_progress).with(message) do |_, &block|
|
16
|
+
block.call
|
27
17
|
end
|
28
18
|
end
|
29
19
|
end
|
data/spec/tunnel/plugin_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe CFTunnelPlugin::Tunnel do
|
|
4
4
|
describe "#tunnel_clients" do
|
5
5
|
context "when the user has a custom clients.yml in their cf directory" do
|
6
6
|
it "overrides the default client config with the user's customizations" do
|
7
|
-
stub(
|
7
|
+
subject.stub(:config_file_path) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/with_custom_clients/.cf/#{CFTunnelPlugin::Tunnel::CLIENTS_FILE}" }
|
8
8
|
|
9
9
|
expect(subject.tunnel_clients["postgresql"]).to eq({
|
10
10
|
"psql" => {
|
@@ -17,7 +17,7 @@ describe CFTunnelPlugin::Tunnel do
|
|
17
17
|
|
18
18
|
context "when the user does not have a custom clients.yml" do
|
19
19
|
it "returns the default client config" do
|
20
|
-
stub(
|
20
|
+
subject.stub(:config_file_path) { File.expand_path("./.cf/#{CFTunnelPlugin::Tunnel::CLIENTS_FILE}") }
|
21
21
|
|
22
22
|
expect(subject.tunnel_clients["postgresql"]).to eq({
|
23
23
|
"psql" => {
|
data/spec/tunnel/tunnel_spec.rb
CHANGED
@@ -38,14 +38,14 @@ describe CFTunnel do
|
|
38
38
|
let(:host) { "caldecott" }
|
39
39
|
|
40
40
|
before do
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
subject.stub(:random_helper_url) { "caldecott" }
|
42
|
+
client.stub(:app) { app }
|
43
|
+
client.stub(:current_space) { space }
|
44
|
+
client.stub(:domains) { [fake(:domain, :owning_organization => fake(:organization)), domain] }
|
45
45
|
end
|
46
46
|
|
47
47
|
it "adds a new route to caldecott app" do
|
48
|
-
|
48
|
+
app.should_receive(:create_route).with(:domain => domain, :host => host, :space => space)
|
49
49
|
|
50
50
|
subject.send("push_helper", "this is a token")
|
51
51
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.4
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cloud Foundry Team
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -178,6 +178,22 @@ dependencies:
|
|
178
178
|
- - '='
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 0.0.3
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: factory_girl
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
none: false
|
185
|
+
requirements:
|
186
|
+
- - ! '>='
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
type: :development
|
190
|
+
prerelease: false
|
191
|
+
version_requirements: !ruby/object:Gem::Requirement
|
192
|
+
none: false
|
193
|
+
requirements:
|
194
|
+
- - ! '>='
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
181
197
|
- !ruby/object:Gem::Dependency
|
182
198
|
name: fakefs
|
183
199
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,22 +242,6 @@ dependencies:
|
|
226
242
|
- - ~>
|
227
243
|
- !ruby/object:Gem::Version
|
228
244
|
version: '0.9'
|
229
|
-
- !ruby/object:Gem::Dependency
|
230
|
-
name: rr
|
231
|
-
requirement: !ruby/object:Gem::Requirement
|
232
|
-
none: false
|
233
|
-
requirements:
|
234
|
-
- - ~>
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '1.0'
|
237
|
-
type: :development
|
238
|
-
prerelease: false
|
239
|
-
version_requirements: !ruby/object:Gem::Requirement
|
240
|
-
none: false
|
241
|
-
requirements:
|
242
|
-
- - ~>
|
243
|
-
- !ruby/object:Gem::Version
|
244
|
-
version: '1.0'
|
245
245
|
- !ruby/object:Gem::Dependency
|
246
246
|
name: rspec
|
247
247
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,13 +259,13 @@ dependencies:
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '2.11'
|
261
261
|
- !ruby/object:Gem::Dependency
|
262
|
-
name:
|
262
|
+
name: rspec-instafail
|
263
263
|
requirement: !ruby/object:Gem::Requirement
|
264
264
|
none: false
|
265
265
|
requirements:
|
266
266
|
- - ~>
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
version:
|
268
|
+
version: 0.2.4
|
269
269
|
type: :development
|
270
270
|
prerelease: false
|
271
271
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -273,15 +273,15 @@ dependencies:
|
|
273
273
|
requirements:
|
274
274
|
- - ~>
|
275
275
|
- !ruby/object:Gem::Version
|
276
|
-
version:
|
276
|
+
version: 0.2.4
|
277
277
|
- !ruby/object:Gem::Dependency
|
278
|
-
name:
|
278
|
+
name: webmock
|
279
279
|
requirement: !ruby/object:Gem::Requirement
|
280
280
|
none: false
|
281
281
|
requirements:
|
282
282
|
- - ~>
|
283
283
|
- !ruby/object:Gem::Version
|
284
|
-
version:
|
284
|
+
version: '1.9'
|
285
285
|
type: :development
|
286
286
|
prerelease: false
|
287
287
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -289,7 +289,7 @@ dependencies:
|
|
289
289
|
requirements:
|
290
290
|
- - ~>
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version:
|
292
|
+
version: '1.9'
|
293
293
|
description:
|
294
294
|
email:
|
295
295
|
- vcap-dev@googlegroups.com
|
@@ -493,6 +493,9 @@ files:
|
|
493
493
|
- spec/cf/cli/user/register_spec.rb
|
494
494
|
- spec/cf/cli_spec.rb
|
495
495
|
- spec/console/console_spec.rb
|
496
|
+
- spec/factories/cfoundry/v2/domain_factory.rb
|
497
|
+
- spec/factories/cfoundry/v2/route_factory.rb
|
498
|
+
- spec/factories/cfoundry/v2/user_factory.rb
|
496
499
|
- spec/features/account_lifecycle_spec.rb
|
497
500
|
- spec/features/create_user_spec.rb
|
498
501
|
- spec/features/login_spec.rb
|
@@ -508,6 +511,7 @@ files:
|
|
508
511
|
- spec/spec_helper.rb
|
509
512
|
- spec/support/cli_helper.rb
|
510
513
|
- spec/support/config_helper.rb
|
514
|
+
- spec/support/factory_girl.rb
|
511
515
|
- spec/support/fake_home_dir.rb
|
512
516
|
- spec/support/features_helper.rb
|
513
517
|
- spec/support/interact_helper.rb
|
@@ -530,13 +534,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
530
534
|
version: '0'
|
531
535
|
segments:
|
532
536
|
- 0
|
533
|
-
hash: -
|
537
|
+
hash: -864933876994937869
|
534
538
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
535
539
|
none: false
|
536
540
|
requirements:
|
537
|
-
- - ! '
|
541
|
+
- - ! '>='
|
538
542
|
- !ruby/object:Gem::Version
|
539
|
-
version:
|
543
|
+
version: '0'
|
540
544
|
requirements: []
|
541
545
|
rubyforge_project: cf
|
542
546
|
rubygems_version: 1.8.25
|
@@ -640,6 +644,9 @@ test_files:
|
|
640
644
|
- spec/cf/cli/user/register_spec.rb
|
641
645
|
- spec/cf/cli_spec.rb
|
642
646
|
- spec/console/console_spec.rb
|
647
|
+
- spec/factories/cfoundry/v2/domain_factory.rb
|
648
|
+
- spec/factories/cfoundry/v2/route_factory.rb
|
649
|
+
- spec/factories/cfoundry/v2/user_factory.rb
|
643
650
|
- spec/features/account_lifecycle_spec.rb
|
644
651
|
- spec/features/create_user_spec.rb
|
645
652
|
- spec/features/login_spec.rb
|
@@ -655,6 +662,7 @@ test_files:
|
|
655
662
|
- spec/spec_helper.rb
|
656
663
|
- spec/support/cli_helper.rb
|
657
664
|
- spec/support/config_helper.rb
|
665
|
+
- spec/support/factory_girl.rb
|
658
666
|
- spec/support/fake_home_dir.rb
|
659
667
|
- spec/support/features_helper.rb
|
660
668
|
- spec/support/interact_helper.rb
|