From 851adf93bc503d88e5f3e145ebf850f74d20632a Mon Sep 17 00:00:00 2001 From: Mario Izquierdo Date: Wed, 21 Feb 2018 17:23:57 -0800 Subject: [PATCH] fix error test --- test/error_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/error_test.rb b/test/error_test.rb index 6b9b9b5..c9bbe09 100644 --- a/test/error_test.rb +++ b/test/error_test.rb @@ -87,14 +87,14 @@ class TestTwirpError < Minitest::Test end end - def test_as_json + def test_to_h # returns a hash with attributes err = Twirp::Error.new(:internal, "err msg", "key" => "val") - assert_equal({code: :internal, msg: "err msg", meta: {"key" => "val"}}, err.as_json) + assert_equal({code: :internal, msg: "err msg", meta: {"key" => "val"}}, err.to_h) # skips meta if not included err = Twirp::Error.new(:internal, "err msg") - assert_equal({code: :internal, msg: "err msg"}, err.as_json) + assert_equal({code: :internal, msg: "err msg"}, err.to_h) end end