2017-01-06 21:14:07 -05:00
|
|
|
# frozen_string_literal: true
|
2013-02-28 21:09:42 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'fileutils'
|
|
|
|
|
2018-03-13 02:29:02 -04:00
|
|
|
class TestFileUtilsInc < Test::Unit::TestCase
|
2013-02-28 21:09:42 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
##
|
|
|
|
# These tests are reused in the FileUtils::Verbose, FileUtils::NoWrite and
|
|
|
|
# FileUtils::DryRun tests
|
|
|
|
|
2018-03-13 02:29:02 -04:00
|
|
|
module TestFileUtilsInc::Visibility
|
2013-02-28 21:09:42 -05:00
|
|
|
|
|
|
|
FileUtils::METHODS.each do |m|
|
|
|
|
define_method "test_singleton_visibility_#{m}" do
|
|
|
|
assert @fu_module.respond_to?(m, true),
|
|
|
|
"FileUtils::Verbose.#{m} is not defined"
|
|
|
|
assert @fu_module.respond_to?(m, false),
|
|
|
|
"FileUtils::Verbose.#{m} is not public"
|
|
|
|
end
|
|
|
|
|
|
|
|
define_method "test_visibility_#{m}" do
|
|
|
|
assert respond_to?(m, true),
|
|
|
|
"FileUtils::Verbose\##{m} is not defined"
|
|
|
|
assert @fu_module.private_method_defined?(m),
|
|
|
|
"FileUtils::Verbose\##{m} is not private"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
FileUtils::StreamUtils_.private_instance_methods.each do |m|
|
|
|
|
define_method "test_singleton_visibility_#{m}" do
|
|
|
|
assert @fu_module.respond_to?(m, true),
|
|
|
|
"FileUtils::Verbose\##{m} is not defined"
|
|
|
|
end
|
|
|
|
|
|
|
|
define_method "test_visibility_#{m}" do
|
|
|
|
assert respond_to?(m, true),
|
|
|
|
"FileUtils::Verbose\##{m} is not defined"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|