cfoundry 0.6.0 → 0.6.1.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cc_api_stub/domains.rb +6 -0
- data/lib/cc_api_stub/services.rb +1 -5
- data/lib/cfoundry/version.rb +1 -1
- data/spec/cc_api_stub/domains_spec.rb +8 -1
- data/spec/cc_api_stub/services_spec.rb +5 -6
- data/spec/fixtures/fake_cc_domain.json +20 -1
- data/spec/fixtures/fake_cc_domain_spaces.json +1 -1
- data/spec/fixtures/fake_cc_organization_domains.json +1 -1
- data/spec/fixtures/{fake_cc_service_types.json → fake_cc_services.json} +39 -11
- metadata +8 -11
data/lib/cc_api_stub/domains.rb
CHANGED
@@ -21,6 +21,12 @@ module CcApiStub
|
|
21
21
|
response_body = Helper.load_fixtures("fake_cc_created_domain")
|
22
22
|
stub_put(%r{/v2/domains/[^/]+/spaces/[^/]+$}, {}, response(201, response_body))
|
23
23
|
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def object_endpoint
|
28
|
+
%r{/v2/domains/[^/]+$}
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
26
32
|
end
|
data/lib/cc_api_stub/services.rb
CHANGED
@@ -3,10 +3,6 @@ module CcApiStub
|
|
3
3
|
extend Helper
|
4
4
|
|
5
5
|
class << self
|
6
|
-
def succeed_to_load
|
7
|
-
stub_get(collection_endpoint, {}, response(200, services_fixture))
|
8
|
-
end
|
9
|
-
|
10
6
|
def service_fixture_hash
|
11
7
|
MultiJson.load(services_fixture["resources"].first.to_json, :symbolize_keys => true)
|
12
8
|
end
|
@@ -18,7 +14,7 @@ module CcApiStub
|
|
18
14
|
end
|
19
15
|
|
20
16
|
def services_fixture
|
21
|
-
Helper.load_fixtures("
|
17
|
+
Helper.load_fixtures("fake_cc_services")
|
22
18
|
end
|
23
19
|
end
|
24
20
|
end
|
data/lib/cfoundry/version.rb
CHANGED
@@ -30,4 +30,11 @@ describe CcApiStub::Domains do
|
|
30
30
|
|
31
31
|
it_behaves_like "a stubbed put request", :code => 201
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
|
+
describe ".succeed_to_update" do
|
35
|
+
let(:url) { "http://example.com/v2/domains/domain-id-1" }
|
36
|
+
subject { CcApiStub::Domains.succeed_to_update }
|
37
|
+
|
38
|
+
it_behaves_like "a stubbed put request"
|
39
|
+
end
|
40
|
+
end
|
@@ -3,10 +3,9 @@ require 'net/http'
|
|
3
3
|
require 'uri'
|
4
4
|
|
5
5
|
describe CcApiStub::Services do
|
6
|
-
describe
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
it_behaves_like "a stubbed get request"
|
6
|
+
describe '.service_fixture_hash' do
|
7
|
+
it 'returns the fake services' do
|
8
|
+
CcApiStub::Services.service_fixture_hash.should be_a(Hash)
|
9
|
+
end
|
11
10
|
end
|
12
|
-
end
|
11
|
+
end
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"updated_at": null
|
20
20
|
},
|
21
21
|
"entity": {
|
22
|
-
"name": "
|
22
|
+
"name": "space-name-1",
|
23
23
|
"organization_guid": "organization-id-1",
|
24
24
|
"developers_url": "/v2/spaces/space-id-1/developers",
|
25
25
|
"managers_url": "/v2/spaces/space-id-1/managers",
|
@@ -29,6 +29,25 @@
|
|
29
29
|
"service_instances_url": "/v2/spaces/space-id-1/service_instances",
|
30
30
|
"organization_url": "/v2/organizations/organization-id-1"
|
31
31
|
}
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"metadata": {
|
35
|
+
"guid": "space-id-2",
|
36
|
+
"url": "/v2/spaces/space-id-2",
|
37
|
+
"created_at": "2013-03-11 15:17:38 -0700",
|
38
|
+
"updated_at": null
|
39
|
+
},
|
40
|
+
"entity": {
|
41
|
+
"name": "space-name-2",
|
42
|
+
"organization_guid": "organization-id-1",
|
43
|
+
"developers_url": "/v2/spaces/space-id-2/developers",
|
44
|
+
"managers_url": "/v2/spaces/space-id-2/managers",
|
45
|
+
"auditors_url": "/v2/spaces/space-id-2/auditors",
|
46
|
+
"apps_url": "/v2/spaces/space-id-2/apps",
|
47
|
+
"domains_url": "/v2/spaces/space-id-2/domains",
|
48
|
+
"service_instances_url": "/v2/spaces/space-id-2/service_instances",
|
49
|
+
"organization_url": "/v2/organizations/organization-id-2"
|
50
|
+
}
|
32
51
|
}
|
33
52
|
]
|
34
53
|
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"info_url": "service-info-url",
|
18
18
|
"description": "service1-description",
|
19
19
|
"service_plans_url": "/v2/services/service-id-1/service_plans",
|
20
|
-
"extra": "{}",
|
20
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"provider\": {\"name\": \"core\"},\"listing\": {\"imageUrl\": \"https://image-url.png\",\"blurb\": \"Manage and monitor your apps\"}}",
|
21
21
|
"service_plans": [
|
22
22
|
{
|
23
23
|
"metadata": {
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"entity": {
|
28
28
|
"name": "300",
|
29
29
|
"description": "2TB, 1.7GB Memory, 100 Connections, CPU? (Dedicated)",
|
30
|
-
"extra": "{}",
|
30
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 3.50, \"bullets\": [\"has memory and things\", \"customer data not included\"]}",
|
31
31
|
"service_guid": "service-id-1",
|
32
32
|
"service_url": "/v2/services/service-id-1",
|
33
33
|
"service_instances_url": "/v2/service_plans/paid-postgresql-id-1/service_instances"
|
@@ -40,8 +40,8 @@
|
|
40
40
|
},
|
41
41
|
"entity": {
|
42
42
|
"name": "100",
|
43
|
-
"description": "Free Postgres
|
44
|
-
"extra": "{}",
|
43
|
+
"description": "Free Postgres, one per customer",
|
44
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 23.50, \"bullets\": [\"costs nothing\", \"is a database\"]}",
|
45
45
|
"service_guid": "service-id-1",
|
46
46
|
"service_url": "/v2/services/service-id-1",
|
47
47
|
"service_instances_url": "/v2/service_plans/development-postgresql-id-1/service_instances"
|
@@ -63,7 +63,7 @@
|
|
63
63
|
"info_url": "service2-info-url",
|
64
64
|
"description": "service2-description",
|
65
65
|
"service_plans_url": "/v2/services/service-id-2/service_plans",
|
66
|
-
"extra": "{}",
|
66
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"provider\": {\"name\": \"core\"},\"listing\": {\"imageUrl\": \"https://image-url.png\",\"blurb\": \"Manage and monitor your apps\"}}",
|
67
67
|
"service_plans": [
|
68
68
|
{
|
69
69
|
"metadata": {
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"entity": {
|
74
74
|
"name": "100",
|
75
75
|
"description": "service-plan-description",
|
76
|
-
"extra": "{}",
|
76
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 43.50, \"bullets\": [\"it's web scale, like php\", \"this is a bullet\"]}",
|
77
77
|
"service_guid": "service-id-1",
|
78
78
|
"service_url": "/v2/services/service-id-1",
|
79
79
|
"service_instances_url": "/v2/service_plans/development-mongodb-id-1/service_instances"
|
@@ -87,7 +87,7 @@
|
|
87
87
|
"entity": {
|
88
88
|
"name": "200",
|
89
89
|
"description": "20GB, 1GB Memory, 10 Connections, CPU? (Shared)",
|
90
|
-
"extra": "{}",
|
90
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 103.50, \"bullets\": [\"is mongo, and a db\", \"24x7 shards\"]}",
|
91
91
|
"service_guid": "service-id-2",
|
92
92
|
"service_url": "/v2/services/service-id-2",
|
93
93
|
"service_instances_url": "/v2/service_plans/paid-mongodb-id-1/service_instances"
|
@@ -109,7 +109,7 @@
|
|
109
109
|
"info_url": "service3-info-url",
|
110
110
|
"description": "service3-description",
|
111
111
|
"service_plans_url": "/v2/services/service-id-3/service_plans",
|
112
|
-
"extra": "{}",
|
112
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"provider\": {\"name\": \"core\"},\"listing\": {\"imageUrl\": \"https://image-url.png\",\"blurb\": \"Manage and monitor your apps\"}}",
|
113
113
|
"service_plans": [
|
114
114
|
{
|
115
115
|
"metadata": {
|
@@ -117,13 +117,41 @@
|
|
117
117
|
"url": "/v2/service_plans/paid-mongolab-mongodb-id-1"
|
118
118
|
},
|
119
119
|
"entity": {
|
120
|
-
"name": "
|
121
|
-
"description": "
|
122
|
-
"extra": "{}",
|
120
|
+
"name": "100",
|
121
|
+
"description": "1GB, 0.25GB Memory, 5 Connections, a CPU",
|
122
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 0, \"bullets\": [\"it's free as in beer\", \"cheap beer\"]}",
|
123
123
|
"service_guid": "service-id-3",
|
124
124
|
"service_url": "/v2/services/service-id-3",
|
125
125
|
"service_instances_url": "/v2/service_plans/paid-mongolab-mongodb-id-1/service_instances"
|
126
126
|
}
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"metadata": {
|
130
|
+
"guid": "paid-mongolab-mongodb-id-2",
|
131
|
+
"url": "/v2/service_plans/paid-mongolab-mongodb-id-2"
|
132
|
+
},
|
133
|
+
"entity": {
|
134
|
+
"name": "200",
|
135
|
+
"description": "2GB, 2GB Memory, 10 Connections, CPU!",
|
136
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 83.50, \"bullets\": [\"cost is nil for this service\", \"we know nothing about this one\"]}",
|
137
|
+
"service_guid": "service-id-3",
|
138
|
+
"service_url": "/v2/services/service-id-3",
|
139
|
+
"service_instances_url": "/v2/service_plans/paid-mongolab-mongodb-id-2/service_instances"
|
140
|
+
}
|
141
|
+
},
|
142
|
+
{
|
143
|
+
"metadata": {
|
144
|
+
"guid": "paid-mongolab-mongodb-id-3",
|
145
|
+
"url": "/v2/service_plans/paid-mongolab-mongodb-id-3"
|
146
|
+
},
|
147
|
+
"entity": {
|
148
|
+
"name": "300",
|
149
|
+
"description": "2GB, 2GB Memory, 10 Connections, CPU!",
|
150
|
+
"extra": "{\"businessLogicSampleData\":\"goes here\",\"cost\": 102.50, \"bullets\": [\"was grown in a lab\", \"we know nothing about this one\"]}",
|
151
|
+
"service_guid": "service-id-3",
|
152
|
+
"service_url": "/v2/services/service-id-3",
|
153
|
+
"service_instances_url": "/v2/service_plans/paid-mongolab-mongodb-id-3/service_instances"
|
154
|
+
}
|
127
155
|
}
|
128
156
|
]
|
129
157
|
}
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.1.rc1
|
5
|
+
prerelease: 6
|
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-03-
|
13
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multipart-post
|
@@ -320,7 +320,7 @@ files:
|
|
320
320
|
- spec/fixtures/fake_cc_service_bindings.json
|
321
321
|
- spec/fixtures/fake_cc_service_instance.json
|
322
322
|
- spec/fixtures/fake_cc_service_instances.json
|
323
|
-
- spec/fixtures/
|
323
|
+
- spec/fixtures/fake_cc_services.json
|
324
324
|
- spec/fixtures/fake_cc_space.json
|
325
325
|
- spec/fixtures/fake_cc_space_summary.json
|
326
326
|
- spec/fixtures/fake_cc_spaces.json
|
@@ -347,18 +347,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
347
347
|
- - ! '>='
|
348
348
|
- !ruby/object:Gem::Version
|
349
349
|
version: '0'
|
350
|
-
segments:
|
351
|
-
- 0
|
352
|
-
hash: -3067980602958367259
|
353
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
354
351
|
none: false
|
355
352
|
requirements:
|
356
|
-
- - ! '
|
353
|
+
- - ! '>'
|
357
354
|
- !ruby/object:Gem::Version
|
358
|
-
version:
|
355
|
+
version: 1.3.1
|
359
356
|
requirements: []
|
360
357
|
rubyforge_project: cfoundry
|
361
|
-
rubygems_version: 1.8.
|
358
|
+
rubygems_version: 1.8.24
|
362
359
|
signing_key:
|
363
360
|
specification_version: 3
|
364
361
|
summary: High-level library for working with the Cloud Foundry API.
|
@@ -442,7 +439,7 @@ test_files:
|
|
442
439
|
- spec/fixtures/fake_cc_service_bindings.json
|
443
440
|
- spec/fixtures/fake_cc_service_instance.json
|
444
441
|
- spec/fixtures/fake_cc_service_instances.json
|
445
|
-
- spec/fixtures/
|
442
|
+
- spec/fixtures/fake_cc_services.json
|
446
443
|
- spec/fixtures/fake_cc_space.json
|
447
444
|
- spec/fixtures/fake_cc_space_summary.json
|
448
445
|
- spec/fixtures/fake_cc_spaces.json
|