2006-02-09 13:06:29 -05:00
|
|
|
require 'abstract_unit'
|
|
|
|
require 'fixtures/default'
|
|
|
|
|
2006-07-08 16:35:56 -04:00
|
|
|
if current_adapter?(:PostgreSQLAdapter, :SQLServerAdapter)
|
|
|
|
class DefaultsTest < Test::Unit::TestCase
|
2006-02-09 13:06:29 -05:00
|
|
|
def test_default_integers
|
|
|
|
default = Default.new
|
2006-07-08 16:35:56 -04:00
|
|
|
assert_instance_of Fixnum, default.positive_integer
|
|
|
|
assert_equal 1, default.positive_integer
|
|
|
|
assert_instance_of Fixnum, default.negative_integer
|
|
|
|
assert_equal -1, default.negative_integer
|
|
|
|
assert_instance_of BigDecimal, default.decimal_number
|
|
|
|
assert_equal BigDecimal.new("2.78"), default.decimal_number
|
2006-02-09 14:32:32 -05:00
|
|
|
end
|
2006-02-09 13:06:29 -05:00
|
|
|
end
|
|
|
|
end
|