Class: Spex::RemovedCheck

Inherits:
FileCheck show all
Defined in:
lib/spex/checks/removed_check.rb

Instance Attribute Summary

Attributes inherited from Check

#options, #target

Instance Method Summary collapse

Methods inherited from FileCheck

#kind, #kind_name

Methods inherited from Check

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

Constructor Details

This class inherits a constructor from Spex::Check

Instance Method Details

#afterObject



17
18
19
20
21
22
23
# File 'lib/spex/checks/removed_check.rb', line 17

def after
  if active?
    assert !File.exist?(target), "File still exists at #{target}"
  else
    assert File.exist?(target), "File was removed from #{target}"        
  end
end

#beforeObject



10
11
12
13
14
15
# File 'lib/spex/checks/removed_check.rb', line 10

def before
  if active?
    assert File.exist?(target), "File does not exist at #{target}"
    check_type
  end
end