remote_http_testing 0.1.3 → 0.1.4

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.
@@ -98,7 +98,7 @@ module RemoteHttpTesting
98
98
  rescue Errno::ECONNREFUSED => error
99
99
  raise "Unable to connect to #{self.current_server}"
100
100
  end
101
- self.last_response = response
101
+ self.last_response = adjust_response_encoding(response)
102
102
  end
103
103
 
104
104
  def self.populate_uri_with_querystring(uri, query_string_hash)
@@ -135,4 +135,12 @@ module RemoteHttpTesting
135
135
  !dom_response.css(css_selector).empty?
136
136
  end
137
137
  end
138
+
139
+ def adjust_response_encoding(response)
140
+ unless response["content-type"].nil?
141
+ split_response = response["content-type"].split("charset=")
142
+ response.body = response.body.force_encoding(split_response[1]) unless split_response[1].nil?
143
+ end
144
+ response
145
+ end
138
146
  end
@@ -1,3 +1,3 @@
1
1
  module RemoteHttpTesting
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_http_testing
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phil Crosby
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-04 00:00:00 -07:00
18
+ date: 2012-11-28 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency