Class: Spex::FileCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/spex/checks/file_check.rb

Instance Attribute Summary

Attributes inherited from Check

#options, #target

Instance Method Summary collapse

Methods inherited from Check

[], #active?, #after, as, #before, each, example, examples, #initialize, option, options, #prepare, registry, #to_s, #validate!

Constructor Details

This class inherits a constructor from Spex::Check

Instance Method Details

#kindObject



4
5
6
# File 'lib/spex/checks/file_check.rb', line 4

def kind
  options[:type] ? options[:type].to_sym : :any
end

#kind_nameObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/spex/checks/file_check.rb', line 8

def kind_name
  case kind
  when :file
    'a regular file'
  when :directory
    'a directory'
  else
    'a file'
  end
end