Sha256: 44aba7ceb243a02909dc4d1f0e35e04b2a3b48e9d4e2c102d9e3149c78399731
Contents?: true
Size: 728 Bytes
Versions: 9
Compression:
Stored size: 728 Bytes
Contents
require "spec_helper" MetricFu.metrics_require { "hotspots/analysis/ranking" } describe MetricFu::Ranking do context "with many items" do specify "#top" do ranking = Ranking.new ranking[:a] = 10 ranking[:b] = 50 ranking[:c] = 1 expect(ranking.top).to eq([:b, :a, :c]) end specify "lowest item is at 0 percentile" do ranking = Ranking.new ranking[:a] = 10 ranking[:b] = 50 expect(ranking.percentile(:a)).to eq(0) end specify "highest item is at high percentile" do ranking = Ranking.new ranking[:a] = 10 ranking[:b] = 50 ranking[:c] = 0 ranking[:d] = 5 expect(ranking.percentile(:b)).to eq(0.75) end end end
Version data entries
9 entries across 9 versions & 3 rubygems