benchmark/javascript_escape.rb in escape_utils-0.1.4 vs benchmark/javascript_escape.rb in escape_utils-0.1.5

- old
+ new

@@ -11,14 +11,12 @@ class ActionPackBench extend ActionView::Helpers::JavaScriptHelper end times = 100 -url = "http://code.jquery.com/jquery-1.4.2.js" +url = "http://ajax.googleapis.com/ajax/libs/dojo/1.4.3/dojo/dojo.xd.js.uncompressed.js" javascript = `curl -s #{url}` -puts "Escaping #{javascript.bytesize} bytes of javascript from #{url}" - -puts ActionPackBench.escape_javascript(javascript).eql?(EscapeUtils.escape_javascript(javascript)) +puts "Escaping #{javascript.bytesize} bytes of javascript #{times} times, from #{url}" Benchmark.bmbm do |x| x.report do puts "ActionView::Helpers::JavaScriptHelper#escape_javascript" times.times do \ No newline at end of file