spec/client_spec.rb in gmaps_tz-0.0.1 vs spec/client_spec.rb in gmaps_tz-0.0.2

- old
+ new

@@ -44,10 +44,17 @@ end it "returns a hash with the result when success" do Net::HTTP.stub(:get_response).and_return(mocked_response_ok) response = client.time_zone_in("1.0", "2.0", time) - response.should == mocked_response_ok + response.should == JSON.parse(mocked_response_ok.body) + end + + it "raises the corresponding exception when it errors parsing response" do + Net::HTTP.stub(:get_response).and_return(FakeResponse.new("")) + expect { + client.time_zone_in("1.0", "2.0", time) + }.to raise_error(GmapsTz::InvalidResponseBodyError) end it "raises the corresponding exception when it fails" do Net::HTTP.stub(:get_response).and_return(mocked_response_over_limit) expect { \ No newline at end of file