commit c0e076b72e20442cb528010e9436f04a79de1a9b Author: Ryan Tomayko Date: Thu Sep 15 00:37:58 2011 -0700 fix yajl template test failures due to hash (un)order under 1.8 diff --git a/test/tilt_yajltemplate_test.rb b/test/tilt_yajltemplate_test.rb index 5226c16..707f97b 100644 --- a/test/tilt_yajltemplate_test.rb +++ b/test/tilt_yajltemplate_test.rb @@ -11,12 +11,20 @@ begin test "compiles and evaluates the template on #render" do template = Tilt::YajlTemplate.new { "json = { :integer => 3, :string => 'hello' }" } - assert_equal '{"integer":3,"string":"hello"}', template.render + output = template.render + result = Yajl::Parser.parse(output) + expect = {"integer" => 3,"string" => "hello"} + assert_equal expect, result end test "can be rendered more than once" do template = Tilt::YajlTemplate.new { "json = { :integer => 3, :string => 'hello' }" } - 3.times { assert_equal '{"integer":3,"string":"hello"}', template.render } + expect = {"integer" => 3,"string" => "hello"} + 3.times do + output = template.render + result = Yajl::Parser.parse(output) + assert_equal expect, result + end end test "evaluating ruby code" do