Module: FakeFS::FileTest

Extended by:
FileTest
Included in:
FileTest
Defined in:
lib/fakefs/file_test.rb

Overview

FileTest

Instance Method Summary collapse

Instance Method Details

#directory?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/fakefs/file_test.rb', line 6

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

#executable?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/fakefs/file_test.rb', line 10

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

#exist?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fakefs/file_test.rb', line 14

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

#file?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/fakefs/file_test.rb', line 18

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

#readable?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/fakefs/file_test.rb', line 26

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

#size?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/fakefs/file_test.rb', line 22

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

#sticky?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/fakefs/file_test.rb', line 30

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

#symlink?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/fakefs/file_test.rb', line 34

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

#world_readable?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/fakefs/file_test.rb', line 38

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

#world_writable?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/fakefs/file_test.rb', line 42

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

#writable?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/fakefs/file_test.rb', line 46

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

#zero?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/fakefs/file_test.rb', line 50

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