From 31dab9e4e892fa3f12e3659cd4b8fa42b52c999d Mon Sep 17 00:00:00 2001 From: Zack Hobson Date: Thu, 26 Dec 2013 11:57:57 -0800 Subject: use yajl, test html unescape --- test/net_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/net_test.rb b/test/net_test.rb index c4e39e1..3eec454 100644 --- a/test/net_test.rb +++ b/test/net_test.rb @@ -18,6 +18,18 @@ class NetTest < HCl::TestCase assert_equal true, HCl::Net.ssl end + def test_http_deep_unescape + FakeWeb.register_uri(:get, "https://bob:secret@bobclock.harvestapp.com/foo", + :body => Yajl::Encoder.encode({ + status:'gotten & got!', + comparisons:['burrito > taco', 'rain < sun'] + })) + body = HCl::Net.get 'foo' + assert_equal 'gotten & got!', body[:status] + assert_equal 'burrito > taco', body[:comparisons][0] + assert_equal 'rain < sun', body[:comparisons][1] + end + def test_http_get FakeWeb.register_uri(:get, "https://bob:secret@bobclock.harvestapp.com/foo", :body => 'gotten!'.inspect) -- cgit v1.2.3