2008-09-21 11:21:30 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'abstract_unit'
|
|
|
|
|
2010-05-10 09:46:37 -04:00
|
|
|
|
2012-01-05 20:12:46 -05:00
|
|
|
class MultibyteUnicodeDatabaseTest < ActiveSupport::TestCase
|
2010-05-10 09:46:37 -04:00
|
|
|
|
|
|
|
include ActiveSupport::Multibyte::Unicode
|
|
|
|
|
2008-09-21 11:21:30 -04:00
|
|
|
def setup
|
2010-05-10 09:46:37 -04:00
|
|
|
@ucd = UnicodeDatabase.new
|
2008-09-21 11:21:30 -04:00
|
|
|
end
|
|
|
|
|
2010-05-10 09:46:37 -04:00
|
|
|
UnicodeDatabase::ATTRIBUTES.each do |attribute|
|
2008-09-21 11:21:30 -04:00
|
|
|
define_method "test_lazy_loading_on_attribute_access_of_#{attribute}" do
|
|
|
|
@ucd.expects(:load)
|
|
|
|
@ucd.send(attribute)
|
|
|
|
end
|
|
|
|
end
|
2010-05-10 09:46:37 -04:00
|
|
|
|
2008-09-21 11:21:30 -04:00
|
|
|
def test_load
|
|
|
|
@ucd.load
|
2010-05-10 09:46:37 -04:00
|
|
|
UnicodeDatabase::ATTRIBUTES.each do |attribute|
|
2008-09-21 11:21:30 -04:00
|
|
|
assert @ucd.send(attribute).length > 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|