test/test_jsont.rb in jsont-0.1.1 vs test/test_jsont.rb in jsont-0.1.2
- old
+ new
@@ -64,9 +64,16 @@
} ]
}
}), '<div id="topNav"><ul id="mainNav"><li class="dropdown research"><a class="navLabel" href="http://localhost/research/databases.php">Research</a>
<ul class="clearfix"><li class="dropDownItem"><a href="http://localhost/research/databases.php">Databases</a></li><li class="dropDownItem"><a href="http://localhost/research/homework-help.php">Homework Help</a></li><li class="dropDownItem"><a href="http://localhost/research/government.php">Government</a></li><li class="dropDownItem"><a href="http://localhost/research/local-history.php">Local/Family History</a></li><li class="dropDownItem"><a href="http://localhost/research/teacher-resources.php">Teacher Resources</a></li><li class="dropDownItem"><a href="http://localhost/research/business.php">Business</a></li><li class="dropDownItem"><a href="http://localhost/research/investing.php">Investing</a></li><li class="dropDownItem"><a href="http://localhost/research/careers.php">Careers</a></li></ul></li></ul><ul id="subNav"><div class="research"><li><a class="" href="http://localhost/research/databases.php">Databases</a></li><li><a class="" href="http://localhost/research/homework-help.php">Homework Help</a></li><li><a class="" href="http://localhost/research/government.php">Government</a></li><li><a class="" href="http://localhost/research/local-history.php">Local/Family History</a></li><li><a class="" href="http://localhost/research/teacher-resources.php">Teacher Resources</a></li><li><a class="" href="http://localhost/research/business.php">Business</a></li><li><a class="" href="http://localhost/research/investing.php">Investing</a></li><li><a class="" href="http://localhost/research/careers.php">Careers</a></li></div></ul></div>')
+ assert_equal(
+ Jsont.new(
+ {'self' => '<div>{$.test}</div>',
+ 'test' => Proc.new{|t, opts| t['x']+t['y']}}
+ ).transform(
+ {'test' => {'x' => 1, 'y' => 2}}
+ ), '<div>3</div>')
end
end