Sha256: 0e5508d9c324d16b69ae257d431fafc7517d3c312ac00473c6370f231fa9fd36

Contents?: true

Size: 1017 Bytes

Versions: 25

Compression:

Stored size: 1017 Bytes

Contents

module FakeFS
  # FileTest
  module FileTest
    extend self

    def directory?(file_name)
      File.directory?(file_name)
    end

    def executable?(file_name)
      File.executable?(file_name)
    end

    def exist?(file_name)
      File.exist?(file_name)
    end

    def file?(file_name)
      File.file?(file_name)
    end

    def size?(file_name)
      File.size?(file_name)
    end

    def readable?(file_name)
      File.readable?(file_name)
    end

    def sticky?(file_name)
      File.sticky?(file_name)
    end

    def symlink?(file_name)
      File.symlink?(file_name)
    end

    def world_readable?(file_name)
      File.new(file_name).stat.world_readable?
    end

    def world_writable?(file_name)
      File.new(file_name).stat.world_writable?
    end

    def writable?(file_name)
      File.writable?(file_name)
    end

    def zero?(file_name)
      File.zero?(file_name)
    end

    if RUBY_VERSION > '2.4'
      class << self
        alias empty? zero?
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
fakefs-2.5.0 lib/fakefs/file_test.rb
fakefs-2.4.0 lib/fakefs/file_test.rb
fakefs-2.3.0 lib/fakefs/file_test.rb
fakefs-2.2.0 lib/fakefs/file_test.rb
fakefs-2.1.0 lib/fakefs/file_test.rb
fakefs-2.0.0 lib/fakefs/file_test.rb
fakefs-1.9.0 lib/fakefs/file_test.rb
fakefs-1.8.0 lib/fakefs/file_test.rb
fakefs-1.7.0 lib/fakefs/file_test.rb
fakefs-1.6.0 lib/fakefs/file_test.rb
fakefs-1.5.1 lib/fakefs/file_test.rb
fakefs-1.5.0 lib/fakefs/file_test.rb
fakefs-1.4.1 lib/fakefs/file_test.rb
fakefs-1.4.0 lib/fakefs/file_test.rb
fakefs-1.3.2 lib/fakefs/file_test.rb
fakefs-1.3.1 lib/fakefs/file_test.rb
fakefs-1.3.0 lib/fakefs/file_test.rb
fakefs-1.2.3 lib/fakefs/file_test.rb
fakefs-1.2.2 lib/fakefs/file_test.rb
fakefs-1.2.1 lib/fakefs/file_test.rb