File: minimum_spec.rb

package info (click to toggle)
ruby-hamster 3.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,932 kB
  • sloc: ruby: 16,915; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "spec_helper"
require "hamster/sorted_set"

describe Hamster::SortedSet do
  describe "#min" do
    [
      [[], nil],
      [["A"], "A"],
      [%w[Ichi Ni San], "Ichi"],
      [[1,2,3,4,5], 1],
      [[0, -0.0, 2.2, -4, -4.2], -4.2],
    ].each do |values, expected|
      context "on #{values.inspect}" do
        it "returns #{expected.inspect}" do
          SS[*values].min.should == expected
        end
      end
    end
  end
end