gds-api-adapters 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,9 @@ module GdsApi
32
32
  def respond_to_missing?(method, include_private)
33
33
  to_hash.has_key?(method.to_s)
34
34
  end
35
+
36
+ def present?; ! blank?; end
37
+ def blank?; false; end
35
38
 
36
39
  private
37
40
 
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  module GdsApi
2
4
  module TestHelpers
3
5
  module Panopticon
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '0.0.32'
2
+ VERSION = '0.0.33'
3
3
  end
@@ -99,6 +99,14 @@ class JsonClientTest < MiniTest::Spec
99
99
  assert ! response.respond_to?(:does_not_exist)
100
100
  end
101
101
 
102
+ def test_a_response_is_always_considered_present_and_not_blank
103
+ url = "http://some.endpoint/some.json"
104
+ stub_request(:put, url).to_return(:body => '{"a":1}', :status => 200)
105
+ response = @client.put_json(url, {})
106
+ assert ! response.blank?
107
+ assert response.present?
108
+ end
109
+
102
110
  def test_client_can_use_basic_auth
103
111
  client = GdsApi::JsonClient.new(basic_auth: {user: 'user', password: 'password'})
104
112
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.32
5
+ version: 0.0.33
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Stewart
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-11 00:00:00 Z
13
+ date: 2012-01-12 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: plek
@@ -161,7 +161,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- hash: 4128390024308242266
164
+ hash: 2521228861920169578
165
165
  segments:
166
166
  - 0
167
167
  version: "0"
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- hash: 4128390024308242266
173
+ hash: 2521228861920169578
174
174
  segments:
175
175
  - 0
176
176
  version: "0"