unirest 1.1.1 → 1.1.2

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: a70b4b60495cfce6b76976db30267f96cb0a3d1c
4
- data.tar.gz: cee47e365d0051e7eb4dbe3855c24f2f85407cb0
3
+ metadata.gz: 8c7398c8547c1de0e187d7ef403b1748b14804d9
4
+ data.tar.gz: b1457e77f3e27a172dbdf0b9a04f7df4f93bcf1b
5
5
  SHA512:
6
- metadata.gz: 7ab63e4a645092001bbbf31735a1604192bd616235a7da27f090a0c0e5599efd5416f51aff7863a550d3e16fc779f513248012cb4aeae6b20e9bd41fca620b99
7
- data.tar.gz: ddff0fcb181e953a92e73fc6cff2abae915d01db67f859f5f18b0d794621b6bbc04cd434cf2fcdfbcb3616bbc2eb3fc12b83529479d076558f2270668ed8aafa
6
+ metadata.gz: 3d17f90512663ccc97ba4815e7723d8ec7f80fd8ee3cd3e5c38291aa0da969bbd9cddca575a25fee8900ce4cb9054034d510d84fc887db8e7096b0c13e0514e8
7
+ data.tar.gz: d39961957094f4a9cef830a4d01a208d486343f08ec9ae6dd6e1776c787af13c3c6382911f357da98219b7be578ef54596f81688d64f761576b29932c49f8745
@@ -71,7 +71,7 @@ module Unirest
71
71
  end
72
72
  rescue RestClient::RequestTimeout
73
73
  raise 'Request Timeout'
74
- rescue => e
74
+ rescue RestClient::Exception => e
75
75
  http_response = e.response
76
76
  end
77
77
 
@@ -75,7 +75,7 @@ module Unirest
75
75
  password = auth[:password]
76
76
  end
77
77
 
78
- headers['Authorization'] = "Basic " + Base64.encode64(user + ":" + password)
78
+ headers['Authorization'] = 'Basic ' + ["#{user}:#{password}"].pack('m').delete("\r\n")
79
79
 
80
80
  end
81
81
 
@@ -146,6 +146,15 @@ module Unirest
146
146
  assert response.code == 200
147
147
  end
148
148
 
149
+ should "Throw underlying error" do
150
+
151
+ begin
152
+ Unirest.get("http://bad.domain.test")
153
+ rescue => e
154
+ assert ! e.is_a?(NoMethodError)
155
+ end
156
+ end
157
+
149
158
  should "Default Headers" do
150
159
 
151
160
  Unirest.default_header('Hello','test')
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'unirest'
3
- s.version = '1.1.1'
3
+ s.version = '1.1.2'
4
4
  s.summary = "Unirest-Ruby"
5
5
  s.description = "Unirest is a set of lightweight HTTP libraries available in multiple languages."
6
6
  s.authors = ["Mashape", "Marco Palladino"]
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.add_dependency('json', '~> 1.8.1')
13
13
  s.add_dependency('addressable', '~> 2.3.5')
14
14
 
15
- s.add_development_dependency('shoulda', '~> 3.4.0')
15
+ s.add_development_dependency('shoulda', '~> 3.5.0')
16
16
  s.add_development_dependency('test-unit')
17
17
  s.add_development_dependency('rake')
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unirest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mashape
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-01 00:00:00.000000000 Z
12
+ date: 2014-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 3.4.0
62
+ version: 3.5.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 3.4.0
69
+ version: 3.5.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: test-unit
72
72
  requirement: !ruby/object:Gem::Requirement