From 7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 4 Jul 2016 13:11:44 +0200 Subject: DRY Downloader. --- .../test/multibyte_grapheme_break_conformance_test.rb | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'activesupport/test/multibyte_grapheme_break_conformance_test.rb') diff --git a/activesupport/test/multibyte_grapheme_break_conformance_test.rb b/activesupport/test/multibyte_grapheme_break_conformance_test.rb index 6e2f02abed..45e1976246 100644 --- a/activesupport/test/multibyte_grapheme_break_conformance_test.rb +++ b/activesupport/test/multibyte_grapheme_break_conformance_test.rb @@ -1,29 +1,14 @@ # encoding: utf-8 require 'abstract_unit' +require 'multibyte_test_helpers' require 'fileutils' require 'open-uri' require 'tmpdir' class MultibyteGraphemeBreakConformanceTest < ActiveSupport::TestCase - class Downloader - def self.download(from, to) - unless File.exist?(to) - $stderr.puts "Downloading #{from} to #{to}" - unless File.exist?(File.dirname(to)) - system "mkdir -p #{File.dirname(to)}" - end - open(from) do |source| - File.open(to, 'w') do |target| - source.each_line do |l| - target.write l - end - end - end - end - end - end + include MultibyteTestHelpers TEST_DATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd/auxiliary" TEST_DATA_FILE = '/GraphemeBreakTest.txt' -- cgit v1.2.3