diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-09-21 17:54:36 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-09-21 17:54:39 -0700 |
commit | 12d06dd91dd189df73186b0f537301dbac8af2e2 (patch) | |
tree | 13f378db09421371b0e209d2c16b8407aa41f261 /actionview/test | |
parent | 19966242163611e61d45ee4033f28aa6f967906a (diff) | |
download | rails-12d06dd91dd189df73186b0f537301dbac8af2e2.tar.gz rails-12d06dd91dd189df73186b0f537301dbac8af2e2.tar.bz2 rails-12d06dd91dd189df73186b0f537301dbac8af2e2.zip |
Undeprecate plural positional argument
```ruby
pluralize people.count, 'person', 'people'
```
reads more naturally than
```ruby
pluralize people.count, 'person', plural: 'people'
```
so let's not deprecate it.
We could label both, but that's a mouthful:
```ruby
pluralize people.count, singular: 'person', plural: 'people'
```
(The `plural:` kwarg shipped in 5.0.0, so we're keeping it.)
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/text_helper_test.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index d77e4c6913..fb557c24ac 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -379,6 +379,8 @@ class TextHelperTest < ActionView::TestCase assert_equal("1.25 counts", pluralize("1.25", "count")) assert_equal("1.0 count", pluralize("1.0", "count")) assert_equal("1.00 count", pluralize("1.00", "count")) + assert_equal("2 counters", pluralize(2, "count", "counters")) + assert_equal("0 counters", pluralize(nil, "count", "counters")) assert_equal("2 counters", pluralize(2, "count", plural: "counters")) assert_equal("0 counters", pluralize(nil, "count", plural: "counters")) assert_equal("2 people", pluralize(2, "person")) @@ -405,12 +407,6 @@ class TextHelperTest < ActionView::TestCase end end - def test_deprecated_plural_as_positional_argument - assert_deprecated do - pluralize(2, "count", "counters") - end - end - def test_cycle_class value = Cycle.new("one", 2, "3") assert_equal("one", value.to_s) |