aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/fixnum/odd_spec.rb
blob: 3cf6bf45ed98e1873da2a8c515872806aa82dc1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require File.expand_path('../../../spec_helper', __FILE__)

describe "Fixnum#odd?" do
  it "is false for zero" do
    0.odd?.should be_false
  end

  it "is false for even positive Fixnums" do
    4.odd?.should be_false
  end

  it "is false for even negative Fixnums" do
    (-4).odd?.should be_false
  end

  it "is true for odd positive Fixnums" do
    5.odd?.should be_true
  end

  it "is true for odd negative Fixnums" do
    (-5).odd?.should be_true
  end
end