diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-26 04:05:03 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-26 04:05:03 +0000 |
commit | c2b500a000a8128cd1886c6c7b0f7f19eed9fce0 (patch) | |
tree | cad405c76d54a05394884cab81648d837999ece4 /test/ruby | |
parent | 706534b5f5760c2a36f641918cad94bcb3f8cb3d (diff) | |
download | ruby-c2b500a000a8128cd1886c6c7b0f7f19eed9fce0.tar.gz |
* test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for
availability of Unicode data files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/enc/test_case_comprehensive.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb index 40f4327e63..2b93692317 100644 --- a/test/ruby/enc/test_case_comprehensive.rb +++ b/test/ruby/enc/test_case_comprehensive.rb @@ -14,12 +14,21 @@ class TestComprehensiveCaseFold < Test::Unit::TestCase def self.expand_filename(basename) File.expand_path("#{UNICODE_DATA_PATH}/#{basename}.txt", __dir__) end + + def self.data_files_available? + %w[UnicodeData CaseFolding SpecialCasing].all? do |f| + File.exist?(expand_filename(f)) + end + end + + def test_data_files_available + unless TestComprehensiveCaseFold.data_files_available? + skip "Unicode data files not available in #{UNICODE_DATA_PATH}." + end + end end -%w[UnicodeData CaseFolding SpecialCasing].all? {|f| - File.exist?(TestComprehensiveCaseFold.expand_filename(f)) -} and -class TestComprehensiveCaseFold +TestComprehensiveCaseFold.data_files_available? and class TestComprehensiveCaseFold (CaseTest = Struct.new(:method_name, :attributes, :first_data, :follow_data)).class_eval do def initialize(method_name, attributes, first_data, follow_data=first_data) super |