heroku-api 0.3.20 → 0.3.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bec35b30117d8090e323c4b72da5b0011f82e8f7
4
- data.tar.gz: f92492ed12af70ffa039f30fa6a50eb1277aa8cf
3
+ metadata.gz: 04b8ff21deb9427d5860d5f8dd1bd4e05609eb41
4
+ data.tar.gz: d5e1e0bf21c9b40ac7ea13c3f82c6b65108a3b76
5
5
  SHA512:
6
- metadata.gz: 5c15e25135bfbd323440401a66a1de16ae1e00cc8582d4b2e0b8079f1f6a7bbea98af1711f8fe2b616f76c65501bf7a22bf3c6eb8515e1ff6bb2cbce4acf7e4b
7
- data.tar.gz: 6e73624e20c5c8df0918a0d53c6aa266286442b181d70de208c65ff5dc0b724e2f4a39fe0b90cd513a23ce6236cab93b83166ce91ca1fb7a5b67489499a3c93b
6
+ metadata.gz: 3fde62225cd96770d0bb98728b0ca0a4b530446e7c7f009534e6e86361594f9615fad9f46b81443ce01d278b9857e46284b8facd542c31df948233f6a31ebea5
7
+ data.tar.gz: d3c0f1e7ebfbbf02671865a2b4cf268c641833bda813bfcb0a92b473cbe9e1997b93cfd2c6e01f68805de7e9d9387b0c632337e8a38653dd8b3f108a7625a764
data/changelog.txt CHANGED
@@ -1,3 +1,7 @@
1
+ 0.3.21 12/03/2014
2
+ =================
3
+ fix tests/mocks to match new cached data
4
+
1
5
  0.3.20 11/18/2014
2
6
  =================
3
7
  update mock data cache
@@ -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, 'shared-database:5mb')
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.merge('enabled' => false))
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
@@ -1,5 +1,5 @@
1
1
  module Heroku
2
2
  class API
3
- VERSION = "0.3.20"
3
+ VERSION = "0.3.21"
4
4
  end
5
5
  end
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
- 'attachable' => false,
56
- 'beta' => false,
57
- 'configured' => true,
58
- 'consumes_dyno_hours' => false,
59
- 'description' => 'Shared Database 5MB',
60
- 'group_description' => 'Shared Database',
61
- 'name' => 'shared-database:5mb',
62
- 'plan_description' => '5mb',
63
- 'price' => { 'cents' => 0, 'unit' => 'month' },
64
- 'slug' => '5mb',
65
- 'state' => 'public',
66
- 'terms_of_service' => false,
67
- 'url' => nil
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'], 'logging:basic')
120
- heroku.post_addon(app_data['name'], 'logging:basic')
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'], 'logging:basic')
129
- heroku.post_addon(app_data['name'], 'logging:expanded')
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, 'shared-database:5mb')
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:basic')
151
- response = heroku.put_addon(app_data['name'], 'pgbackups:plus')
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'], 'logging:basic')
166
- heroku.put_addon(app_data['name'], 'logging:basic')
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'], 'releases:basic')
182
+ heroku.put_addon(app_data['name'], 'pgbackups:auto-month')
183
183
  end
184
184
  end
185
185
  end
@@ -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
- features_data = MultiJson.load(data)
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('user_env_compile', app_data['name'])
16
- response = heroku.delete_feature('user_env_compile', app_data['name'])
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('user_env_compile', random_name)
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('user_env_compile', app_data['name'])
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('user_env_compile', app_data['name'])
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('user_env_compile', random_name)
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.20
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-11-18 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon