Class: TestBelt::Matchers::HaveFiles::Matcher

Inherits:
Base
  • Object
show all
Defined in:
lib/test_belt/matchers/have_files.rb

Instance Attribute Summary

Attributes inherited from Base

#args

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Matcher

Returns a new instance of Matcher.



20
21
22
# File 'lib/test_belt/matchers/have_files.rb', line 20

def initialize(file_path)
  @file_path = file_path
end

Instance Method Details

#descObject



24
25
26
# File 'lib/test_belt/matchers/have_files.rb', line 24

def desc
  "have the file path '#{@file_path}'"
end

#testObject



28
29
30
31
32
# File 'lib/test_belt/matchers/have_files.rb', line 28

def test
  using(@file_path) do |path|
    assert File.exists?(path), "'#{path}' does not exist"
  end
end