You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-ruby/actionpack/files/actionpack-2.3.10-i18n-0.4....

46 lines
2.6 KiB

Add additional shoulda expectations to cover apparently changed
semantics from i18n 0.4.1 > 0.4.2. It's not clear what changed
exactly, and it could well be a bug in actionpack which doesn't seem
to pass the locale along to all calls in some of these methods. Not
investigated further yet since all Rails development is aimed at Rails
3.
--- test/template/number_helper_i18n_test.rb.~1~ 2011-02-20 15:51:40.792064192 +0100
+++ test/template/number_helper_i18n_test.rb 2011-02-20 16:42:56.067596179 +0100
@@ -20,6 +20,8 @@
end
def test_number_to_currency_translates_currency_formats
+ I18n.expects(:translate).twice.with(:'number.format', {:locale => nil, :raise => true}).returns({})
+ I18n.expects(:translate).with(:'number.precision.format', {:locale => nil, :raise => true}).returns({})
I18n.expects(:translate).with(:'number.format', :locale => 'en', :raise => true).returns(@number_defaults)
I18n.expects(:translate).with(:'number.currency.format', :locale => 'en',
:raise => true).returns(@currency_defaults)
@@ -27,6 +29,7 @@
end
def test_number_with_precision_translates_number_formats
+ I18n.expects(:translate).with(:'number.format', {:locale => nil, :raise => true}).returns({})
I18n.expects(:translate).with(:'number.format', :locale => 'en', :raise => true).returns(@number_defaults)
I18n.expects(:translate).with(:'number.precision.format', :locale => 'en',
:raise => true).returns(@precision_defaults)
@@ -39,6 +42,8 @@
end
def test_number_to_percentage_translates_number_formats
+ I18n.expects(:translate).twice.with(:'number.format', {:locale => nil, :raise => true}).returns({})
+ I18n.expects(:translate).with(:'number.precision.format', {:locale => nil, :raise => true}).returns({})
I18n.expects(:translate).with(:'number.format', :locale => 'en', :raise => true).returns(@number_defaults)
I18n.expects(:translate).with(:'number.percentage.format', :locale => 'en',
:raise => true).returns(@percentage_defaults)
@@ -46,6 +51,8 @@
end
def test_number_to_human_size_translates_human_formats
+ I18n.expects(:translate).twice.with(:'number.format', {:locale => nil, :raise => true}).returns({})
+ I18n.expects(:translate).with(:'number.precision.format', {:locale => nil, :raise => true}).returns({})
I18n.expects(:translate).with(:'number.format', :locale => 'en', :raise => true).returns(@number_defaults)
I18n.expects(:translate).with(:'number.human.format', :locale => 'en',
:raise => true).returns(@human_defaults)