esa 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/esa/response.rb +1 -1
- data/lib/esa/version.rb +1 -1
- data/spec/esa/response_spec.rb +42 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b50bf1ea2984c2e282f9b7afc4f0f1927f91f3e
|
4
|
+
data.tar.gz: 219f7cd0de527986a35c0e5374f5d962a0a80e56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f588ce3f76712777c9d44e0463a1578dd782c441e32a59fe139d88618153a1497b8e5bc08a0088350097d45abaa8bcae5e3a6506e062d9a3d52c2771ef5a4a3
|
7
|
+
data.tar.gz: 2231108c9643d5043fe135e53e9c939e7fec636bfcc934c4422f4dc6cfa85212165b492c19afe2bc337a0a00608c57fab78dd0dab21f9734c0a1316a15d4ff2a
|
data/CHANGELOG.md
ADDED
data/lib/esa/response.rb
CHANGED
data/lib/esa/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Esa::Response do
|
4
|
+
let(:response_status) { 401 }
|
5
|
+
let(:response_body) { '{"error":"unauthorized", "message":"Unauthorized"}' }
|
6
|
+
let(:response_headers) do
|
7
|
+
{
|
8
|
+
'server' => 'Cowboy',
|
9
|
+
'content-type' => 'application/json; charset=utf-8',
|
10
|
+
}
|
11
|
+
end
|
12
|
+
let(:connection) do
|
13
|
+
Faraday.new do |c|
|
14
|
+
c.adapter :test, Faraday::Adapter::Test::Stubs.new do |stub|
|
15
|
+
stub.get('/test') { [response_status, response_headers, response_body] }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
let(:response) { described_class.new(connection.get('/test')) }
|
20
|
+
|
21
|
+
describe '#body' do
|
22
|
+
subject { response.body }
|
23
|
+
it { is_expected.to eq response_body }
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#headers' do
|
27
|
+
subject { response.headers }
|
28
|
+
let(:expectation) do
|
29
|
+
{
|
30
|
+
'Server' => 'Cowboy',
|
31
|
+
'Content-Type' => 'application/json; charset=utf-8',
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
it { is_expected.to eq expectation }
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#status' do
|
39
|
+
subject { response.status }
|
40
|
+
it { is_expected.to eq response_status }
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,6 +173,7 @@ extra_rdoc_files: []
|
|
173
173
|
files:
|
174
174
|
- ".gitignore"
|
175
175
|
- ".rspec"
|
176
|
+
- CHANGELOG.md
|
176
177
|
- Gemfile
|
177
178
|
- Guardfile
|
178
179
|
- LICENSE.txt
|
@@ -186,6 +187,7 @@ files:
|
|
186
187
|
- lib/esa/response.rb
|
187
188
|
- lib/esa/version.rb
|
188
189
|
- spec/esa/client_spec.rb
|
190
|
+
- spec/esa/response_spec.rb
|
189
191
|
- spec/spec_helper.rb
|
190
192
|
homepage: https://github.com/esaio/esa-ruby/
|
191
193
|
licenses:
|
@@ -213,5 +215,6 @@ specification_version: 4
|
|
213
215
|
summary: "[WIP] esa API v1 client library, written in Ruby"
|
214
216
|
test_files:
|
215
217
|
- spec/esa/client_spec.rb
|
218
|
+
- spec/esa/response_spec.rb
|
216
219
|
- spec/spec_helper.rb
|
217
220
|
has_rdoc:
|