cf 1.1.3.rc1 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/lib/cf/cli.rb +2 -7
  2. data/lib/cf/cli/organization/delete.rb +4 -6
  3. data/lib/cf/cli/service/create.rb +23 -17
  4. data/lib/cf/cli/space/create.rb +43 -41
  5. data/lib/cf/cli/space/space.rb +49 -46
  6. data/lib/cf/version.rb +1 -1
  7. data/lib/console/console.rb +1 -1
  8. data/spec/cf/cli/app/delete_spec.rb +16 -28
  9. data/spec/cf/cli/app/instances_spec.rb +4 -5
  10. data/spec/cf/cli/app/push/create_spec.rb +362 -373
  11. data/spec/cf/cli/app/push_spec.rb +216 -215
  12. data/spec/cf/cli/app/rename_spec.rb +28 -31
  13. data/spec/cf/cli/app/scale_spec.rb +44 -41
  14. data/spec/cf/cli/app/start_spec.rb +194 -193
  15. data/spec/cf/cli/app/stats_spec.rb +55 -56
  16. data/spec/cf/cli/domain/map_spec.rb +105 -102
  17. data/spec/cf/cli/domain/unmap_spec.rb +60 -56
  18. data/spec/cf/cli/organization/delete_spec.rb +85 -84
  19. data/spec/cf/cli/organization/orgs_spec.rb +80 -83
  20. data/spec/cf/cli/organization/rename_spec.rb +90 -89
  21. data/spec/cf/cli/populators/organization_spec.rb +117 -119
  22. data/spec/cf/cli/populators/space_spec.rb +107 -108
  23. data/spec/cf/cli/populators/target_spec.rb +17 -12
  24. data/spec/cf/cli/route/delete_spec.rb +4 -4
  25. data/spec/cf/cli/route/map_spec.rb +106 -102
  26. data/spec/cf/cli/route/unmap_spec.rb +5 -5
  27. data/spec/cf/cli/service/create_spec.rb +74 -46
  28. data/spec/cf/cli/service/rename_spec.rb +29 -33
  29. data/spec/cf/cli/service/services_spec.rb +48 -48
  30. data/spec/cf/cli/space/base_spec.rb +39 -32
  31. data/spec/cf/cli/space/create_spec.rb +52 -53
  32. data/spec/cf/cli/space/delete_spec.rb +84 -85
  33. data/spec/cf/cli/space/rename_spec.rb +93 -94
  34. data/spec/cf/cli/space/space_spec.rb +60 -60
  35. data/spec/cf/cli/space/spaces_spec.rb +75 -80
  36. data/spec/cf/cli/space/switch_space_spec.rb +45 -48
  37. data/spec/cf/cli/start/info_spec.rb +4 -6
  38. data/spec/cf/cli/start/login_spec.rb +18 -20
  39. data/spec/cf/cli/start/logout_spec.rb +36 -37
  40. data/spec/cf/cli/start/target_spec.rb +86 -89
  41. data/spec/cf/cli/user/create_spec.rb +83 -84
  42. data/spec/cf/cli/user/passwd_spec.rb +87 -86
  43. data/spec/cf/cli/user/register_spec.rb +109 -108
  44. data/spec/cf/cli_spec.rb +305 -310
  45. data/spec/console/console_spec.rb +58 -58
  46. data/spec/factories/cfoundry/v2/domain_factory.rb +8 -0
  47. data/spec/factories/cfoundry/v2/route_factory.rb +8 -0
  48. data/spec/factories/cfoundry/v2/user_factory.rb +7 -0
  49. data/spec/features/org_spec.rb +11 -11
  50. data/spec/manifests/manifests_spec.rb +21 -21
  51. data/spec/manifests/plugin_spec.rb +34 -34
  52. data/spec/spec_helper.rb +1 -2
  53. data/spec/support/cli_helper.rb +5 -14
  54. data/spec/support/factory_girl.rb +6 -0
  55. data/spec/support/interact_helper.rb +5 -15
  56. data/spec/support/shared_examples/errors.rb +1 -1
  57. data/spec/tunnel/plugin_spec.rb +2 -2
  58. data/spec/tunnel/tunnel_spec.rb +5 -5
  59. metadata +36 -28
@@ -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
@@ -5,15 +5,11 @@ module CliHelper
5
5
  end
6
6
 
7
7
  def stub_client
8
- any_instance_of described_class do |cli|
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
- any_instance_of described_class do |cli|
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
- stub(CF::CLI).exit { |code| code }
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
- any_instance_of described_class do |cli|
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
- any_instance_of described_class do |cli|
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
@@ -0,0 +1,6 @@
1
+ require "factory_girl"
2
+
3
+ RSpec.configure do |config|
4
+ FactoryGirl.find_definitions
5
+ config.include FactoryGirl::Syntax::Methods
6
+ end
@@ -1,29 +1,19 @@
1
1
  module InteractHelper
2
2
  def stub_ask(*args, &block)
3
- a_stub = nil
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
- a_mock = nil
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
- any_instance_of CF::CLI do |interactive|
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
- any_instance_of CF::CLI do |interactive|
26
- mock(interactive).with_progress(message) { |_, block| block.call }
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
@@ -7,7 +7,7 @@ shared_examples_for "an error that's obvious to the user" do |options|
7
7
  end
8
8
 
9
9
  it "sets the exit code to 1" do
10
- mock(context).exit_status(1)
10
+ context.should_receive(:exit_status).with(1)
11
11
  subject
12
12
  end
13
13
 
@@ -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(subject).config_file_path { "#{SPEC_ROOT}/fixtures/fake_home_dirs/with_custom_clients/.cf/#{CFTunnelPlugin::Tunnel::CLIENTS_FILE}" }
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(subject).config_file_path { File.expand_path("./.cf/#{CFTunnelPlugin::Tunnel::CLIENTS_FILE}") }
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" => {
@@ -38,14 +38,14 @@ describe CFTunnel do
38
38
  let(:host) { "caldecott" }
39
39
 
40
40
  before do
41
- stub(subject).random_helper_url { "caldecott" }
42
- stub(client).app { app }
43
- stub(client).current_space { space }
44
- stub(client).domains { [fake(:domain, :owning_organization => fake(:organization)), domain] }
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
- mock(app).create_route(:domain => domain, :host => host, :space => space)
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.3.rc1
5
- prerelease: 6
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-05-30 00:00:00.000000000 Z
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: webmock
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: '1.9'
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: '1.9'
276
+ version: 0.2.4
277
277
  - !ruby/object:Gem::Dependency
278
- name: rspec-instafail
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: 0.2.4
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: 0.2.4
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: -2659135865467122406
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: 1.3.1
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