Sha256: afcde512c8eeb3ba30af737a198eb216db88a8a280137bf1d3e8b7e710e894d4

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

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

require 'test_helper'

# FakeFs verifier test class
class FakeFSVerifierTest < Minitest::Test
  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}##{method} not implemented"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fakefs-0.7.0 test/verify.rb
fakefs-0.6.7 test/verify.rb