mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Put test-case dependent helper Class inside the test case
This fixes ⚠️ previous definition of download was here
This commit is contained in:
parent
bd2178f115
commit
8f35fcec56
3 changed files with 39 additions and 39 deletions
|
@ -5,25 +5,25 @@ require 'fileutils'
|
|||
require 'open-uri'
|
||||
require 'tmpdir'
|
||||
|
||||
class Downloader
|
||||
def self.download(from, to)
|
||||
unless File.exist?(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
|
||||
class MultibyteConformanceTest < ActiveSupport::TestCase
|
||||
class Downloader
|
||||
def self.download(from, to)
|
||||
unless File.exist?(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
|
||||
true
|
||||
end
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
class MultibyteConformanceTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd"
|
||||
|
|
|
@ -6,25 +6,25 @@ require 'fileutils'
|
|||
require 'open-uri'
|
||||
require 'tmpdir'
|
||||
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
class MultibyteGraphemeBreakConformanceTest < ActiveSupport::TestCase
|
||||
TEST_DATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd/auxiliary"
|
||||
TEST_DATA_FILE = '/GraphemeBreakTest.txt'
|
||||
CACHE_DIR = File.join(Dir.tmpdir, 'cache')
|
||||
|
|
|
@ -7,25 +7,25 @@ require 'fileutils'
|
|||
require 'open-uri'
|
||||
require 'tmpdir'
|
||||
|
||||
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
|
||||
class MultibyteNormalizationConformanceTest < 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
|
||||
end
|
||||
|
||||
class MultibyteNormalizationConformanceTest < ActiveSupport::TestCase
|
||||
include MultibyteTestHelpers
|
||||
|
||||
UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd"
|
||||
|
|
Loading…
Reference in a new issue