heroku-api 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/changelog.txt +4 -0
- data/lib/heroku/api.rb +3 -0
- data/lib/heroku/api/version.rb +1 -1
- data/test/test_api.rb +37 -0
- metadata +4 -2
data/changelog.txt
CHANGED
data/lib/heroku/api.rb
CHANGED
data/lib/heroku/api/version.rb
CHANGED
data/test/test_api.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApi < Minitest::Test
|
4
|
+
|
5
|
+
def test_json_parsing_failure_for_application_json
|
6
|
+
Excon.stub(:expects => 200, :method => :get, :path => "/foobar") do |params|
|
7
|
+
{
|
8
|
+
:body => "string",
|
9
|
+
:status => 200,
|
10
|
+
:headers => {'Content-Type' => 'application/json'}
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
begin
|
15
|
+
heroku.request(:expects => 200, :method => :get, :path => "/foobar")
|
16
|
+
fail("Expected MultiJson::ParseError")
|
17
|
+
rescue MultiJson::ParseError
|
18
|
+
# should raise parse error
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_json_parsing_failure_for_text_plain
|
23
|
+
Excon.stub(:expects => 200, :method => :get, :path => "/foobar") do |params|
|
24
|
+
{
|
25
|
+
:body => "string",
|
26
|
+
:status => 200,
|
27
|
+
:headers => {'Content-Type' => 'text/plain'}
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
response = heroku.request(:expects => 200, :method => :get, :path => "/foobar")
|
32
|
+
|
33
|
+
assert_equal(200, response.status)
|
34
|
+
assert_equal("string", response.body)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
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.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-02
|
13
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: excon
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- test/data/site.crt
|
134
134
|
- test/data/site.key
|
135
135
|
- test/test_addons.rb
|
136
|
+
- test/test_api.rb
|
136
137
|
- test/test_apps.rb
|
137
138
|
- test/test_attachments.rb
|
138
139
|
- test/test_buildpacks.rb
|
@@ -180,6 +181,7 @@ test_files:
|
|
180
181
|
- test/data/site.crt
|
181
182
|
- test/data/site.key
|
182
183
|
- test/test_addons.rb
|
184
|
+
- test/test_api.rb
|
183
185
|
- test/test_apps.rb
|
184
186
|
- test/test_attachments.rb
|
185
187
|
- test/test_buildpacks.rb
|