diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 05:35:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-05 05:35:00 +0000 |
commit | 7e9e152526d3e5e2ee187d532f5e0ba9f4e63aa3 (patch) | |
tree | 06ba77d4ed155426b46ed6c9177159c1552ea3d9 /test/iconv/utils.rb | |
parent | 5d75d9bf3d3476a92d54d63b5080a59e615fdd9b (diff) | |
download | ruby-7e9e152526d3e5e2ee187d532f5e0ba9f4e63aa3.tar.gz |
* test/iconv/utils.rb (TestIconv.testcase): make test cases conditionally.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/iconv/utils.rb')
-rw-r--r-- | test/iconv/utils.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/iconv/utils.rb b/test/iconv/utils.rb index 032ac28ea4..99dce20837 100644 --- a/test/iconv/utils.rb +++ b/test/iconv/utils.rb @@ -5,7 +5,21 @@ else require 'test/unit' end -class TestIconv < Test::Unit::TestCase +module TestIconv + if defined?(::Iconv) + def self.testcase(name, &block) + const_set(name, klass = Class.new(::Test::Unit::TestCase)) + klass.name + klass.__send__(:include, self) + klass.class_eval(&block) + end + else + def self.testcase(name) + end + end +end + +module TestIconv if defined?(::Encoding) and String.method_defined?(:force_encoding) def self.encode(str, enc) str.force_encoding(enc) |