2005-09-23 19:30:09 -04:00
|
|
|
# $Id$
|
2003-09-17 05:52:50 -04:00
|
|
|
|
|
|
|
require 'fileutils'
|
2003-11-25 04:13:58 -05:00
|
|
|
require 'test/unit'
|
2011-02-04 13:37:52 -05:00
|
|
|
require_relative 'clobber'
|
2003-09-17 05:52:50 -04:00
|
|
|
|
2005-09-23 19:30:09 -04:00
|
|
|
class TestFileUtilsNoWrite < Test::Unit::TestCase
|
2003-09-17 05:52:50 -04:00
|
|
|
|
|
|
|
include FileUtils::NoWrite
|
2011-02-04 13:37:52 -05:00
|
|
|
include TestFileUtils::Clobber
|
2003-09-17 05:52:50 -04:00
|
|
|
|
2012-02-17 12:59:47 -05:00
|
|
|
FileUtils::METHODS.each do |m|
|
|
|
|
define_method "test_singleton_visibility_#{m}" do
|
2005-09-23 19: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 12:59:47 -05:00
|
|
|
|
|
|
|
define_method "test_instance_visibility_#{m}" do
|
2005-09-23 19: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 12:59:47 -05:00
|
|
|
|
2003-09-17 05:52:50 -04:00
|
|
|
end
|