diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-11 00:52:42 +0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-11 03:17:09 +0800 |
commit | a9f3c9da01d721963d05949604ead909aaabbf36 (patch) | |
tree | 5e278655997e1dcf86d9e0ee2f6be30d323fc8b4 /activesupport/test | |
parent | 635d991683c439da56fa72853880e88e6ac291ed (diff) | |
download | rails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.gz rails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.bz2 rails-a9f3c9da01d721963d05949604ead909aaabbf36.zip |
Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/transliterate_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/test/transliterate_test.rb b/activesupport/test/transliterate_test.rb index b054855d08..09271b759d 100644 --- a/activesupport/test/transliterate_test.rb +++ b/activesupport/test/transliterate_test.rb @@ -1,6 +1,7 @@ # encoding: utf-8 require 'abstract_unit' require 'active_support/inflector/transliterate' +require 'active_support/core_ext/object/inclusion' class TransliterateTest < Test::Unit::TestCase @@ -15,7 +16,7 @@ class TransliterateTest < Test::Unit::TestCase # create string with range of Unicode"s western characters with # diacritics, excluding the division and multiplication signs which for # some reason or other are floating in the middle of all the letters. - string = (0xC0..0x17E).to_a.reject {|c| [0xD7, 0xF7].include? c}.pack("U*") + string = (0xC0..0x17E).to_a.reject {|c| c.either?(0xD7, 0xF7)}.pack("U*") string.each_char do |char| assert_match %r{^[a-zA-Z']*$}, ActiveSupport::Inflector.transliterate(string) end |