summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-26 02:15:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-26 02:15:55 +0000
commit6d8c13bc61c465ab400a12e0a44e9de52f117b7b (patch)
treeb8e52adb2654f14838ea04d8f4e3fa774d4e7b30
parentdd5ad24735bebabb7e20df7b408c33b34f784b8f (diff)
* 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
-rw-r--r--ChangeLog5
-rwxr-xr-xtest/csv/test_csv_parsing.rb2
-rwxr-xr-xtest/csv/test_csv_writing.rb2
-rwxr-xr-xtest/csv/test_data_converters.rb2
-rwxr-xr-xtest/csv/test_encodings.rb2
-rwxr-xr-xtest/csv/test_features.rb2
-rwxr-xr-xtest/csv/test_headers.rb2
-rwxr-xr-xtest/csv/test_interface.rb2
-rwxr-xr-xtest/csv/test_row.rb2
-rwxr-xr-xtest/csv/test_serialization.rb2
-rwxr-xr-xtest/csv/test_table.rb2
-rw-r--r--test/digest/test_digest_extend.rb2
-rw-r--r--test/with_different_ofs.rb20
13 files changed, 25 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 79bd979e095..3ab8d260a3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* rational.c: parenthesize macro arguments.
diff --git a/test/csv/test_csv_parsing.rb b/test/csv/test_csv_parsing.rb
index 3da9df755d2..55d1bee80bf 100755
--- a/test/csv/test_csv_parsing.rb
+++ b/test/csv/test_csv_parsing.rb
@@ -18,7 +18,7 @@ require_relative "base"
# separator <tt>$/</tt>.
#
class TestCSV::Parsing < TestCSV
- include DifferentOFS
+ extend DifferentOFS
BIG_DATA = "123456789\n" * 1024
diff --git a/test/csv/test_csv_writing.rb b/test/csv/test_csv_writing.rb
index 2c98abb1371..704c1d7ddc3 100755
--- a/test/csv/test_csv_writing.rb
+++ b/test/csv/test_csv_writing.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Writing < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def test_writing
[ ["\t", ["\t"]],
diff --git a/test/csv/test_data_converters.rb b/test/csv/test_data_converters.rb
index e878c283809..3351620e10a 100755
--- a/test/csv/test_data_converters.rb
+++ b/test/csv/test_data_converters.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::DataConverters < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/csv/test_encodings.rb b/test/csv/test_encodings.rb
index e125f3baade..0067d6f53fe 100755
--- a/test/csv/test_encodings.rb
+++ b/test/csv/test_encodings.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Encodings < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb
index 70ba39d0fe8..0da557e6e1b 100755
--- a/test/csv/test_features.rb
+++ b/test/csv/test_features.rb
@@ -12,7 +12,7 @@ require "zlib"
require_relative "base"
class TestCSV::Features < TestCSV
- include DifferentOFS
+ extend DifferentOFS
TEST_CASES = [ [%Q{a,b}, ["a", "b"]],
[%Q{a,"""b"""}, ["a", "\"b\""]],
diff --git a/test/csv/test_headers.rb b/test/csv/test_headers.rb
index 96ff485cad6..00ae82af06e 100755
--- a/test/csv/test_headers.rb
+++ b/test/csv/test_headers.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Headers < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb
index f939d9e1adf..8343146754e 100755
--- a/test/csv/test_interface.rb
+++ b/test/csv/test_interface.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Interface < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/csv/test_row.rb b/test/csv/test_row.rb
index 38383d5a00b..345b7a23424 100755
--- a/test/csv/test_row.rb
+++ b/test/csv/test_row.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Row < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/csv/test_serialization.rb b/test/csv/test_serialization.rb
index 9fafe02c59d..0adb972c2fd 100755
--- a/test/csv/test_serialization.rb
+++ b/test/csv/test_serialization.rb
@@ -25,7 +25,7 @@ class Hash
end
class TestCSV::Serialization < TestCSV
- include DifferentOFS
+ extend DifferentOFS
### Classes Used to Test Serialization ###
diff --git a/test/csv/test_table.rb b/test/csv/test_table.rb
index 731d5261906..d045b9afe4b 100755
--- a/test/csv/test_table.rb
+++ b/test/csv/test_table.rb
@@ -10,7 +10,7 @@
require_relative "base"
class TestCSV::Table < TestCSV
- include DifferentOFS
+ extend DifferentOFS
def setup
super
diff --git a/test/digest/test_digest_extend.rb b/test/digest/test_digest_extend.rb
index 08217202103..577fd7a455b 100644
--- a/test/digest/test_digest_extend.rb
+++ b/test/digest/test_digest_extend.rb
@@ -3,7 +3,7 @@ require 'digest'
require_relative '../with_different_ofs.rb'
class TestDigestExtend < Test::Unit::TestCase
- include DifferentOFS
+ extend DifferentOFS
class MyDigest < Digest::Class
def initialize(*arg)
diff --git a/test/with_different_ofs.rb b/test/with_different_ofs.rb
index 3192da9d1f1..76dfa6896ca 100644
--- a/test/with_different_ofs.rb
+++ b/test/with_different_ofs.rb
@@ -1,18 +1,16 @@
module DifferentOFS
- def setup
- super
- @ofs, $, = $,, "-"
- end
- def teardown
- $, = @ofs
- super
- end
-
module WithDifferentOFS
- def with_diffrent_ofs
+ def setup
+ super
+ @ofs, $, = $,, "-"
+ end
+ def teardown
+ $, = @ofs
+ super
end
end
- def self.included(klass)
+
+ def self.extended(klass)
super(klass)
klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name
end