From d711edc5905dc240ccbc81c696b752aeb18e9fb3 Mon Sep 17 00:00:00 2001 From: Pat Nakajima Date: Thu, 16 Jul 2009 16:18:43 -0400 Subject: [PATCH] Added verify.rb to find gaps in FakeFS --- test/verify.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/verify.rb diff --git a/test/verify.rb b/test/verify.rb new file mode 100644 index 0000000..9fa1ff7 --- /dev/null +++ b/test/verify.rb @@ -0,0 +1,27 @@ +# Figure out what's missing from fakefs +# +# USAGE +# +# $ ruby test/verify.rb | grep "not implemented" +require 'fakefs' +require 'test/unit' + +class FakeFSVerifierTest < Test::Unit::TestCase + (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 + + (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 + + (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