api_struct 1.0.0 → 1.0.1
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.md +15 -0
- data/lib/api_struct/errors/client.rb +2 -0
- data/lib/api_struct/version.rb +1 -1
- data/spec/api_struct/client_spec.rb +11 -0
- data/spec/fixtures/cassettes/posts/show_failure_html.yml +67 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b4ddea2489ecf3ef083cd6b4ba06a1e5b1d2fdf
|
4
|
+
data.tar.gz: 5d55b25bec067bccf2fe8785badf9770937fc077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e596aef0eb1223dc8477f18822153b92505599d4cd8cc5657d32cdade2a80c0a10febfb1b73e0a33d37b103b653084723c0f633356d032b8a361bb613ee1fe58
|
7
|
+
data.tar.gz: 1ac9539e5216151b7cffae6b6973a369a0f095adea730613e9284059c91a2b129f55a42ff4cbad416d43927b51aebb2e9da890ead281be1893f51bd993787fc2
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# v1.0.1 2018-11-27
|
2
|
+
|
3
|
+
## Fixed
|
4
|
+
|
5
|
+
* Parse error for HTML response ([sigra](https://github.com/rubygarage/api_struct/pull/6))
|
6
|
+
|
7
|
+
# v1.0.0 2018-11-24
|
8
|
+
|
9
|
+
## Changed
|
10
|
+
|
11
|
+
* Updated `dry-monads` dependencies from `0.3.x` to `1.0.x` ([FunkyloverOne](https://github.com/rubygarage/api_struct/pull/5))
|
12
|
+
|
13
|
+
# v0.0.1 2018-04-06
|
14
|
+
|
15
|
+
Initial release with core features.
|
data/lib/api_struct/version.rb
CHANGED
@@ -104,6 +104,17 @@ describe ApiStruct::Client do
|
|
104
104
|
expect(response.failure.status).to eq(404)
|
105
105
|
end
|
106
106
|
end
|
107
|
+
|
108
|
+
it 'when failed response with html response' do
|
109
|
+
VCR.use_cassette('posts/show_failure_html') do
|
110
|
+
response = StubClient.new.show(101)
|
111
|
+
body = response.failure.body
|
112
|
+
expect(response).to be_failure
|
113
|
+
expect(response.failure.status).to eq(404)
|
114
|
+
expect(body).to be_kind_of(String)
|
115
|
+
expect(body).to match(/<body>.+<\/body>/)
|
116
|
+
end
|
117
|
+
end
|
107
118
|
end
|
108
119
|
|
109
120
|
context 'PATCH' do
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://jsonplaceholder.typicode.com/posts/101
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Connection:
|
15
|
+
- close
|
16
|
+
Host:
|
17
|
+
- jsonplaceholder.typicode.com
|
18
|
+
User-Agent:
|
19
|
+
- http.rb/3.0.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 18 Jan 2018 19:23:37 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '27'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Set-Cookie:
|
34
|
+
- __cfduid=dea576b2c58beb4acebfa8cc1b8f3cd731516303417; expires=Fri, 18-Jan-19
|
35
|
+
19:23:37 GMT; path=/; domain=.typicode.com; HttpOnly
|
36
|
+
X-Powered-By:
|
37
|
+
- Express
|
38
|
+
Vary:
|
39
|
+
- Origin, Accept-Encoding
|
40
|
+
Access-Control-Allow-Credentials:
|
41
|
+
- 'true'
|
42
|
+
Cache-Control:
|
43
|
+
- public, max-age=14400
|
44
|
+
Pragma:
|
45
|
+
- no-cache
|
46
|
+
Expires:
|
47
|
+
- Thu, 18 Jan 2018 23:23:37 GMT
|
48
|
+
X-Content-Type-Options:
|
49
|
+
- nosniff
|
50
|
+
Etag:
|
51
|
+
- W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"
|
52
|
+
Via:
|
53
|
+
- 1.1 vegur
|
54
|
+
Cf-Cache-Status:
|
55
|
+
- EXPIRED
|
56
|
+
Expect-Ct:
|
57
|
+
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
58
|
+
Server:
|
59
|
+
- cloudflare
|
60
|
+
Cf-Ray:
|
61
|
+
- 3df3ee046ef84f20-DME
|
62
|
+
body:
|
63
|
+
encoding: UTF-8
|
64
|
+
string: "<body>404. Not Found</body>"
|
65
|
+
http_version:
|
66
|
+
recorded_at: Thu, 18 Jan 2018 19:23:37 GMT
|
67
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bezrukavyi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-11-
|
13
|
+
date: 2018-11-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dry-monads
|
@@ -212,6 +212,7 @@ files:
|
|
212
212
|
- ".rspec"
|
213
213
|
- ".rubocop.yml"
|
214
214
|
- ".ruby-version"
|
215
|
+
- CHANGELOG.md
|
215
216
|
- Gemfile
|
216
217
|
- Gemfile.lock
|
217
218
|
- LICENSE.txt
|
@@ -237,6 +238,7 @@ files:
|
|
237
238
|
- spec/fixtures/cassettes/posts/1.yml
|
238
239
|
- spec/fixtures/cassettes/posts/index_success.yml
|
239
240
|
- spec/fixtures/cassettes/posts/show_failure.yml
|
241
|
+
- spec/fixtures/cassettes/posts/show_failure_html.yml
|
240
242
|
- spec/fixtures/cassettes/posts/show_success.yml
|
241
243
|
- spec/fixtures/cassettes/posts/suffix.yml
|
242
244
|
- spec/fixtures/cassettes/posts/update_success.yml
|