heroku-api 0.3.20 → 0.3.21
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 +4 -4
- data/changelog.txt +4 -0
- data/lib/heroku/api/mock/apps.rb +1 -1
- data/lib/heroku/api/mock/features.rb +4 -4
- data/lib/heroku/api/version.rb +1 -1
- data/test/test_addons.rb +23 -23
- data/test/test_features.rb +7 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04b8ff21deb9427d5860d5f8dd1bd4e05609eb41
|
4
|
+
data.tar.gz: d5e1e0bf21c9b40ac7ea13c3f82c6b65108a3b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fde62225cd96770d0bb98728b0ca0a4b530446e7c7f009534e6e86361594f9615fad9f46b81443ce01d278b9857e46284b8facd542c31df948233f6a31ebea5
|
7
|
+
data.tar.gz: d3c0f1e7ebfbbf02671865a2b4cf268c641833bda813bfcb0a92b473cbe9e1997b93cfd2c6e01f68805de7e9d9387b0c632337e8a38653dd8b3f108a7625a764
|
data/changelog.txt
CHANGED
data/lib/heroku/api/mock/apps.rb
CHANGED
@@ -118,7 +118,7 @@ module Heroku
|
|
118
118
|
mock_data[:ps][app].first['command'] = 'bundle exec thin start -p $PORT'
|
119
119
|
mock_data[:ps][app].first['type'] = 'Ps'
|
120
120
|
else
|
121
|
-
add_mock_app_addon(mock_data, app, '
|
121
|
+
add_mock_app_addon(mock_data, app, 'heroku-postgresql:hobby-dev')
|
122
122
|
mock_data[:config_vars][app] = {
|
123
123
|
'BUNDLE_WITHOUT' => 'development:test',
|
124
124
|
'LANG' => 'en_US.UTF-8',
|
@@ -20,9 +20,9 @@ module Heroku
|
|
20
20
|
:status => 200
|
21
21
|
}
|
22
22
|
when 'user'
|
23
|
-
mock_data[:features][:user].delete(feature_data
|
23
|
+
mock_data[:features][:user].delete(feature_data)
|
24
24
|
{
|
25
|
-
:body => MultiJson.dump(feature_data),
|
25
|
+
:body => MultiJson.dump(feature_data.merge('enabled' => false)),
|
26
26
|
:status => 200
|
27
27
|
}
|
28
28
|
end
|
@@ -91,14 +91,14 @@ module Heroku
|
|
91
91
|
:status => status
|
92
92
|
}
|
93
93
|
when 'user'
|
94
|
-
status = if mock_data[:features][:user].include(feature_data)
|
94
|
+
status = if mock_data[:features][:user].include?(feature_data)
|
95
95
|
200
|
96
96
|
else
|
97
97
|
mock_data[:features][:user] << feature_data
|
98
98
|
201
|
99
99
|
end
|
100
100
|
{
|
101
|
-
:body =>
|
101
|
+
:body => MultiJson.dump(feature_data),
|
102
102
|
:status => status
|
103
103
|
}
|
104
104
|
end
|
data/lib/heroku/api/version.rb
CHANGED
data/test/test_addons.rb
CHANGED
@@ -52,19 +52,19 @@ class TestAddons < Minitest::Test
|
|
52
52
|
|
53
53
|
assert_equal(200, response.status)
|
54
54
|
assert_equal([{
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
55
|
+
"attachable" => true,
|
56
|
+
"beta" => false,
|
57
|
+
"configured" => true,
|
58
|
+
"consumes_dyno_hours" => false,
|
59
|
+
"description" => "Heroku Postgres Hobby Dev",
|
60
|
+
"group_description" => "Heroku Postgresql",
|
61
|
+
"name" => "heroku-postgresql:hobby-dev",
|
62
|
+
"plan_description" => "Hobby Dev",
|
63
|
+
"price" => {"cents"=>0, "unit"=>"month"},
|
64
|
+
"slug" => "hobby-dev",
|
65
|
+
"state" => "public",
|
66
|
+
"terms_of_service" => false,
|
67
|
+
"url" => nil
|
68
68
|
}], response.body)
|
69
69
|
end
|
70
70
|
end
|
@@ -116,8 +116,8 @@ class TestAddons < Minitest::Test
|
|
116
116
|
def test_post_addon_addon_already_installed
|
117
117
|
with_app do |app_data|
|
118
118
|
assert_raises(Heroku::API::Errors::RequestFailed) do
|
119
|
-
heroku.post_addon(app_data['name'], '
|
120
|
-
heroku.post_addon(app_data['name'], '
|
119
|
+
heroku.post_addon(app_data['name'], 'pgbackups:auto-month')
|
120
|
+
heroku.post_addon(app_data['name'], 'pgbackups:auto-month')
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
@@ -125,8 +125,8 @@ class TestAddons < Minitest::Test
|
|
125
125
|
def test_post_addon_addon_type_already_installed
|
126
126
|
with_app do |app_data|
|
127
127
|
assert_raises(Heroku::API::Errors::RequestFailed) do
|
128
|
-
heroku.post_addon(app_data['name'], '
|
129
|
-
heroku.post_addon(app_data['name'], '
|
128
|
+
heroku.post_addon(app_data['name'], 'pgbackups:auto-month')
|
129
|
+
heroku.post_addon(app_data['name'], 'pgbackups:auto-week')
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
@@ -141,14 +141,14 @@ class TestAddons < Minitest::Test
|
|
141
141
|
|
142
142
|
def test_post_addon_app_not_found
|
143
143
|
assert_raises(Heroku::API::Errors::NotFound) do
|
144
|
-
heroku.post_addon(random_name, '
|
144
|
+
heroku.post_addon(random_name, 'heroku-postgresql:hobby-dev')
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
148
|
def test_put_addon
|
149
149
|
with_app do |app_data|
|
150
|
-
response = heroku.post_addon(app_data['name'], 'pgbackups:
|
151
|
-
response = heroku.put_addon(app_data['name'], 'pgbackups:
|
150
|
+
response = heroku.post_addon(app_data['name'], 'pgbackups:auto-month')
|
151
|
+
response = heroku.put_addon(app_data['name'], 'pgbackups:auto-week')
|
152
152
|
|
153
153
|
assert_equal(200, response.status)
|
154
154
|
assert_equal({
|
@@ -162,8 +162,8 @@ class TestAddons < Minitest::Test
|
|
162
162
|
def test_put_addon_addon_already_installed
|
163
163
|
with_app do |app_data|
|
164
164
|
assert_raises(Heroku::API::Errors::RequestFailed) do
|
165
|
-
heroku.post_addon(app_data['name'], '
|
166
|
-
heroku.put_addon(app_data['name'], '
|
165
|
+
heroku.post_addon(app_data['name'], 'pgbackups:auto-month')
|
166
|
+
heroku.put_addon(app_data['name'], 'pgbackups:auto-month')
|
167
167
|
end
|
168
168
|
end
|
169
169
|
end
|
@@ -179,7 +179,7 @@ class TestAddons < Minitest::Test
|
|
179
179
|
def test_put_addon_addon_type_not_installed
|
180
180
|
with_app do |app_data|
|
181
181
|
assert_raises(Heroku::API::Errors::RequestFailed) do
|
182
|
-
heroku.put_addon(app_data['name'], '
|
182
|
+
heroku.put_addon(app_data['name'], 'pgbackups:auto-month')
|
183
183
|
end
|
184
184
|
end
|
185
185
|
end
|
data/test/test_features.rb
CHANGED
@@ -5,15 +5,14 @@ class TestFeatures < Minitest::Test
|
|
5
5
|
def setup
|
6
6
|
@feature_data ||= begin
|
7
7
|
data = File.read("#{File.dirname(__FILE__)}/../lib/heroku/api/mock/cache/get_features.json")
|
8
|
-
|
9
|
-
features_data.detect {|feature| feature['name'] == 'user_env_compile'}
|
8
|
+
MultiJson.load(data).first
|
10
9
|
end
|
11
10
|
end
|
12
11
|
|
13
12
|
def test_delete_feature
|
14
13
|
with_app do |app_data|
|
15
|
-
heroku.post_feature('
|
16
|
-
response = heroku.delete_feature('
|
14
|
+
heroku.post_feature(@feature_data['name'], app_data['name'])
|
15
|
+
response = heroku.delete_feature(@feature_data['name'], app_data['name'])
|
17
16
|
|
18
17
|
assert_equal(200, response.status)
|
19
18
|
assert_equal(@feature_data, response.body)
|
@@ -22,7 +21,7 @@ class TestFeatures < Minitest::Test
|
|
22
21
|
|
23
22
|
def test_delete_feature_app_not_found
|
24
23
|
assert_raises(Heroku::API::Errors::RequestFailed) do
|
25
|
-
heroku.delete_feature('
|
24
|
+
heroku.delete_feature(@feature_data['name'], random_name)
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
@@ -46,7 +45,7 @@ class TestFeatures < Minitest::Test
|
|
46
45
|
|
47
46
|
def test_get_feature
|
48
47
|
with_app do |app_data|
|
49
|
-
response = heroku.get_feature('
|
48
|
+
response = heroku.get_feature(@feature_data['name'], app_data['name'])
|
50
49
|
|
51
50
|
assert_equal(200, response.status)
|
52
51
|
assert_equal(@feature_data, response.body)
|
@@ -63,7 +62,7 @@ class TestFeatures < Minitest::Test
|
|
63
62
|
|
64
63
|
def test_post_feature
|
65
64
|
with_app do |app_data|
|
66
|
-
response = heroku.post_feature('
|
65
|
+
response = heroku.post_feature(@feature_data['name'], app_data['name'])
|
67
66
|
|
68
67
|
assert_equal(201, response.status)
|
69
68
|
assert_equal(@feature_data.merge('enabled' => true), response.body)
|
@@ -72,7 +71,7 @@ class TestFeatures < Minitest::Test
|
|
72
71
|
|
73
72
|
def test_post_feature_app_not_found
|
74
73
|
assert_raises(Heroku::API::Errors::NotFound) do
|
75
|
-
heroku.post_feature('
|
74
|
+
heroku.post_feature(@feature_data['name'], random_name)
|
76
75
|
end
|
77
76
|
end
|
78
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|