aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_unicode_database_test.rb
blob: dd33641ec2004186e62ad77dc792df6a3a249e34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'abstract_unit'


class MultibyteUnicodeDatabaseTest < ActiveSupport::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
      assert_called(@ucd, :load) do
        @ucd.send(attribute)
      end
    end
  end

  def test_load
    @ucd.load
    UnicodeDatabase::ATTRIBUTES.each do |attribute|
      assert @ucd.send(attribute).length > 1
    end
  end
end