Skip to content

Commit

Permalink
Added tests [#279 state:resolved] (Nicholas Schlueter)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jun 3, 2008
1 parent 64fea9c commit da91450
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions activesupport/test/core_ext/array_ext_test.rb
Expand Up @@ -222,6 +222,11 @@ def test_to_xml_with_block

assert xml.include?(%(<count>2</count>)), xml
end

def test_to_xml_with_empty
xml = [].to_xml
assert_match /type="array"\/>/, xml
end
end

class ArrayExtractOptionsTests < Test::Unit::TestCase
Expand Down
1 change: 1 addition & 0 deletions activesupport/test/core_ext/bigdecimal.rb
Expand Up @@ -5,5 +5,6 @@ def test_to_yaml
assert_equal("--- 100000.30020320320000000000000000000000000000001\n", BigDecimal.new('100000.30020320320000000000000000000000000000001').to_yaml)
assert_equal("--- .Inf\n", BigDecimal.new('Infinity').to_yaml)
assert_equal("--- .NaN\n", BigDecimal.new('NaN').to_yaml)
assert_equal("--- -.Inf\n", BigDecimal.new('-Infinity').to_yaml)
end
end
4 changes: 4 additions & 0 deletions activesupport/test/core_ext/date_ext_test.rb
Expand Up @@ -198,6 +198,10 @@ def test_end_of_day
assert_equal Time.local(2005,2,21,23,59,59), Date.new(2005,2,21).end_of_day
end

def test_date_acts_like_date
assert Date.new.acts_like_date?
end

def test_xmlschema
with_env_tz 'US/Eastern' do
assert_match(/^1980-02-28T00:00:00-05:?00$/, Date.new(1980, 2, 28).xmlschema)
Expand Down

0 comments on commit da91450

Please sign in to comment.