aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/fixnum/shared/abs.rb
blob: 511ec5221b10ecff8a7a3d9570c5658e1cae9c73 (plain)
1
2
3
4
5
6
7
8
9
describe :fixnum_abs, shared: true do
  it "returns self's absolute value" do
    { 0 => [0, -0, +0], 2 => [2, -2, +2], 100 => [100, -100, +100] }.each do |key, values|
      values.each do |value|
        value.send(@method).should == key
      end
    end
  end
end