PageRenderTime 3ms CodeModel.GetById 261ms app.highlight 5ms RepoModel.GetById 86ms app.codeStats 0ms

/utils/latency/spec/score_spec.rb

http://github.com/AF83/ucengine
Ruby | 33 lines | 26 code | 6 blank | 1 comment | 0 complexity | 8b3b62b24e11a40967376e774d74035f MD5 | raw file
 1#!/usr/bin/env ruby
 2
 3require "minitest/autorun"
 4require "../lib/score"
 5
 6describe Score do
 7
 8    it "append value in a new score" do
 9        s = Score.new
10        s['toto'] << 42
11        s['toto'].must_equal [42]
12    end
13
14    it "sort a score" do
15        s = Score.new
16        s['toto'] << 42
17        s['toto'] << 41
18        s['toto'].must_equal [42, 41]
19        s.sort!
20        s['toto'].must_equal [41, 42]
21    end
22
23    it "display a score as CSV" do
24        s = Score.new
25        s['toto'] << 42
26        s['toto'] << 41
27        s['toto'].must_equal [42, 41]
28        s.sort!
29        s.to_csv.must_equal "toto;42\n"
30        p s.to_all_csv
31    end
32 
33end