diff options
Diffstat (limited to 'jni/ruby/test/fileutils/visibility_tests.rb')
-rw-r--r-- | jni/ruby/test/fileutils/visibility_tests.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/jni/ruby/test/fileutils/visibility_tests.rb b/jni/ruby/test/fileutils/visibility_tests.rb new file mode 100644 index 0000000..a140614 --- /dev/null +++ b/jni/ruby/test/fileutils/visibility_tests.rb @@ -0,0 +1,41 @@ +require 'test/unit' +require 'fileutils' + +class TestFileUtils < Test::Unit::TestCase +end + +## +# These tests are reused in the FileUtils::Verbose, FileUtils::NoWrite and +# FileUtils::DryRun tests + +module TestFileUtils::Visibility + + 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 |