summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/helpers/numeric_spec.rb
blob: e65f3e861048d11713292558cd38ae09bb6662d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'spec_helper'
require 'mspec/guards'
require 'mspec/helpers'

RSpec.describe Object, "#bignum_value" do
  it "returns a value that is an instance of Bignum on any platform" do
    expect(bignum_value).to eq(0x8000_0000_0000_0000)
  end

  it "returns the default value incremented by the argument" do
    expect(bignum_value(42)).to eq(0x8000_0000_0000_002a)
  end
end

RSpec.describe Object, "#nan_value" do
  it "returns NaN" do
    expect(nan_value.nan?).to be_truthy
  end
end

RSpec.describe Object, "#infinity_value" do
  it "returns Infinity" do
    expect(infinity_value.infinite?).to eq(1)
  end
end