1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/multibyte_unicode_database_test.rb
Norman Clarke f3abc8ac36 Use multibyte proxy class on 1.9, refactor Unicode.
Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding.

Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency.

[#4594 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-21 12:24:54 -07:00

26 lines
538 B
Ruby

# encoding: utf-8
require 'abstract_unit'
class MultibyteUnicodeDatabaseTest < Test::Unit::TestCase
include ActiveSupport::Multibyte::Unicode
def setup
@ucd = UnicodeDatabase.new
end
UnicodeDatabase::ATTRIBUTES.each do |attribute|
define_method "test_lazy_loading_on_attribute_access_of_#{attribute}" do
@ucd.expects(:load)
@ucd.send(attribute)
end
end
def test_load
@ucd.load
UnicodeDatabase::ATTRIBUTES.each do |attribute|
assert @ucd.send(attribute).length > 1
end
end
end