Browse files

Some platforms include colon in timezone offset, some don't. References

#9744.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 748e687 commit d9dac76f53ab95776ffd10d997f4a7b6d41eed32 @jeremy jeremy committed Oct 3, 2007
View
6 activesupport/test/core_ext/date_ext_test.rb
@@ -165,9 +165,9 @@ def test_end_of_day
def test_xmlschema
with_timezone 'US/Eastern' do
- assert_equal '1880-06-28T00:00:00-04:00', Date.new(1880, 6, 28).xmlschema
- assert_equal '1980-06-28T00:00:00-04:00', Date.new(1980, 6, 28).xmlschema
- assert_equal '2080-06-28T00:00:00-04:00', Date.new(2080, 6, 28).xmlschema
+ assert_match(/^1880-06-28T00:00:00-04:?00$/, Date.new(1880, 6, 28).xmlschema)
+ assert_match(/^1980-06-28T00:00:00-04:?00$/, Date.new(1980, 6, 28).xmlschema)
+ assert_match(/^2080-06-28T00:00:00-04:?00$/, Date.new(2080, 6, 28).xmlschema)
end
end
View
6 activesupport/test/core_ext/date_time_ext_test.rb
@@ -186,9 +186,9 @@ def test_xmlschema
assert_equal '1880-02-28T15:15:10Z', DateTime.civil(1880, 2, 28, 15, 15, 10).xmlschema
assert_equal '1980-02-28T15:15:10Z', DateTime.civil(1980, 2, 28, 15, 15, 10).xmlschema
assert_equal '2080-02-28T15:15:10Z', DateTime.civil(2080, 2, 28, 15, 15, 10).xmlschema
- assert_equal '1880-02-28T15:15:10-06:00', DateTime.civil(1880, 2, 28, 15, 15, 10, -0.25).xmlschema
- assert_equal '1980-02-28T15:15:10-06:00', DateTime.civil(1980, 2, 28, 15, 15, 10, -0.25).xmlschema
- assert_equal '2080-02-28T15:15:10-06:00', DateTime.civil(2080, 2, 28, 15, 15, 10, -0.25).xmlschema
+ assert_match(/^1880-02-28T15:15:10-06:?00$/, DateTime.civil(1880, 2, 28, 15, 15, 10, -0.25).xmlschema)
+ assert_match(/^1980-02-28T15:15:10-06:?00$/, DateTime.civil(1980, 2, 28, 15, 15, 10, -0.25).xmlschema)
+ assert_match(/^2080-02-28T15:15:10-06:?00$/, DateTime.civil(2080, 2, 28, 15, 15, 10, -0.25).xmlschema)
end
def test_acts_like_time

0 comments on commit d9dac76

Please sign in to comment.