ruby-changes:56400
From: Hiroshi <ko1@a...>
Date: Tue, 9 Jul 2019 21:17:20 +0900 (JST)
Subject: [ruby-changes:56400] Hiroshi SHIBATA: 9f275f7971 (master): Restore support library for only test files that are digest and csv.
https://git.ruby-lang.org/ruby.git/commit/?id=9f275f7971 From 9f275f7971ee7e659e0965122b2bb57e785d0181 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Tue, 9 Jul 2019 21:16:49 +0900 Subject: Restore support library for only test files that are digest and csv. diff --git a/test/csv/helper.rb b/test/csv/helper.rb index 208ee62..eadff54 100644 --- a/test/csv/helper.rb +++ b/test/csv/helper.rb @@ -3,7 +3,7 @@ require "test/unit" https://github.com/ruby/ruby/blob/trunk/test/csv/helper.rb#L3 require "csv" -require_relative "../../tool/lib/with_different_ofs.rb" +require_relative "../lib/with_different_ofs" module Helper def with_chunk_size(chunk_size) diff --git a/test/digest/test_digest_extend.rb b/test/digest/test_digest_extend.rb index a07e2c0..bd599f2 100644 --- a/test/digest/test_digest_extend.rb +++ b/test/digest/test_digest_extend.rb @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/test/digest/test_digest_extend.rb#L1 # frozen_string_literal: false require 'test/unit' require 'digest' -require_relative '../../tool/lib/with_different_ofs.rb' +require_relative '../lib/with_different_ofs' class TestDigestExtend < Test::Unit::TestCase extend DifferentOFS diff --git a/test/lib/with_different_ofs.rb b/test/lib/with_different_ofs.rb new file mode 100644 index 0000000..559ed6a --- /dev/null +++ b/test/lib/with_different_ofs.rb @@ -0,0 +1,22 @@ https://github.com/ruby/ruby/blob/trunk/test/lib/with_different_ofs.rb#L1 +# frozen_string_literal: true +module DifferentOFS + module WithDifferentOFS + def setup + super + verbose, $VERBOSE = $VERBOSE, nil + @ofs, $, = $,, "-" + $VERBOSE = verbose + end + def teardown + verbose, $VERBOSE = $VERBOSE, nil + $, = @ofs + $VERBOSE = verbose + super + end + end + + def self.extended(klass) + super(klass) + klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name + end +end diff --git a/tool/lib/with_different_ofs.rb b/tool/lib/with_different_ofs.rb deleted file mode 100644 index 559ed6a..0000000 --- a/tool/lib/with_different_ofs.rb +++ /dev/null @@ -1,22 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/lib/with_different_ofs.rb#L0 -# frozen_string_literal: true -module DifferentOFS - module WithDifferentOFS - def setup - super - verbose, $VERBOSE = $VERBOSE, nil - @ofs, $, = $,, "-" - $VERBOSE = verbose - end - def teardown - verbose, $VERBOSE = $VERBOSE, nil - $, = @ofs - $VERBOSE = verbose - super - end - end - - def self.extended(klass) - super(klass) - klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name - end -end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/