fakefs/test/verify.rb

36 lines
895 B
Ruby
Raw Normal View History

2009-07-16 20:18:43 +00:00
# Figure out what's missing from fakefs
#
# USAGE
#
2009-12-04 09:52:46 +00:00
# $ RUBYLIB=test ruby test/verify.rb | grep "not implemented"
require "test_helper"
2009-11-08 06:04:16 +00:00
2009-07-16 20:18:43 +00:00
class FakeFSVerifierTest < Test::Unit::TestCase
def setup
FakeFS.activate!
end
def teardown
FakeFS.deactivate!
end
2009-07-16 20:18:43 +00:00
(RealFile.methods - Class.new.methods).each do |name|
define_method("test #{name} class method") do
assert File.respond_to?(name), "File.#{name} not implemented"
end
end
2009-11-08 06:04:16 +00:00
2009-07-16 20:18:43 +00:00
(RealFile.instance_methods - Enumerable.instance_methods).each do |name|
define_method("test #{name} instance method") do
assert File.instance_methods.include?(name), "File##{name} not implemented"
end
end
2009-11-08 06:04:16 +00:00
2009-07-16 20:18:43 +00:00
(RealFileUtils.methods - Class.new.methods).each do |name|
define_method("test #{name} module method") do
assert FileUtils.respond_to?(name), "FileUtils.#{name} not implemented"
end
end
end