Class: RSpec::PathMatchers::Matchers::FileMatcher

Inherits:
Base
  • Object
show all
Defined in:
lib/rspec/path_matchers/matchers/file_matcher.rb

Overview

An RSpec matcher checks for the existence and properties of a file

Constant Summary collapse

OPTIONS =
[
  RSpec::PathMatchers::Options::Atime,
  RSpec::PathMatchers::Options::Birthtime,
  RSpec::PathMatchers::Options::Content,
  RSpec::PathMatchers::Options::Ctime,
  RSpec::PathMatchers::Options::Group,
  RSpec::PathMatchers::Options::JsonContent,
  RSpec::PathMatchers::Options::Mode,
  RSpec::PathMatchers::Options::Mtime,
  RSpec::PathMatchers::Options::Owner,
  RSpec::PathMatchers::Options::Size,
  RSpec::PathMatchers::Options::YamlContent
].freeze

Instance Attribute Summary

Attributes inherited from Base

#base_path, #entry_name, #failures, #matcher_name, #options, #path

Instance Method Summary collapse

Methods inherited from Base

#description, #does_not_match?, #failure_message, #failure_message_when_negated, #initialize, #matches?

Constructor Details

This class inherits a constructor from RSpec::PathMatchers::Matchers::Base

Instance Method Details

#correct_type?Boolean

Returns:

  • (Boolean)


29
# File 'lib/rspec/path_matchers/matchers/file_matcher.rb', line 29

def correct_type? = File.file?(path)

#entry_typeObject



25
# File 'lib/rspec/path_matchers/matchers/file_matcher.rb', line 25

def entry_type = :file

#option_definitionsObject



27
# File 'lib/rspec/path_matchers/matchers/file_matcher.rb', line 27

def option_definitions = OPTIONS