aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/cases/type/unsigned_integer_test.rb
blob: f2c910eadeab258f5f968167ac334b747ad2d007 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                      




                                                      
                                                                           



                                           
                                           




           
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.serialize(4294967295))
      end

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