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"
|
|
|
|
|
2009-12-02 07:52:37 +00:00
|
|
|
require "test_helper"
|
2009-11-08 06:04:16 +00:00
|
|
|
|
2009-07-16 20:18:43 +00:00
|
|
|
class FakeFSVerifierTest < Test::Unit::TestCase
|
2009-12-04 10:02:48 +00:00
|
|
|
class_mapping = {
|
|
|
|
RealFile => FakeFS::File,
|
|
|
|
RealFile::Stat => FakeFS::File::Stat,
|
|
|
|
RealFileUtils => FakeFS::FileUtils,
|
|
|
|
RealDir => FakeFS::Dir,
|
|
|
|
RealFileTest => FakeFS::FileTest
|
|
|
|
}
|
2009-12-04 09:54:09 +00:00
|
|
|
|
2009-12-04 10:02:48 +00:00
|
|
|
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
|
|
|
|
2009-12-04 10:02:48 +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"
|
2009-12-04 10:02:48 +00:00
|
|
|
end
|
2009-07-16 20:18:43 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|