aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/type/unsigned_integer_test.rb
blob: 4b8e2fb5180de8b6d3688b0e9fd1ca0dacb7af19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "cases/helper"

module ActiveRecord
  module Type
    class UnsignedIntegerTest < ActiveRecord::TestCase
      test "unsigned int max value is in range" do
        assert_equal(4294967295, UnsignedInteger.new.type_cast_for_database(4294967295))
      end

      test "minus value is out of range" do
        assert_raises(::RangeError) do
          UnsignedInteger.new.type_cast_for_database(-1)
        end
      end
    end
  end
end