Sha256: b56570e10fac55605fda6ec221d8f218b894c42159e37fb165b555e39068ec7b

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

require 'rails_helper'

describe Fixnum do

  describe '#nearest_half' do
    it 'returns a float of itself' do
      expect(1.nearest_half).to eq(1.0)
    end
  end

  describe '#to_bool' do
    it 'returns true for 1' do
      expect(1.to_bool).to eq(true)
    end
    it 'returns false for 0' do
      expect(0.to_bool).to eq(false)
    end
    it 'raises an error for all other numbers' do
      expect { 2.to_bool }.to raise_error(ArgumentError)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heartwood-0.0.1 spec/lib/support/fixnum_spec.rb