File: verify.rb

package info (click to toggle)
libfakefs-ruby 0.2.1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 260 kB
  • ctags: 444
  • sloc: ruby: 1,924; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 814 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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