xsr 1.4.0 → 1.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9e3370abd455ea33763b68734c67f393baabda3
4
- data.tar.gz: 9c67710ee1481d692ace115a269483b7f66c141c
3
+ metadata.gz: 6b5d94f2963cc6560f79386df7b9f303c3aae956
4
+ data.tar.gz: e65e22fbfa8c55e57408fba05148c73c44f57603
5
5
  SHA512:
6
- metadata.gz: c4caf181848332499d1ccbc4284171fb8de9393c5fb4ba5f48b45d9e683cad1944a34aa514ffa2b1ff46a72837a786e5ebe4547e5232b5a326cee4ce0d5d8627
7
- data.tar.gz: a5cb61cad99572cdf0cfffdb65a299d3cf37365ace9e93f4be880971193d4acffcacbb7179a4919d67ee5f9f5639fbfc2fdb2b3ec854b9e9c773bffd6ec236b6
6
+ metadata.gz: c34a85feb7f1c25c0085d6df6a148fbda45213a2bd66a74f68d596bac3e0b54f8c576de2a84ea386da350627a4b5050fa634b3eb2318d210342eddb38c0cf1f9
7
+ data.tar.gz: e2427635b29c320cf6fbc108e0d610313d7768702bf9440a9815939cd5d17a2fe9c945152f95542cb47701d6fcbf0af74dcedf001541a28ef01137cf73271fe8
@@ -31,6 +31,10 @@ module XSR
31
31
  @http_response.is_a? Net::HTTPServerError
32
32
  end
33
33
 
34
+ def status
35
+ @http_response.code
36
+ end
37
+
34
38
  def body
35
39
  MultiJson.load @http_response.body, symbolize_keys: true
36
40
  end
data/makefile CHANGED
@@ -7,3 +7,6 @@ test:
7
7
  console:
8
8
  @echo Running console... && \
9
9
  RUBYLIB=./lib irb -r xsr
10
+
11
+ build:
12
+ gem build xsr.gemspec
@@ -28,7 +28,7 @@ module ClientSSLTest
28
28
 
29
29
  test 'set custom invalid ca pem' do
30
30
  @client.ca_file = 'does_not_exist.pem'
31
-
31
+
32
32
  assert_raise(OpenSSL::SSL::SSLError) do
33
33
  @client.get('/get')
34
34
  end
@@ -10,6 +10,7 @@ module ResponseTest
10
10
  test 'status 200 gets a successful response' do
11
11
  res = @client.get('/status/200')
12
12
  assert res.success?
13
+ assert_equal res.status, '200'
13
14
  end
14
15
 
15
16
  test 'status 201 gets a successful response' do
@@ -44,12 +45,14 @@ module ResponseTest
44
45
  res = @client.get('/status/404')
45
46
  assert !res.success?
46
47
  assert res.not_found?
48
+ assert_equal res.status, '404'
47
49
  end
48
50
 
49
51
  test 'status 500 gets a Server Error response' do
50
52
  res = @client.get('/status/500')
51
53
  assert !res.success?
52
54
  assert res.server_error?
55
+ assert_equal res.status, '500'
53
56
  end
54
57
 
55
58
  test 'simple json response' do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xsr'
3
- s.version = '1.4.0'
3
+ s.version = '1.5.0'
4
4
  s.summary = 'XSR: eXtremely Simple REST Client'
5
5
  s.description = 'A very simple library to talk to a REST/JSON API'
6
6
  s.authors = ['matiasow']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - matiasow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-22 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.4.4
93
+ rubygems_version: 2.4.5.1
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: 'XSR: eXtremely Simple REST Client'