2005-09-24 03:30:09 +04:00
|
|
|
# $Id$
|
2003-09-17 13:52:50 +04:00
|
|
|
|
|
|
|
require 'fileutils'
|
2003-11-25 12:13:58 +03:00
|
|
|
require 'test/unit'
|
2011-02-04 21:37:52 +03:00
|
|
|
require_relative 'clobber'
|
2003-09-17 13:52:50 +04:00
|
|
|
|
2005-09-24 03:30:09 +04:00
|
|
|
class TestFileUtilsNoWrite < Test::Unit::TestCase
|
2003-09-17 13:52:50 +04:00
|
|
|
|
|
|
|
include FileUtils::NoWrite
|
2011-02-04 21:37:52 +03:00
|
|
|
include TestFileUtils::Clobber
|
2003-09-17 13:52:50 +04:00
|
|
|
|
2012-02-17 21:59:47 +04:00
|
|
|
FileUtils::METHODS.each do |m|
|
|
|
|
define_method "test_singleton_visibility_#{m}" do
|
2005-09-24 03:30:09 +04:00
|
|
|
assert_equal true, FileUtils::NoWrite.respond_to?(m, true),
|
|
|
|
"FileUtils::NoWrite.#{m} is not defined"
|
|
|
|
assert_equal true, FileUtils::NoWrite.respond_to?(m, false),
|
|
|
|
"FileUtils::NoWrite.#{m} is not public"
|
|
|
|
end
|
2012-02-17 21:59:47 +04:00
|
|
|
|
|
|
|
define_method "test_instance_visibility_#{m}" do
|
2005-09-24 03:30:09 +04:00
|
|
|
assert_equal true, respond_to?(m, true),
|
|
|
|
"FileUtils::NoWrite\##{m} is not defined"
|
|
|
|
assert_equal true, FileUtils::NoWrite.private_method_defined?(m),
|
|
|
|
"FileUtils::NoWrite\##{m} is not private"
|
|
|
|
end
|
|
|
|
end
|
2012-02-17 21:59:47 +04:00
|
|
|
|
2003-09-17 13:52:50 +04:00
|
|
|
end
|