aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_unicode_database_test.rb
blob: 405c7c21085003383bfddb05a0757b9b815f3430 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# encoding: utf-8
require 'abstract_unit'

class MultibyteUnicodeDatabaseTest < Test::Unit::TestCase
  def setup
    @ucd = ActiveSupport::Multibyte::UnicodeDatabase.new
  end

  ActiveSupport::Multibyte::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
    ActiveSupport::Multibyte::UnicodeDatabase::ATTRIBUTES.each do |attribute|
      assert @ucd.send(attribute).length > 1
    end
  end
end