Sha256: b32afab821b60efb0d12792a9c13ee11b9a2f5acc9e27f81c9023ff4f5ee4c14

Contents?: true

Size: 891 Bytes

Versions: 5

Compression:

Stored size: 891 Bytes

Contents

# Figure out what's missing from fakefs
#
# USAGE
#
#   $ RUBYLIB=test ruby test/verify.rb | grep "not implemented"

require "test_helper"

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
    end

    real_class.instance_methods.each do |method|
      define_method("test #{method} instance method") do
        assert fake_class.instance_methods.include?(method), "#{fake_class}##{name} not implemented"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
fakefs-0.3.2 test/verify.rb
mnoble-fakefs-0.3.2 test/verify.rb
mnoble-fakefs-0.3.1 test/verify.rb
fakefs-0.3.1 test/verify.rb
ktheory-fakefs-0.2.1.1 test/verify.rb