cf 0.6.1.rc3 → 0.6.1.rc4

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 (42) hide show
  1. data/lib/cf/cli.rb +6 -3
  2. data/lib/cf/cli/populators/base.rb +14 -0
  3. data/lib/cf/cli/populators/organization.rb +23 -0
  4. data/lib/cf/cli/populators/populator_methods.rb +52 -0
  5. data/lib/cf/cli/populators/space.rb +29 -0
  6. data/lib/cf/cli/populators/target.rb +13 -0
  7. data/lib/cf/cli/service/services.rb +5 -2
  8. data/lib/cf/cli/space/base.rb +6 -0
  9. data/lib/cf/cli/space/spaces.rb +46 -44
  10. data/lib/cf/cli/start/base.rb +7 -56
  11. data/lib/cf/cli/start/login.rb +3 -8
  12. data/lib/cf/cli/start/target.rb +5 -9
  13. data/lib/cf/version.rb +1 -1
  14. data/spec/assets/hello-sinatra/main.rb +5 -3
  15. data/spec/cf/cli/app/scale_spec.rb +5 -1
  16. data/spec/cf/cli/app/start_spec.rb +5 -1
  17. data/spec/cf/cli/domain/map_spec.rb +5 -1
  18. data/spec/cf/cli/domain/unmap_spec.rb +5 -1
  19. data/spec/cf/cli/organization/orgs_spec.rb +1 -1
  20. data/spec/cf/cli/populators/organization_spec.rb +130 -0
  21. data/spec/cf/cli/populators/space_spec.rb +131 -0
  22. data/spec/cf/cli/populators/target_spec.rb +18 -0
  23. data/spec/cf/cli/route/map_spec.rb +5 -1
  24. data/spec/cf/cli/route/unmap_spec.rb +5 -1
  25. data/spec/cf/cli/service/services_spec.rb +72 -0
  26. data/spec/cf/cli/space/create_spec.rb +24 -7
  27. data/spec/cf/cli/space/rename_spec.rb +16 -5
  28. data/spec/cf/cli/space/spaces_spec.rb +12 -2
  29. data/spec/cf/cli/space/switch_space_spec.rb +18 -3
  30. data/spec/cf/cli/start/login_spec.rb +28 -81
  31. data/spec/cf/cli/start/target_spec.rb +33 -32
  32. data/spec/cf/cli/user/register_spec.rb +5 -1
  33. data/spec/cf/cli_spec.rb +21 -1
  34. data/spec/features/account_lifecycle_spec.rb +8 -3
  35. data/spec/features/login_spec.rb +16 -11
  36. data/spec/features/push_flow_spec.rb +26 -11
  37. data/spec/features/switching_targets_spec.rb +42 -2
  38. data/spec/spec_helper.rb +1 -1
  39. data/spec/support/{command_helper.rb → cli_helper.rb} +18 -25
  40. data/spec/support/shared_examples/populate_organization.rb +6 -0
  41. metadata +20 -6
  42. data/lib/cf/cli/start/target_interactions.rb +0 -37
@@ -1,37 +0,0 @@
1
- module CF::Start
2
- module TargetInteractions
3
- def ask_organization
4
- orgs = client.organizations(:depth => 0)
5
-
6
- if orgs.empty?
7
- unless quiet?
8
- line
9
- line c("There are no organizations.", :warning)
10
- line "You may want to create one with #{c("create-org", :good)}."
11
- end
12
- elsif orgs.size == 1 && !input.interactive?(:organization)
13
- orgs.first
14
- else
15
- ask("Organization",
16
- :choices => orgs.sort_by(&:name),
17
- :display => proc(&:name))
18
- end
19
- end
20
-
21
- def ask_space(org)
22
- spaces = org.spaces(:depth => 0)
23
-
24
- if spaces.empty?
25
- unless quiet?
26
- line
27
- line c("There are no spaces in #{b(org.name)}.", :warning)
28
- line "You may want to create one with #{c("create-space", :good)}."
29
- end
30
- elsif spaces.size == 1 && !input.interactive?(:spaces)
31
- spaces.first
32
- else
33
- ask("Space", :choices => spaces, :display => proc(&:name))
34
- end
35
- end
36
- end
37
- end