class SibaTest::FileMock

mocks all Siba::SibaFile methods

Public Class Methods

mock_all_methods() click to toggle source
# File lib/siba/helpers/test/file_mock.rb, line 22
def self.mock_all_methods
  Siba::FilePlug.siba_file = SibaTest::FileMock.new
end

Private Class Methods

method_defined?(method_name) click to toggle source
# File lib/siba/helpers/test/file_mock.rb, line 32
def self.method_defined?(method_name)
  file_class, method = Siba::SibaFile.get_file_class(method_name)
  return true if !file_class.nil? && file_class.respond_to?(method)
  Siba::SibaFile.instance_methods(false).include? method_name.to_sym
end

Public Instance Methods

file_expand_path(file_name) click to toggle source
# File lib/siba/helpers/test/file_mock.rb, line 26
def file_expand_path(file_name)
  file_name
end
method_missing(meth, *args, &block) click to toggle source
Calls superclass method
# File lib/siba/helpers/test/file_mock.rb, line 6
def method_missing(meth, *args, &block)
  if FileMock.method_defined? meth
    # do nothing
  else
    super
  end
end
respond_to?(meth) click to toggle source
Calls superclass method
# File lib/siba/helpers/test/file_mock.rb, line 14
def respond_to?(meth)
  if FileMock.method_defined? meth
    true
  else
    super
  end
end