static 1.0.0 → 1.0.1
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.
- checksums.yaml +7 -0
- data/bin/static +11 -0
- data/lib/static/cli.rb +2 -2
- data/lib/static/version.rb +1 -1
- data/vendor/cfoundry-0.5.2/LICENSE +746 -0
- data/vendor/cfoundry-0.5.2/Rakefile +38 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/applications.rb +53 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/domains.rb +16 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/frameworks.rb +22 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/helper.rb +131 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/login.rb +21 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/organization_users.rb +21 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/organizations.rb +70 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/routes.rb +26 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/runtimes.rb +22 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/service_bindings.rb +22 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/service_instances.rb +22 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/services.rb +25 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/spaces.rb +49 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub/users.rb +84 -0
- data/vendor/cfoundry-0.5.2/lib/cc_api_stub.rb +17 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/auth_token.rb +63 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/baseclient.rb +201 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/chatty_hash.rb +46 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/client.rb +46 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/concerns/login_helpers.rb +13 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/errors.rb +160 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/rest_client.rb +299 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/test_support.rb +3 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/trace_helpers.rb +40 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/uaaclient.rb +112 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/upload_helpers.rb +186 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/app.rb +363 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/base.rb +71 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/client.rb +193 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/framework.rb +21 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/model.rb +178 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/model_magic.rb +129 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/runtime.rb +24 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/service.rb +39 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/service_instance.rb +32 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/service_plan.rb +19 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v1/user.rb +22 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/app.rb +392 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/base.rb +83 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/client.rb +138 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/domain.rb +11 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/framework.rb +14 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/model.rb +148 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/model_magic.rb +449 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/organization.rb +16 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/route.rb +15 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/runtime.rb +12 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/service.rb +19 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/service_auth_token.rb +9 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/service_binding.rb +10 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/service_instance.rb +14 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/service_plan.rb +12 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/space.rb +18 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/v2/user.rb +64 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/validator.rb +39 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/version.rb +4 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry/zip.rb +56 -0
- data/vendor/cfoundry-0.5.2/lib/cfoundry.rb +2 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/applications_spec.rb +69 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/domains_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/frameworks_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/login_spec.rb +20 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/organization_users_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/organizations_spec.rb +97 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/routes_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/runtimes_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/service_bindings_spec.rb +13 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/service_instances_spec.rb +19 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/services_spec.rb +12 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/spaces_spec.rb +38 -0
- data/vendor/cfoundry-0.5.2/spec/cc_api_stub/users_spec.rb +107 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/auth_token_spec.rb +125 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/baseclient_spec.rb +225 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/client_spec.rb +15 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/errors_spec.rb +80 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/rest_client_spec.rb +281 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/trace_helpers_spec.rb +72 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/uaaclient_spec.rb +332 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/upload_helpers_spec.rb +174 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v1/base_spec.rb +58 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v1/client_spec.rb +17 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v1/model_magic_spec.rb +43 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/app_spec.rb +144 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/base_spec.rb +299 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/client_spec.rb +73 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/model_magic_spec.rb +173 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/organization_spec.rb +15 -0
- data/vendor/cfoundry-0.5.2/spec/cfoundry/v2/space_spec.rb +15 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/app_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/domain_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/framework_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/organization_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/route_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/runtime_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/service_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/service_instance_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/service_plan_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/space_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fakes/user_fake.rb +5 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_dotfiles/xyz +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_nested_directories/foo/bar/baz/fizz +0 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_nested_directories/xyz +0 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/ignored_dir/file_in_ignored_dir.txt +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/ignored_file.txt +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/non_ignored_dir/file_in_non_ignored_dir.txt +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/non_ignored_dir/ignored_file.txt +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/non_ignored_file.txt +1 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/empty_file +0 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_application.json +24 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_application_summary.json +57 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_application.json +11 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_domain.json +10 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_organization.json +11 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_route.json +13 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_service_instance.json +11 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_space.json +11 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_created_user.json +11 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_empty_search.json +7 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_frameworks.json +20 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_organization.json +144 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_organization_domains.json +34 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_organization_search.json +37 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_organization_summary.json +19 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_organization_users.json +81 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_runtimes.json +20 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_service_binding.json +22 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_service_bindings.json +24 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_service_instance.json +81 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_service_instances.json +0 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_service_types.json +124 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_space.json +45 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_space_summary.json +86 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_stats.json +29 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_user.json +112 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_user_organizations.json +92 -0
- data/vendor/cfoundry-0.5.2/spec/fixtures/fake_cc_user_with_managers.json +85 -0
- data/vendor/cfoundry-0.5.2/spec/spec_helper.rb +20 -0
- data/vendor/cfoundry-0.5.2/spec/support/fake_helper.rb +236 -0
- data/vendor/cfoundry-0.5.2/spec/support/randoms.rb +3 -0
- data/vendor/cfoundry-0.5.2/spec/support/shared_examples/cc_api_stub_request_examples.rb +79 -0
- data/vendor/cfoundry-0.5.2/spec/support/shared_examples/client_login_examples.rb +46 -0
- data/vendor/cfoundry-0.5.2/spec/support/shared_examples/model_summary_examples.rb +34 -0
- data/vendor/cfoundry-0.5.2/spec/support/v1_fake_helper.rb +144 -0
- data/vendor/cfoundry-0.5.2/vendor/errors/README.md +4 -0
- data/vendor/cfoundry-0.5.2/vendor/errors/v1.yml +189 -0
- data/vendor/cfoundry-0.5.2/vendor/errors/v2.yml +360 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/Rakefile +39 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/config/clients.yml +17 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/helper-app/Gemfile +10 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/helper-app/server.rb +43 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/plugin.rb +178 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb +308 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/version.rb +3 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/spec/plugin_spec.rb +29 -0
- data/vendor/tunnel-vmc-plugin-0.2.2/spec/spec_helper.rb +15 -0
- data/vendor/vmc-0.5.0/LICENSE +1277 -0
- data/vendor/vmc-0.5.0/Rakefile +101 -0
- data/vendor/vmc-0.5.0/bin/vmc +11 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/app.rb +45 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/apps.rb +99 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/base.rb +82 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/crashes.rb +42 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/delete.rb +95 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/deprecated.rb +11 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/env.rb +78 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/files.rb +137 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/health.rb +26 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/instances.rb +53 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/logs.rb +76 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/push/create.rb +153 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/push/interactions.rb +94 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/push/sync.rb +64 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/push.rb +105 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/rename.rb +35 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/restart.rb +20 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/scale.rb +71 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/start.rb +150 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/stats.rb +67 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/app/stop.rb +27 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/domain/base.rb +12 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/domain/domains.rb +40 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/domain/map.rb +55 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/domain/unmap.rb +56 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/help.rb +15 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/interactive.rb +105 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/base.rb +14 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/create.rb +32 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/delete.rb +73 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/org.rb +45 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/orgs.rb +35 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/organization/rename.rb +36 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/route/base.rb +12 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/route/map.rb +80 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/route/routes.rb +26 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/route/unmap.rb +94 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/base.rb +8 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/bind.rb +44 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/create.rb +126 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/delete.rb +86 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/rename.rb +35 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/service.rb +42 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/services.rb +114 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/service/unbind.rb +38 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/base.rb +21 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/create.rb +60 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/delete.rb +95 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/rename.rb +39 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/space.rb +64 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/spaces.rb +55 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/space/switch.rb +16 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/base.rb +83 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/colors.rb +13 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/info.rb +126 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/login.rb +96 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/logout.rb +17 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/target.rb +71 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/target_interactions.rb +37 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/start/targets.rb +16 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/base.rb +29 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/create.rb +39 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/delete.rb +27 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/passwd.rb +50 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/register.rb +42 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli/user/users.rb +32 -0
- data/vendor/vmc-0.5.0/lib/vmc/cli.rb +475 -0
- data/vendor/vmc-0.5.0/lib/vmc/constants.rb +13 -0
- data/vendor/vmc-0.5.0/lib/vmc/detect.rb +129 -0
- data/vendor/vmc-0.5.0/lib/vmc/errors.rb +17 -0
- data/vendor/vmc-0.5.0/lib/vmc/plugin.rb +56 -0
- data/vendor/vmc-0.5.0/lib/vmc/spacing.rb +89 -0
- data/vendor/vmc-0.5.0/lib/vmc/spec_helper.rb +1 -0
- data/vendor/vmc-0.5.0/lib/vmc/test_support.rb +6 -0
- data/vendor/vmc-0.5.0/lib/vmc/version.rb +3 -0
- data/vendor/vmc-0.5.0/lib/vmc.rb +8 -0
- data/vendor/vmc-0.5.0/spec/assets/hello-sinatra/Gemfile +3 -0
- data/vendor/vmc-0.5.0/spec/assets/hello-sinatra/config.ru +3 -0
- data/vendor/vmc-0.5.0/spec/assets/hello-sinatra/main.rb +6 -0
- data/vendor/vmc-0.5.0/spec/assets/specker_runner/specker_runner_input.rb +6 -0
- data/vendor/vmc-0.5.0/spec/assets/specker_runner/specker_runner_pause.rb +5 -0
- data/vendor/vmc-0.5.0/spec/console_app_specker/console_app_specker_matchers_spec.rb +152 -0
- data/vendor/vmc-0.5.0/spec/console_app_specker/specker_runner_spec.rb +157 -0
- data/vendor/vmc-0.5.0/spec/features/v1/new_user_flow_spec.rb +109 -0
- data/vendor/vmc-0.5.0/spec/features/v2/account_lifecycle_spec.rb +64 -0
- data/vendor/vmc-0.5.0/spec/features/v2/push_flow_spec.rb +125 -0
- data/vendor/vmc-0.5.0/spec/features/v2/switching_targets_spec.rb +32 -0
- data/vendor/vmc-0.5.0/spec/spec_helper.rb +63 -0
- data/vendor/vmc-0.5.0/spec/support/command_helper.rb +80 -0
- data/vendor/vmc-0.5.0/spec/support/config_helper.rb +15 -0
- data/vendor/vmc-0.5.0/spec/support/console_app_specker_matchers.rb +75 -0
- data/vendor/vmc-0.5.0/spec/support/fake_home_dir.rb +55 -0
- data/vendor/vmc-0.5.0/spec/support/interact_helper.rb +29 -0
- data/vendor/vmc-0.5.0/spec/support/shared_examples/errors.rb +40 -0
- data/vendor/vmc-0.5.0/spec/support/shared_examples/input.rb +14 -0
- data/vendor/vmc-0.5.0/spec/support/specker_runner.rb +79 -0
- data/vendor/vmc-0.5.0/spec/support/tracking_expector.rb +71 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/base_spec.rb +17 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/delete_spec.rb +188 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/instances_spec.rb +65 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/push/create_spec.rb +591 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/push_spec.rb +369 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/rename_spec.rb +104 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/scale_spec.rb +76 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/start_spec.rb +168 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/app/stats_spec.rb +68 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/domain/map_spec.rb +130 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/domain/unmap_spec.rb +69 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/organization/orgs_spec.rb +108 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/organization/rename_spec.rb +113 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/route/map_spec.rb +140 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/route/unmap_spec.rb +221 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/service/bind_spec.rb +25 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/service/delete_spec.rb +22 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/service/rename_spec.rb +105 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/service/service_spec.rb +23 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/service/unbind_spec.rb +25 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/space/create_spec.rb +73 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/space/rename_spec.rb +102 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/space/spaces_spec.rb +104 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/space/switch_space_spec.rb +55 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/start/info_spec.rb +160 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/start/login_spec.rb +142 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/start/logout_spec.rb +50 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/start/target_spec.rb +123 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/user/create_spec.rb +54 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/user/delete_spec.rb +51 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/user/passwd_spec.rb +102 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli/user/register_spec.rb +140 -0
- data/vendor/vmc-0.5.0/spec/vmc/cli_spec.rb +448 -0
- data/vendor/vmc-0.5.0/spec/vmc/detect_spec.rb +54 -0
- metadata +446 -43
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe VMC::CLI do
|
|
4
|
+
let(:context) { VMC::CLI.new }
|
|
5
|
+
let(:command) { nil }
|
|
6
|
+
|
|
7
|
+
let(:fake_home_dir) { nil }
|
|
8
|
+
stub_home_dir_with { fake_home_dir }
|
|
9
|
+
|
|
10
|
+
describe "#wrap_errors" do
|
|
11
|
+
let(:inputs) { {} }
|
|
12
|
+
|
|
13
|
+
subject do
|
|
14
|
+
capture_output do
|
|
15
|
+
stub(context).input { inputs }
|
|
16
|
+
context.wrap_errors { action.call }
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context "with a CFoundry::Timeout" do
|
|
21
|
+
let(:action) { proc { raise CFoundry::Timeout.new(123, "fizzbuzz") } }
|
|
22
|
+
|
|
23
|
+
it_behaves_like "an error that's obvious to the user",
|
|
24
|
+
:with_message => "fizzbuzz"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context "with a UserError" do
|
|
28
|
+
let(:action) { proc { context.fail "foo bar" } }
|
|
29
|
+
|
|
30
|
+
it_behaves_like "an error that's obvious to the user",
|
|
31
|
+
:with_message => "foo bar"
|
|
32
|
+
|
|
33
|
+
it "saves it in the crashlog" do
|
|
34
|
+
mock(context).log_error(anything)
|
|
35
|
+
subject
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
context "with a SystemExit" do
|
|
40
|
+
let(:action) { proc { exit 1 } }
|
|
41
|
+
|
|
42
|
+
it_behaves_like "an error that gets passed through",
|
|
43
|
+
:with_exception => SystemExit
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
context "with a Mothership::Error" do
|
|
47
|
+
let(:action) { proc { raise Mothership::Error } }
|
|
48
|
+
|
|
49
|
+
it_behaves_like "an error that gets passed through",
|
|
50
|
+
:with_exception => Mothership::Error
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
context "with an Interrupt" do
|
|
54
|
+
let(:action) { proc { raise Interrupt } }
|
|
55
|
+
|
|
56
|
+
it "sets the exit code to 130" do
|
|
57
|
+
mock(context).exit_status(130)
|
|
58
|
+
subject
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
context "with a CFoundry authentication error" do
|
|
63
|
+
let(:action) { proc { raise CFoundry::InvalidAuthToken.new("foo bar") } }
|
|
64
|
+
let(:asked) { false }
|
|
65
|
+
|
|
66
|
+
before do
|
|
67
|
+
$vmc_asked_auth = asked
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it "tells the user they are not authenticated" do
|
|
71
|
+
stub(context).invoke(:login)
|
|
72
|
+
subject
|
|
73
|
+
expect(stdout.string).to include "Not authenticated! Try logging in:"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it "asks the user to log in" do
|
|
77
|
+
mock(context).invoke(:login)
|
|
78
|
+
subject
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
context "and after logging in they got another authentication error" do
|
|
82
|
+
let(:asked) { true }
|
|
83
|
+
|
|
84
|
+
it "does not ask them to log in" do
|
|
85
|
+
dont_allow(context).invoke(:login)
|
|
86
|
+
subject
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it_behaves_like "an error that's obvious to the user",
|
|
90
|
+
:with_message => "Denied: foo bar"
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
context "with an arbitrary exception" do
|
|
95
|
+
let(:action) { proc { raise "foo bar" } }
|
|
96
|
+
|
|
97
|
+
it "logs the error" do
|
|
98
|
+
mock(context).log_error(anything)
|
|
99
|
+
subject
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it "prints the message" do
|
|
103
|
+
subject
|
|
104
|
+
expect(stderr.string).to include "RuntimeError: foo bar"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
it "sets the exit code to 1" do
|
|
108
|
+
mock(context).exit_status(1)
|
|
109
|
+
subject
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
it "tells the user to check ~/.vmc/crash" do
|
|
113
|
+
subject
|
|
114
|
+
expect(stderr.string).to include VMC::CRASH_FILE
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
context "when we are debugging" do
|
|
118
|
+
let(:inputs) { { :debug => true } }
|
|
119
|
+
|
|
120
|
+
it_behaves_like "an error that gets passed through",
|
|
121
|
+
:with_exception => RuntimeError
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
describe '#execute' do
|
|
127
|
+
let(:inputs) { {} }
|
|
128
|
+
let(:client) { fake_client }
|
|
129
|
+
|
|
130
|
+
before do
|
|
131
|
+
any_instance_of(VMC::CLI) do |cli|
|
|
132
|
+
stub(cli).client { client }
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
subject do
|
|
137
|
+
capture_output do
|
|
138
|
+
stub(context).input { inputs }
|
|
139
|
+
context.execute(command, [])
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
describe "token refreshing" do
|
|
144
|
+
let(:context) { TokenRefreshDummy.new }
|
|
145
|
+
let(:command) { Mothership.commands[:refresh_token] }
|
|
146
|
+
let(:auth_token) { CFoundry::AuthToken.new("old-header") }
|
|
147
|
+
let(:new_auth_token) { CFoundry::AuthToken.new("new-header") }
|
|
148
|
+
|
|
149
|
+
class TokenRefreshDummy < VMC::CLI
|
|
150
|
+
class << self
|
|
151
|
+
attr_accessor :new_token
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def precondition; end
|
|
155
|
+
|
|
156
|
+
desc "XXX"
|
|
157
|
+
def refresh_token
|
|
158
|
+
if client
|
|
159
|
+
client.token = self.class.new_token
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
context "when there is a target" do
|
|
165
|
+
before do
|
|
166
|
+
TokenRefreshDummy.new_token = nil
|
|
167
|
+
client.token = auth_token
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
context "when the token refreshes" do
|
|
171
|
+
it "saves to the target file" do
|
|
172
|
+
any_instance_of(TokenRefreshDummy) do |trd|
|
|
173
|
+
trd.new_token = new_auth_token
|
|
174
|
+
|
|
175
|
+
stub(trd).target_info { {} }
|
|
176
|
+
mock(trd).save_target_info(anything) do |info|
|
|
177
|
+
expect(info[:token]).to eq new_auth_token.auth_header
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
subject
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
context "but there is no token initially" do
|
|
186
|
+
let(:auth_token) { nil }
|
|
187
|
+
|
|
188
|
+
it "doesn't save the new token because something else probably did" do
|
|
189
|
+
dont_allow(context).save_target_info(anything)
|
|
190
|
+
subject
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
context "and the token becomes nil" do
|
|
195
|
+
let(:new_auth_token) { nil }
|
|
196
|
+
|
|
197
|
+
it "doesn't save the nil token" do
|
|
198
|
+
dont_allow(context).save_target_info(anything)
|
|
199
|
+
subject
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
context "when there is no target" do
|
|
205
|
+
let(:client) { nil }
|
|
206
|
+
|
|
207
|
+
it "doesn't try to compare the tokens" do
|
|
208
|
+
expect { subject }.to_not raise_error
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
describe '#log_error' do
|
|
215
|
+
subject do
|
|
216
|
+
context.log_error(exception)
|
|
217
|
+
File.read(File.expand_path(VMC::CRASH_FILE))
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
context 'when the exception is a normal error' do
|
|
221
|
+
let(:exception) do
|
|
222
|
+
error = StandardError.new("gemfiles are kinda hard")
|
|
223
|
+
error.set_backtrace(["fo/gems/bar", "baz quick"])
|
|
224
|
+
error
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
it { should include "Time of crash:"}
|
|
228
|
+
it { should include "gemfiles are kinda hard" }
|
|
229
|
+
it { should include "bar" }
|
|
230
|
+
it { should_not include "fo/gems/bar" }
|
|
231
|
+
it { should include "baz quick" }
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
context 'when the exception is an APIError' do
|
|
235
|
+
let(:request) { { :method => "GET", :url => "http://api.cloudfoundry.com/foo", :headers => {}, :body => nil } }
|
|
236
|
+
let(:response) { { :status => 404, :body => "bar", :headers => {} } }
|
|
237
|
+
let(:exception) do
|
|
238
|
+
error = CFoundry::APIError.new(nil, nil, request, response)
|
|
239
|
+
error.set_backtrace(["fo/gems/bar", "baz quick"])
|
|
240
|
+
error
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
before do
|
|
244
|
+
stub(response).body {"Response Body"}
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
it { should include "REQUEST: " }
|
|
248
|
+
it { should include "RESPONSE: " }
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
describe "#client_target" do
|
|
253
|
+
subject { context.client_target }
|
|
254
|
+
|
|
255
|
+
context "when a ~/.vmc/target exists" do
|
|
256
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
|
257
|
+
|
|
258
|
+
it "returns the target in that file" do
|
|
259
|
+
expect(subject).to eq "https://api.some-domain.com"
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
context "when a ~/.vmc_target exists" do
|
|
264
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
|
265
|
+
|
|
266
|
+
it "returns the target in that file" do
|
|
267
|
+
expect(subject).to eq "https://api.some-domain.com"
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
context "when no target file exists" do
|
|
272
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
|
273
|
+
|
|
274
|
+
it "returns nil" do
|
|
275
|
+
expect(subject).to eq nil
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
describe "#targets_info" do
|
|
281
|
+
subject { context.targets_info }
|
|
282
|
+
|
|
283
|
+
context "when a ~/.vmc/tokens.yml exists" do
|
|
284
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
|
285
|
+
|
|
286
|
+
it "returns the file's contents as a hash" do
|
|
287
|
+
expect(subject).to eq({
|
|
288
|
+
"https://api.some-domain.com" => {
|
|
289
|
+
:token => "bearer some-token",
|
|
290
|
+
:version => 2
|
|
291
|
+
}
|
|
292
|
+
})
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
context "when a ~/.vmc_token file exists" do
|
|
297
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
|
298
|
+
|
|
299
|
+
it "returns the target in that file" do
|
|
300
|
+
expect(subject).to eq({
|
|
301
|
+
"https://api.some-domain.com" => {
|
|
302
|
+
:token => "bearer some-token"
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
context "when no token file exists" do
|
|
309
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
|
310
|
+
|
|
311
|
+
it "returns an empty hash" do
|
|
312
|
+
expect(subject).to eq({})
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
describe "#target_info" do
|
|
318
|
+
subject { VMC::CLI.new.target_info("https://api.some-domain.com") }
|
|
319
|
+
|
|
320
|
+
context "when a ~/.vmc/tokens.yml exists" do
|
|
321
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
|
322
|
+
|
|
323
|
+
it "returns the info for the given url" do
|
|
324
|
+
expect(subject).to eq({
|
|
325
|
+
:token => "bearer some-token",
|
|
326
|
+
:version => 2
|
|
327
|
+
})
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
context "when a ~/.vmc_token file exists" do
|
|
332
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
|
333
|
+
|
|
334
|
+
it "returns the info for the given url" do
|
|
335
|
+
expect(subject).to eq({
|
|
336
|
+
:token => "bearer some-token"
|
|
337
|
+
})
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
context "when no token file exists" do
|
|
342
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
|
343
|
+
|
|
344
|
+
it "returns an empty hash" do
|
|
345
|
+
expect(subject).to eq({})
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
describe "methods that update the token info" do
|
|
351
|
+
before do
|
|
352
|
+
stub(context).targets_info do
|
|
353
|
+
{
|
|
354
|
+
"https://api.some-domain.com" => { :token => "bearer token1" },
|
|
355
|
+
"https://api.some-other-domain.com" => { :token => "bearer token2" }
|
|
356
|
+
}
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
describe "#save_target_info" do
|
|
361
|
+
it "adds the given target info, and writes the result to ~/.vmc/tokens.yml" do
|
|
362
|
+
context.save_target_info({ :token => "bearer token3" }, "https://api.some-domain.com")
|
|
363
|
+
YAML.load_file(File.expand_path("~/.vmc/tokens.yml")).should == {
|
|
364
|
+
"https://api.some-domain.com" => { :token => "bearer token3" },
|
|
365
|
+
"https://api.some-other-domain.com" => { :token => "bearer token2" }
|
|
366
|
+
}
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
describe "#remove_target_info" do
|
|
371
|
+
it "removes the given target, and writes the result to ~/.vmc/tokens.yml" do
|
|
372
|
+
context.remove_target_info("https://api.some-domain.com")
|
|
373
|
+
YAML.load_file(File.expand_path("~/.vmc/tokens.yml")).should == {
|
|
374
|
+
"https://api.some-other-domain.com" => { :token => "bearer token2" }
|
|
375
|
+
}
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
describe "#client" do
|
|
381
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/new" }
|
|
382
|
+
|
|
383
|
+
before { stub(context).input { {} } }
|
|
384
|
+
|
|
385
|
+
describe "the client's token" do
|
|
386
|
+
it "constructs an AuthToken object with the data from the tokens.yml file" do
|
|
387
|
+
expect(context.client.token).to be_a(CFoundry::AuthToken)
|
|
388
|
+
expect(context.client.token.auth_header).to eq("bearer some-token")
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
it "does not assign an AuthToken on the client if there is no token stored" do
|
|
392
|
+
mock(context).target_info("some-fake-target") { { :version => 2 } }
|
|
393
|
+
expect(context.client("some-fake-target").token).to be_nil
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
describe "the client's version" do
|
|
398
|
+
it "uses the version stored in the yml file" do
|
|
399
|
+
expect(context.client.version).to eq(2)
|
|
400
|
+
end
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
context "when there is no target" do
|
|
404
|
+
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
|
405
|
+
|
|
406
|
+
it "returns nil" do
|
|
407
|
+
expect(context.client).to eq(nil)
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
context "with a v1 cloud controller" do
|
|
412
|
+
before do
|
|
413
|
+
stub(context).target_info { { :version => 1} }
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
it "connects using the v1 api" do
|
|
417
|
+
expect(context.client).to be_a(CFoundry::V1::Client)
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
context "with a proxy user" do
|
|
421
|
+
before { stub(context).input { {:proxy => 'foo@example.com'} } }
|
|
422
|
+
|
|
423
|
+
it "uses the provided client proxy user" do
|
|
424
|
+
expect(context.client.proxy).to eq('foo@example.com')
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
context "with a v2 cloud controller" do
|
|
430
|
+
before do
|
|
431
|
+
stub(context).target_info { { :version => 2} }
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
it "connects using the v2 api" do
|
|
435
|
+
expect(context.client).to be_a(CFoundry::V2::Client)
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
context "with a proxy user" do
|
|
439
|
+
before { stub(context).input { {:proxy => 'foo@example.com'} } }
|
|
440
|
+
|
|
441
|
+
it "foo" do
|
|
442
|
+
expect {context.client}.to raise_error(VMC::UserError, "User switching not implemented for v2.")
|
|
443
|
+
end
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
end
|
|
447
|
+
end
|
|
448
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe VMC::Detector do
|
|
4
|
+
let(:client) { fake_client :frameworks => [framework] }
|
|
5
|
+
let(:detector) { VMC::Detector.new client, nil }
|
|
6
|
+
|
|
7
|
+
describe '#detect_framework' do
|
|
8
|
+
subject { detector.detect_framework }
|
|
9
|
+
|
|
10
|
+
{ Clouseau::Django => "django",
|
|
11
|
+
Clouseau::DotNet => "dotNet",
|
|
12
|
+
Clouseau::Grails => "grails",
|
|
13
|
+
Clouseau::Java => "java_web",
|
|
14
|
+
Clouseau::Lift => "lift",
|
|
15
|
+
Clouseau::Node => "node",
|
|
16
|
+
Clouseau::PHP => "php",
|
|
17
|
+
Clouseau::Play => "play",
|
|
18
|
+
Clouseau::Python => "wsgi",
|
|
19
|
+
Clouseau::Rack => "rack",
|
|
20
|
+
Clouseau::Rails => "rails3",
|
|
21
|
+
Clouseau::Sinatra => "sinatra",
|
|
22
|
+
Clouseau::Spring => "spring"
|
|
23
|
+
}.each do |clouseau_detective, cf_name|
|
|
24
|
+
context "when we detected #{clouseau_detective}" do
|
|
25
|
+
let(:framework) { fake(:framework, :name => cf_name) }
|
|
26
|
+
|
|
27
|
+
it "maps to CF name #{cf_name}" do
|
|
28
|
+
stub(Clouseau).detect(anything) { clouseau_detective }
|
|
29
|
+
should eq framework
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe '#detect_runtime' do
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe '#runtimes' do
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe '#suggested_memory' do
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe '#all_runtimes' do
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe '#all_frameworks' do
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|