Sha256: a01e6501a109572d2f7acc6101b7b45b9209d27b26abc0dc1784ed1c6c903d17
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
require_relative "../../../lib/rankum/utils/fcp_pair" module Rankum module Utils describe FCPPair do context "when receiving a rank as an array" do let(:rank) { ["A", "A", "C", "D", "E"] } let(:pair_array) { [ Pair.new("A","A"), Pair.new("A","C"), Pair.new("A","D"), Pair.new("A", "E"), Pair.new("A","C"), Pair.new("A","D"), Pair.new("A", "E"), Pair.new("C","D"), Pair.new("C","E"), Pair.new("D", "E") ] } let(:pair_hash) do { Pair.new("A","A") => 1, Pair.new("A","C") => 2, Pair.new("A","D") => 2, Pair.new("A", "E") => 2, Pair.new("C","D") => 1, Pair.new("C","E") => 1, Pair.new("D", "E") => 1 } end it "should return an array of pairs" do expect(FCPPair.to_a(rank)).to eq(pair_array) end it "should return a hash of pair occurences" do expect(FCPPair.to_h(rank)).to eq(pair_hash) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rankum-1.1.0 | spec/rankum/utils/fcp_pair_spec.rb |
rankum-1.0.0 | spec/rankum/utils/fcp_pair_spec.rb |