mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/fileutils.rb: Revert r34669 which altered the way
metaprogramming in FileUtils occurred. [ruby-trunk - Bug #7958] * test/fileutils/visibility_tests.rb: Refactored tests of FileUtils options modules to expose bug found in #7958 * test/fileutils/test_dryrun.rb: ditto. * test/fileutils/test_nowrite.rb: ditto. * test/fileutils/test_verbose.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6213b8370c
commit
874f8c0494
6 changed files with 251 additions and 226 deletions
|
|
@ -2,27 +2,16 @@
|
|||
|
||||
require 'fileutils'
|
||||
require 'test/unit'
|
||||
require_relative 'clobber'
|
||||
require_relative 'visibility_tests'
|
||||
|
||||
class TestFileUtilsNoWrite < Test::Unit::TestCase
|
||||
|
||||
include FileUtils::NoWrite
|
||||
include TestFileUtils::Clobber
|
||||
include TestFileUtils::Visibility
|
||||
|
||||
FileUtils::METHODS.each do |m|
|
||||
define_method "test_singleton_visibility_#{m}" do
|
||||
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
|
||||
|
||||
define_method "test_instance_visibility_#{m}" do
|
||||
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
|
||||
def setup
|
||||
super
|
||||
@fu_module = FileUtils::NoWrite
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue