barnesandnoble 0.1.0 → 0.1.1

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: db17520069852a3d44e1208ba800034538fb7e9b
4
- data.tar.gz: 6fc45725162b7ace4fc9d9bba491bf5242f72cd7
3
+ metadata.gz: a4991de82e91c44e37e5d91313334fe9dd421944
4
+ data.tar.gz: 5db04af870e29db42b7cb005ced205bd7d198ced
5
5
  SHA512:
6
- metadata.gz: dd37b7f8eb3d12a6ef43b90e230c05fbd37a192746aadf9d7a48c0d5ac0cccca440c0dc044931b4487e2c5b759c7d58116adc5a73dd837eca86c1e9d193299c6
7
- data.tar.gz: 2915c69ff4529ae1567c271065f919ae00e38386021520be2949c1fbad98db13b109e94fba0caa0fb460775765977b123a2c15b0a9b614fe1950f708e7e92de5
6
+ metadata.gz: 5339753b11efab7306d4138d1eeee5dd02caf848a18685c2c4d25c866531d89dbe147bbd6ab6a4e86516452a608a59f4bbf3811efe6ba315db32e38d237a6366
7
+ data.tar.gz: 48958577590bfb177a74f37d2cf5d35ab01e0991d40633e3249b0126e656e969282f75fe208634ff72cef88e93ee2c942d4f073ac6bb6f36d7ac1f53722a3b5b
@@ -3,6 +3,10 @@ require 'multi_xml'
3
3
 
4
4
  module BarnesAndNoble
5
5
  class Response < SimpleDelegator
6
+ def body
7
+ __getobj__.body.force_encoding('ISO8859-1').encode('UTF-8')
8
+ end
9
+
6
10
  def to_h
7
11
  MultiXml.parse(body)
8
12
  end
@@ -1,3 +1,3 @@
1
1
  module BarnesAndNoble
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
  require 'minitest/pride'
3
3
  require 'pry'
4
+
4
5
  require_relative '../lib/barnesandnoble'
5
6
 
6
7
  class TestBarnesAndNoble < Minitest::Unit::TestCase
@@ -58,4 +59,13 @@ class TestBarnesAndNoble < Minitest::Unit::TestCase
58
59
 
59
60
  refute_empty res.to_h
60
61
  end
62
+
63
+ def test_handles_unicode_characters
64
+ res = @req.get('ProductLookup', {
65
+ 'ProductCode' => 'Book',
66
+ 'Ean' => '0942299663'
67
+ })
68
+
69
+ assert_equal 'La Jetée', res.to_h['ProductLookupResponse']['ProductLookupResult']['Product']['Titles']['Title']['title']
70
+ end
61
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barnesandnoble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Marquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-29 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_xml