aboutsummaryrefslogblamecommitdiffstats
path: root/activemodel/test/cases/type/unsigned_integer_test.rb
blob: 16301b3ac00db3c739be492e8f15b40312b8f7f9 (plain) (tree)
1
2
3
4
5
6
7
8
                      
                           
 
                  
             
                                                     
                                                  
                                                                           



                                           
                                           




           
require "cases/helper"
require "active_model/type"

module ActiveModel
  module Type
    class UnsignedIntegerTest < ActiveModel::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