load_balance_client 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -7,7 +7,7 @@ class LoadBalanceClient
7
7
  when 200
8
8
  JSON.parse(response.body)
9
9
  else
10
- {}
10
+ response
11
11
  end
12
12
  end
13
13
  rescue Errno::ECONNREFUSED => e
@@ -24,7 +24,7 @@ class LoadBalanceClient
24
24
  when 200
25
25
  JSON.parse(response.body)
26
26
  else
27
- {}
27
+ response
28
28
  end
29
29
  end
30
30
  rescue Errno::ECONNREFUSED => e
@@ -41,7 +41,7 @@ class LoadBalanceClient
41
41
  when 200
42
42
  JSON.parse(response.body)
43
43
  else
44
- {}
44
+ response
45
45
  end
46
46
  end
47
47
  rescue Errno::ECONNREFUSED => e
@@ -58,7 +58,7 @@ class LoadBalanceClient
58
58
  when 200
59
59
  JSON.parse(response.body)
60
60
  else
61
- {}
61
+ response
62
62
  end
63
63
  end
64
64
  rescue Errno::ECONNREFUSED => e
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "load_balance_client"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Acuff", "Justin Hill", "Matt Brown"]
12
- s.date = "2012-03-09"
12
+ s.date = "2012-03-11"
13
13
  s.description = "Simple wrapper around RestClient to make load balanced http requests"
14
14
  s.email = "support@igodigital.com"
15
15
  s.extra_rdoc_files = [
@@ -11,7 +11,7 @@ class ClientTest < MiniTest::Unit::TestCase
11
11
  assert_equal ['http://localhost:9200'], LoadBalanceClient.server_list
12
12
  end
13
13
 
14
- def test_bad_node_for_post
14
+ def test_bad_node_for_post
15
15
  LoadBalanceClient.server_list=['http://localhost:9200', 'http://localhost:46250']
16
16
  10.times do
17
17
  LoadBalanceClient.post '/igodigital/users/abc123', {'foo'=>'bar'}.to_json
@@ -37,4 +37,14 @@ def test_bad_node_for_post
37
37
  assert_equal 1, LoadBalanceClient.server_list.length
38
38
  assert_equal ['http://localhost:9200'], LoadBalanceClient.server_list
39
39
  end
40
+
41
+ def test_responses
42
+ LoadBalanceClient.server_list=['http://localhost:9200']
43
+ response = LoadBalanceClient.get '/'
44
+
45
+ assert_equal 200, response['status']
46
+
47
+ response = LoadBalanceClient.get '/thisshouldneverwork'
48
+ assert_equal 'No handler found for uri [/thisshouldneverwork] and method [GET]', response
49
+ end
40
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: load_balance_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-03-09 00:00:00.000000000 Z
14
+ date: 2012-03-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
18
- requirement: &70234161800420 !ruby/object:Gem::Requirement
18
+ requirement: &2164492940 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.6.7
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70234161800420
26
+ version_requirements: *2164492940
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jeweler
29
- requirement: &70234161796540 !ruby/object:Gem::Requirement
29
+ requirement: &2164492440 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.6.4
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70234161796540
37
+ version_requirements: *2164492440
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: json
40
- requirement: &70234161795100 !ruby/object:Gem::Requirement
40
+ requirement: &2164491860 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70234161795100
48
+ version_requirements: *2164491860
49
49
  description: Simple wrapper around RestClient to make load balanced http requests
50
50
  email: support@igodigital.com
51
51
  executables: []