test/inferrable_test.rb in hiccup-0.4.5 vs test/inferrable_test.rb in hiccup-0.5.0
- old
+ new
@@ -260,6 +260,23 @@
assert_equal ["The first Tuesday, second Thursday, third Thursday, third Tuesday, fourth Tuesday, and fifth Thursday of every third month"], schedules.map(&:humanize)
end
+ if ENV['PERFORMANCE_TEST']
+ test "performance test" do
+ Benchmark.bm(20) do |x|
+ [10, 25, 50, 100, 250, 500].each do |n|
+ seed = Date.today
+ dates = (0...n).each_with_object([]) { |i, array| array << seed + i * 7 }
+ x.report("#{n} dates") do
+ Schedule.infer(dates)
+ end
+ end
+ end
+ end
+ end
+
+
+
+
end