Sha256: 864efb528f8bd9a394a00bd31cd0fc0c714ae0151f27f8a6ba76ce00687151ff
Contents?: true
Size: 731 Bytes
Versions: 12
Compression:
Stored size: 731 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
12 entries across 12 versions & 1 rubygems