* test/with_different_ofs.rb (DifferentOFS): should not affect
original classes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dd5ad24735
commit
6d8c13bc61
@ -1,3 +1,8 @@
|
|||||||
|
Sun Dec 26 11:15:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/with_different_ofs.rb (DifferentOFS): should not affect
|
||||||
|
original classes.
|
||||||
|
|
||||||
Sun Dec 26 09:35:07 2010 Tanaka Akira <akr@fsij.org>
|
Sun Dec 26 09:35:07 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* rational.c: parenthesize macro arguments.
|
* rational.c: parenthesize macro arguments.
|
||||||
|
@ -18,7 +18,7 @@ require_relative "base"
|
|||||||
# separator <tt>$/</tt>.
|
# separator <tt>$/</tt>.
|
||||||
#
|
#
|
||||||
class TestCSV::Parsing < TestCSV
|
class TestCSV::Parsing < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
BIG_DATA = "123456789\n" * 1024
|
BIG_DATA = "123456789\n" * 1024
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Writing < TestCSV
|
class TestCSV::Writing < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def test_writing
|
def test_writing
|
||||||
[ ["\t", ["\t"]],
|
[ ["\t", ["\t"]],
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::DataConverters < TestCSV
|
class TestCSV::DataConverters < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Encodings < TestCSV
|
class TestCSV::Encodings < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -12,7 +12,7 @@ require "zlib"
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Features < TestCSV
|
class TestCSV::Features < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
TEST_CASES = [ [%Q{a,b}, ["a", "b"]],
|
TEST_CASES = [ [%Q{a,b}, ["a", "b"]],
|
||||||
[%Q{a,"""b"""}, ["a", "\"b\""]],
|
[%Q{a,"""b"""}, ["a", "\"b\""]],
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Headers < TestCSV
|
class TestCSV::Headers < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Interface < TestCSV
|
class TestCSV::Interface < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Row < TestCSV
|
class TestCSV::Row < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -25,7 +25,7 @@ class Hash
|
|||||||
end
|
end
|
||||||
|
|
||||||
class TestCSV::Serialization < TestCSV
|
class TestCSV::Serialization < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
### Classes Used to Test Serialization ###
|
### Classes Used to Test Serialization ###
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
require_relative "base"
|
require_relative "base"
|
||||||
|
|
||||||
class TestCSV::Table < TestCSV
|
class TestCSV::Table < TestCSV
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
@ -3,7 +3,7 @@ require 'digest'
|
|||||||
require_relative '../with_different_ofs.rb'
|
require_relative '../with_different_ofs.rb'
|
||||||
|
|
||||||
class TestDigestExtend < Test::Unit::TestCase
|
class TestDigestExtend < Test::Unit::TestCase
|
||||||
include DifferentOFS
|
extend DifferentOFS
|
||||||
|
|
||||||
class MyDigest < Digest::Class
|
class MyDigest < Digest::Class
|
||||||
def initialize(*arg)
|
def initialize(*arg)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
module DifferentOFS
|
module DifferentOFS
|
||||||
|
module WithDifferentOFS
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
@ofs, $, = $,, "-"
|
@ofs, $, = $,, "-"
|
||||||
@ -7,12 +8,9 @@ module DifferentOFS
|
|||||||
$, = @ofs
|
$, = @ofs
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module WithDifferentOFS
|
def self.extended(klass)
|
||||||
def with_diffrent_ofs
|
|
||||||
end
|
|
||||||
end
|
|
||||||
def self.included(klass)
|
|
||||||
super(klass)
|
super(klass)
|
||||||
klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name
|
klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user