diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-24 01:33:18 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-24 01:33:18 +0530 |
commit | efd0bd3b7390ebb8526b981169025f2860f6a113 (patch) | |
tree | 1cb3bcd8f9534f64e8a764af1010ce65303b42b0 /activerecord/test/cases/types/number_test.rb | |
parent | f4571e3617ccd9cc9e5ee9f7431066bd80395e22 (diff) | |
parent | 8ff2fb6f3aa6140f5a8bd018d5919a8a1e707cda (diff) | |
download | rails-efd0bd3b7390ebb8526b981169025f2860f6a113.tar.gz rails-efd0bd3b7390ebb8526b981169025f2860f6a113.tar.bz2 rails-efd0bd3b7390ebb8526b981169025f2860f6a113.zip |
Merge remote branch 'mainstream/master'
Diffstat (limited to 'activerecord/test/cases/types/number_test.rb')
-rw-r--r-- | activerecord/test/cases/types/number_test.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/activerecord/test/cases/types/number_test.rb b/activerecord/test/cases/types/number_test.rb deleted file mode 100644 index ee7216a0f1..0000000000 --- a/activerecord/test/cases/types/number_test.rb +++ /dev/null @@ -1,30 +0,0 @@ -require "cases/helper" - -class NumberTest < ActiveRecord::TestCase - - def setup - @column = ActiveRecord::ConnectionAdapters::Column.new('comments_count', 0, 'integer') - @number = ActiveRecord::Type::Number.new(@column) - end - - test "typecast" do - assert_equal 1, @number.cast(1) - assert_equal 1, @number.cast('1') - assert_equal 0, @number.cast('') - - assert_equal 0, @number.precast(false) - assert_equal 1, @number.precast(true) - assert_equal nil, @number.precast('') - assert_equal 0, @number.precast(0) - end - - test "cast as boolean" do - assert_equal true, @number.boolean('1') - assert_equal true, @number.boolean(1) - - assert_equal false, @number.boolean(0) - assert_equal false, @number.boolean('0') - assert_equal false, @number.boolean(nil) - end - -end |