static 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,299 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe CFoundry::V2::Base do
|
4
|
+
let(:target) { "https://api.cloudfoundry.com" }
|
5
|
+
let(:base) { CFoundry::V2::Base.new(target) }
|
6
|
+
|
7
|
+
describe "helper methods for HTTP verbs" do
|
8
|
+
let(:rest_client) { base.rest_client }
|
9
|
+
let(:path) { "some-path" }
|
10
|
+
let(:options) { { :some => :option} }
|
11
|
+
let(:url) { target + "/" + path }
|
12
|
+
let(:args) { [path, options] }
|
13
|
+
|
14
|
+
shared_examples "handling responses" do |verb|
|
15
|
+
context 'when successful' do
|
16
|
+
context 'and the accept type is JSON' do
|
17
|
+
let(:options) { {:accept => :json} }
|
18
|
+
|
19
|
+
it 'returns the parsed JSON' do
|
20
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return(:status => 200, :body => "{\"hello\": \"there\"}")
|
21
|
+
expect(subject).to eq(:hello => "there")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'and the accept type is not JSON' do
|
26
|
+
let(:options) { {:accept => :form} }
|
27
|
+
|
28
|
+
it 'returns the body' do
|
29
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return :status => 200, :body => "body"
|
30
|
+
expect(subject).to eq "body"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when an error occurs' do
|
36
|
+
let(:response_code) { 404 }
|
37
|
+
|
38
|
+
it 'raises the correct error if JSON is parsed successfully' do
|
39
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return(
|
40
|
+
:status => response_code,
|
41
|
+
:body => "{\"code\": 111, \"description\": \"Something bad happened\"}"
|
42
|
+
)
|
43
|
+
expect {subject}.to raise_error(CFoundry::SystemError, "111: Something bad happened")
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'raises the correct error if code is missing from response' do
|
47
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return(
|
48
|
+
:status => response_code,
|
49
|
+
:body => "{\"description\": \"Something bad happened\"}"
|
50
|
+
)
|
51
|
+
expect {subject}.to raise_error CFoundry::NotFound
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'raises the correct error if response body is not JSON' do
|
55
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return(
|
56
|
+
:status => response_code,
|
57
|
+
:body => "Error happened"
|
58
|
+
)
|
59
|
+
expect {subject}.to raise_error CFoundry::NotFound
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'raises a generic APIError if code is not recognized' do
|
63
|
+
stub_request(:any, 'https://api.cloudfoundry.com/some-path').to_return :status => response_code,
|
64
|
+
:body => "{\"code\": 6932, \"description\": \"Something bad happened\"}"
|
65
|
+
expect {subject}.to raise_error CFoundry::APIError, "6932: Something bad happened"
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'when a timeout exception occurs' do
|
69
|
+
before { stub_request(:any, url).to_raise(::Timeout::Error) }
|
70
|
+
|
71
|
+
it 'raises the correct error' do
|
72
|
+
expect { subject }.to raise_error CFoundry::Timeout, /#{url} timed out/
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'when an HTTPNotFound error occurs' do
|
77
|
+
before { stub_request(:any, url).to_return(:status => 404, :body => "NOT FOUND") }
|
78
|
+
|
79
|
+
it 'raises the correct error' do
|
80
|
+
expect {subject}.to raise_error CFoundry::NotFound, "404: NOT FOUND"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context 'when an HTTPForbidden error occurs' do
|
85
|
+
before { stub_request(:any, url).to_return(:status => 403, :body => "NONE SHALL PASS") }
|
86
|
+
|
87
|
+
it 'raises the correct error' do
|
88
|
+
expect { subject }.to raise_error CFoundry::Denied, "403: NONE SHALL PASS"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context "when any other type of error occurs" do
|
93
|
+
before { stub_request(:any, url).to_return(:status => 411, :body => "NOT LONG ENOUGH") }
|
94
|
+
|
95
|
+
it 'raises the correct error' do
|
96
|
+
expect { subject }.to raise_error CFoundry::BadResponse, "411: NOT LONG ENOUGH"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'includes the request and response hashes when it raises errors' do
|
101
|
+
stub_request(:any, url).to_return(:status => 411, :body => "NOT LONG ENOUGH")
|
102
|
+
|
103
|
+
begin
|
104
|
+
subject
|
105
|
+
rescue CFoundry::BadResponse => e
|
106
|
+
expect(e.response).to eq({
|
107
|
+
:status => "411",
|
108
|
+
:headers => {},
|
109
|
+
:body => "NOT LONG ENOUGH"
|
110
|
+
})
|
111
|
+
expect(e.request).to eq({
|
112
|
+
:headers => { "Content-Length" => 0 },
|
113
|
+
:method => verb,
|
114
|
+
:body => nil,
|
115
|
+
:url => "https://api.cloudfoundry.com/some-path"
|
116
|
+
})
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
shared_examples "normalizing arguments" do |verb|
|
123
|
+
context "when multiple path segments are passed" do
|
124
|
+
let(:segments) { ["first-segment", "next-segment"] }
|
125
|
+
|
126
|
+
context "when an options hash is not supplied" do
|
127
|
+
let(:args) { segments }
|
128
|
+
|
129
|
+
it "makes a request with the correct url and options" do
|
130
|
+
mock(rest_client).request(verb, "first-segment/next-segment", {}) { [request, response] }
|
131
|
+
subject
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
context "when an options has is supplied" do
|
136
|
+
let(:args) { segments + [options] }
|
137
|
+
|
138
|
+
it "makes a request with the correct url and options" do
|
139
|
+
mock(rest_client).request(verb, "first-segment/next-segment", options) { [request, response] }
|
140
|
+
subject
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context "when a single path segment is passed" do
|
146
|
+
context "when an options hash is not supplied" do
|
147
|
+
let(:args) { ["first-segment"] }
|
148
|
+
|
149
|
+
it "makes a request with the correct url and options" do
|
150
|
+
mock(rest_client).request(verb, "first-segment", {}) { [request, response] }
|
151
|
+
subject
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
context "when an options has is supplied" do
|
156
|
+
let(:args) { ["first-segment", options] }
|
157
|
+
|
158
|
+
it "makes a request with the correct url and options" do
|
159
|
+
mock(rest_client).request(verb, "first-segment", options) { [request, response] }
|
160
|
+
subject
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
let(:response) { { :status => "201", :headers => { "some-header-key" => "some-header-value" }, :body => "some-body" } }
|
167
|
+
let(:request) do
|
168
|
+
{
|
169
|
+
:method => "GET",
|
170
|
+
:url => "http://api.cloudfoundry.com/some-path",
|
171
|
+
:headers => { "some-header-key" => "some-header-value" },
|
172
|
+
:body => "some-body"
|
173
|
+
}
|
174
|
+
end
|
175
|
+
|
176
|
+
describe "#get" do
|
177
|
+
subject { base.get(*args) }
|
178
|
+
|
179
|
+
it "makes a GET request" do
|
180
|
+
mock(rest_client).request("GET", "some-path", options) { [request, response] }
|
181
|
+
subject
|
182
|
+
end
|
183
|
+
|
184
|
+
include_examples "handling responses", "GET"
|
185
|
+
include_examples "normalizing arguments", "GET"
|
186
|
+
end
|
187
|
+
|
188
|
+
describe "#post" do
|
189
|
+
subject { base.post(*args) }
|
190
|
+
|
191
|
+
it "makes a POST request" do
|
192
|
+
mock(rest_client).request("POST", "some-path", options) { [request, response] }
|
193
|
+
subject
|
194
|
+
end
|
195
|
+
|
196
|
+
include_examples "handling responses", "POST"
|
197
|
+
include_examples "normalizing arguments", "POST"
|
198
|
+
end
|
199
|
+
|
200
|
+
describe "#put" do
|
201
|
+
subject { base.put(*args) }
|
202
|
+
|
203
|
+
it "makes a PUT request" do
|
204
|
+
mock(rest_client).request("PUT", "some-path", options) { [request, response] }
|
205
|
+
subject
|
206
|
+
end
|
207
|
+
|
208
|
+
include_examples "handling responses", "PUT"
|
209
|
+
include_examples "normalizing arguments", "PUT"
|
210
|
+
end
|
211
|
+
|
212
|
+
describe "#delete" do
|
213
|
+
subject { base.delete(*args) }
|
214
|
+
|
215
|
+
it "makes a DELETE request" do
|
216
|
+
mock(rest_client).request("DELETE", "some-path", options) { [request, response] }
|
217
|
+
subject
|
218
|
+
end
|
219
|
+
|
220
|
+
include_examples "handling responses", "DELETE"
|
221
|
+
include_examples "normalizing arguments", "DELETE"
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
describe "#resource_match" do
|
226
|
+
let(:fingerprints) { "some-fingerprints" }
|
227
|
+
|
228
|
+
it "makes a PUT request to the resource_match endpoint with the correct payload" do
|
229
|
+
stub = stub_request(:put, "https://api.cloudfoundry.com/v2/resource_match").
|
230
|
+
with(:body => fingerprints).
|
231
|
+
to_return(:body => "{}")
|
232
|
+
base.resource_match(fingerprints)
|
233
|
+
expect(stub).to have_been_requested
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
describe "#upload_app" do
|
238
|
+
let(:guid) { "some-guid" }
|
239
|
+
let(:bits) { "some-bits" }
|
240
|
+
let(:fake_zipfile) { File.new("#{SPEC_ROOT}/fixtures/empty_file") }
|
241
|
+
|
242
|
+
it "makes a PUT request to the app bits endpoint with the correct payload" do
|
243
|
+
stub = stub_request(:put, "https://api.cloudfoundry.com/v2/apps/#{guid}/bits").to_return(:body => "{}")
|
244
|
+
base.upload_app(guid, fake_zipfile)
|
245
|
+
expect(stub).to have_been_requested
|
246
|
+
end
|
247
|
+
|
248
|
+
context "when there is no file to upload" do
|
249
|
+
it "does not include 'application' in the request hash" do
|
250
|
+
stub =
|
251
|
+
stub_request(
|
252
|
+
:put,
|
253
|
+
"https://api.cloudfoundry.com/v2/apps/#{guid}/bits"
|
254
|
+
).with { |request|
|
255
|
+
request.body =~ /name="resources"/ &&
|
256
|
+
request.body !~ /name="application"/
|
257
|
+
}.to_return(
|
258
|
+
:body => "{}"
|
259
|
+
)
|
260
|
+
base.upload_app(guid)
|
261
|
+
expect(stub).to have_been_requested
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
describe "#stream_file" do
|
267
|
+
let(:app_guid) { "1234" }
|
268
|
+
let(:instance_guid) { "3456" }
|
269
|
+
let(:api_url) { "https://api.cloudfoundry.com/v2/apps/#{app_guid}/instances/#{instance_guid}/files/some/path/segments" }
|
270
|
+
let(:file_url) { "http://api.cloudfoundry.com/static/path/to/some/file" }
|
271
|
+
|
272
|
+
before do
|
273
|
+
stub(base).token { CFoundry::AuthToken.new("bearer foo") }
|
274
|
+
end
|
275
|
+
|
276
|
+
it "follows the redirect returned by the files endpoint" do
|
277
|
+
stub_request(:get, api_url).to_return(
|
278
|
+
:status => 301,
|
279
|
+
:headers => { "location" => file_url },
|
280
|
+
:body => ""
|
281
|
+
)
|
282
|
+
|
283
|
+
request =
|
284
|
+
stub_request(
|
285
|
+
:get, file_url + "&tail"
|
286
|
+
).with(
|
287
|
+
:headers => { "Accept" => "*/*", "Authorization" => "bearer foo" }
|
288
|
+
).to_return(
|
289
|
+
:status => 200,
|
290
|
+
:body => "some body chunks"
|
291
|
+
)
|
292
|
+
|
293
|
+
base.stream_file(app_guid, instance_guid, "some", "path", "segments") do |body|
|
294
|
+
expect(request).to have_been_made
|
295
|
+
expect(body).to eql("some body chunks")
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CFoundry::V2::Client do
|
4
|
+
let(:client) { CFoundry::V2::Client.new }
|
5
|
+
|
6
|
+
describe "#register" do
|
7
|
+
let(:uaa) { CFoundry::UAAClient.new }
|
8
|
+
let(:email) { 'test@test.com' }
|
9
|
+
let(:password) { 'secret' }
|
10
|
+
|
11
|
+
subject { client.register(email, password) }
|
12
|
+
|
13
|
+
it "creates the user in uaa and ccng" do
|
14
|
+
stub(client.base).uaa { uaa }
|
15
|
+
stub(uaa).add_user(email, password) { { "id" => "1234" } }
|
16
|
+
|
17
|
+
user = fake(:user)
|
18
|
+
stub(client).user { user }
|
19
|
+
stub(user).create!
|
20
|
+
subject
|
21
|
+
expect(user.guid).to eq "1234"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "#current_user" do
|
26
|
+
subject { client.current_user }
|
27
|
+
before { client.token = token }
|
28
|
+
|
29
|
+
context "when there is no token" do
|
30
|
+
let(:token) { nil }
|
31
|
+
it { should eq nil }
|
32
|
+
end
|
33
|
+
|
34
|
+
context "when there is no access_token_data" do
|
35
|
+
let(:token) { CFoundry::AuthToken.new("bearer some-access-token", "some-refresh-token") }
|
36
|
+
it { should eq nil }
|
37
|
+
end
|
38
|
+
|
39
|
+
context "when there is access_token_data" do
|
40
|
+
let(:token_data) { { :user_id => "123", :email => "guy@example.com" } }
|
41
|
+
let(:auth_header) { Base64.encode64("{}#{MultiJson.encode(token_data)}") }
|
42
|
+
let(:token) do
|
43
|
+
CFoundry::AuthToken.new("bearer #{auth_header}", "some-refresh-token")
|
44
|
+
end
|
45
|
+
|
46
|
+
it { should be_a CFoundry::V2::User }
|
47
|
+
its(:guid) { should eq "123" }
|
48
|
+
its(:emails) { should eq [{ :value => "guy@example.com"}] }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "#version" do
|
53
|
+
its(:version) { should eq 2 }
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "#login_prompts" do
|
57
|
+
include_examples "client login prompts"
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "#login" do
|
61
|
+
include_examples "client login" do
|
62
|
+
it 'sets the current organization to nil' do
|
63
|
+
client.current_organization = "org"
|
64
|
+
expect { subject }.to change { client.current_organization }.from("org").to(nil)
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'sets the current space to nil' do
|
68
|
+
client.current_space = "space"
|
69
|
+
expect { subject }.to change { client.current_space }.from("space").to(nil)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe CFoundry::V2::ModelMagic do
|
4
|
+
let(:client) { fake_client }
|
5
|
+
let(:mymodel) { fake_model }
|
6
|
+
let(:guid) { random_string("my-object-guid") }
|
7
|
+
let(:myobject) { mymodel.new(guid, client) }
|
8
|
+
|
9
|
+
describe 'attributes' do
|
10
|
+
describe 'reading' do
|
11
|
+
let(:mymodel) { fake_model { attribute :foo, :object } }
|
12
|
+
|
13
|
+
context 'when it exists in the manifest' do
|
14
|
+
subject { myobject.fake(:foo => "bar") }
|
15
|
+
|
16
|
+
it 'returns the value from the manifest' do
|
17
|
+
expect(subject.foo).to eq "bar"
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'and the default is nil but the value is false' do
|
21
|
+
let(:mymodel) {
|
22
|
+
fake_model { attribute :foo, :object, :default => nil }
|
23
|
+
}
|
24
|
+
|
25
|
+
subject { myobject.fake(:foo => false) }
|
26
|
+
|
27
|
+
it 'returns false' do
|
28
|
+
expect(subject.foo).to eq false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'and the default is false but the value is nil' do
|
33
|
+
let(:mymodel) {
|
34
|
+
fake_model { attribute :foo, :object, :default => false }
|
35
|
+
}
|
36
|
+
|
37
|
+
subject { myobject.fake(:foo => nil) }
|
38
|
+
|
39
|
+
it 'returns nil' do
|
40
|
+
expect(subject.foo).to eq nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'when the manifest has not been acquired' do
|
46
|
+
it 'retrieves the manifest the first time' do
|
47
|
+
mock(client.base).my_fake_model(guid) {
|
48
|
+
{ :entity => { :foo => "fizz" } }
|
49
|
+
}.ordered
|
50
|
+
|
51
|
+
expect(myobject.foo).to eq "fizz"
|
52
|
+
|
53
|
+
dont_allow(client.base).my_fake_model.ordered
|
54
|
+
|
55
|
+
expect(myobject.foo).to eq "fizz"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'when it does not exist in the manifest' do
|
60
|
+
let(:mymodel) {
|
61
|
+
fake_model { attribute :foo, :object, :default => "foo" }
|
62
|
+
}
|
63
|
+
|
64
|
+
subject { myobject.fake }
|
65
|
+
|
66
|
+
it 'returns the default value' do
|
67
|
+
expect(subject.foo).to eq "foo"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'when the attribute has a custom json key' do
|
72
|
+
let(:mymodel) {
|
73
|
+
fake_model { attribute :foo, :object, :at => :not_foo }
|
74
|
+
}
|
75
|
+
|
76
|
+
subject { myobject.fake }
|
77
|
+
|
78
|
+
it 'retrieves the attribute using the custom key' do
|
79
|
+
stub(client.base).my_fake_model(guid) {
|
80
|
+
{ :entity => { :not_foo => "fizz" } }
|
81
|
+
}
|
82
|
+
|
83
|
+
expect(myobject.foo).to eq "fizz"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe 'writing' do
|
89
|
+
context 'when the attribute has a custom json key' do
|
90
|
+
let(:mymodel) {
|
91
|
+
fake_model { attribute :foo, :object, :at => :not_foo }
|
92
|
+
}
|
93
|
+
|
94
|
+
subject { myobject }
|
95
|
+
|
96
|
+
it "stores it in the diff under the json key" do
|
97
|
+
mock(client.base).update_my_fake_model(subject.guid, :not_foo => 123)
|
98
|
+
subject.foo = 123
|
99
|
+
subject.update!
|
100
|
+
end
|
101
|
+
|
102
|
+
it "stores it in the manifest under the json key" do
|
103
|
+
subject.foo = 123
|
104
|
+
|
105
|
+
mock(client.base).create_my_fake_model(:not_foo => 123) do
|
106
|
+
{ :metadata => { :guid => guid },
|
107
|
+
:entity => { :not_foo => 123 }
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
subject.create!
|
112
|
+
end
|
113
|
+
|
114
|
+
it "is then readable via the attribute name" do
|
115
|
+
subject.foo = 123
|
116
|
+
expect(subject.foo).to eq 123
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe 'to_one relationships' do
|
123
|
+
describe 'writing' do
|
124
|
+
let!(:mymodel) { fake_model { to_one :foo } }
|
125
|
+
let!(:othermodel) { fake_model :foo }
|
126
|
+
|
127
|
+
let(:myobject) { mymodel.new(nil, client).fake }
|
128
|
+
let(:otherobject) { othermodel.new(nil, client).fake }
|
129
|
+
|
130
|
+
subject { myobject.foo = otherobject }
|
131
|
+
|
132
|
+
it "sets the GUID in the manifest to the object's GUID" do
|
133
|
+
expect { subject }.to change {
|
134
|
+
myobject.manifest[:entity][:foo_guid]
|
135
|
+
}.to(otherobject.guid)
|
136
|
+
end
|
137
|
+
|
138
|
+
it "tracks internal changes in the diff" do
|
139
|
+
expect { subject }.to change { myobject.diff }.to(
|
140
|
+
:foo_guid => otherobject.guid)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "tracks high-level changes in .changes" do
|
144
|
+
before = myobject.foo
|
145
|
+
expect { subject }.to change { myobject.changes }.to(
|
146
|
+
:foo => [before, otherobject])
|
147
|
+
end
|
148
|
+
|
149
|
+
context "when there is a default" do
|
150
|
+
let(:mymodel) { fake_model { to_one :foo, :default => nil } }
|
151
|
+
|
152
|
+
subject { myobject.foo = nil }
|
153
|
+
|
154
|
+
it "allows setting to the default" do
|
155
|
+
myobject.foo = otherobject
|
156
|
+
|
157
|
+
expect { subject }.to change {
|
158
|
+
myobject.manifest[:entity][:foo_guid]
|
159
|
+
}.from(otherobject.guid).to(nil)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
describe 'summarization for an arbitrary model' do
|
166
|
+
let(:mymodel) { fake_model { attribute :foo, :string } }
|
167
|
+
let(:summary_attributes) { { :foo => "abcd" } }
|
168
|
+
|
169
|
+
subject { myobject }
|
170
|
+
|
171
|
+
it_behaves_like 'a summarizeable model'
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe CFoundry::V2::Organization do
|
4
|
+
let(:client) { fake_client }
|
5
|
+
|
6
|
+
describe 'summarization' do
|
7
|
+
let(:mymodel) { CFoundry::V2::Organization }
|
8
|
+
let(:myobject) { fake(:organization) }
|
9
|
+
let(:summary_attributes) { { :name => "fizzbuzz" } }
|
10
|
+
|
11
|
+
subject { myobject }
|
12
|
+
|
13
|
+
it_behaves_like 'a summarizeable model'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe CFoundry::V2::Space do
|
4
|
+
let(:client) { fake_client }
|
5
|
+
|
6
|
+
describe 'summarization' do
|
7
|
+
let(:mymodel) { CFoundry::V2::Space }
|
8
|
+
let(:myobject) { fake(:space) }
|
9
|
+
let(:summary_attributes) { { :name => "fizzbuzz" } }
|
10
|
+
|
11
|
+
subject { myobject }
|
12
|
+
|
13
|
+
it_behaves_like 'a summarizeable model'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
bar
|
File without changes
|
File without changes
|
data/vendor/cfoundry-0.5.2/spec/fixtures/apps/with_vmcignore/ignored_dir/file_in_ignored_dir.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
file_in_ignored_dir
|
@@ -0,0 +1 @@
|
|
1
|
+
ignored_file
|
@@ -0,0 +1 @@
|
|
1
|
+
file_in_non_ignored_dir
|
@@ -0,0 +1 @@
|
|
1
|
+
ignored_file
|
@@ -0,0 +1 @@
|
|
1
|
+
non_ignored_file
|
File without changes
|