fakefs/test/verify.rb

32 lines
893 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
class_mapping = {
RealFile => FakeFS::File,
RealFile::Stat => FakeFS::File::Stat,
RealFileUtils => FakeFS::FileUtils,
RealDir => FakeFS::Dir,
RealFileTest => FakeFS::FileTest
}
class_mapping.each do |real_class, fake_class|
real_class.methods.each do |method|
define_method "test #{method} class method" do
assert fake_class.respond_to?(method), "#{fake_class}.#{method} not implemented"
end
2009-07-16 20:18:43 +00:00
end
2009-11-08 06:04:16 +00:00
real_class.instance_methods.each do |method|
define_method("test #{method} instance method") do
2011-06-25 17:39:18 +00:00
assert fake_class.instance_methods.include?(method), "#{fake_class}##{method} not implemented"
end
2009-07-16 20:18:43 +00:00
end
end
end