Sha256: dbd043d84f5352531133ab5b93e21c7aa47fdaf8dfd4343be913f0f1fa7216e8
Contents?: true
Size: 1 KB
Versions: 3
Compression:
Stored size: 1 KB
Contents
module AktionTest module Matchers module FileSystem module FileExistance def be_a_file Matcher.new end class Matcher < Matchers::Base def initialize super end protected def perform_match! file_exists? and file_is_not_a_directory? end def expectation "#{@subject} to be a file." end def problems_for_should if File.exists?(@subject) if File.directory?(@subject) "#{@subject} is a directory." else "Unknown" end else "#{@subject} does not exist." end end def problems_for_should_not end def file_exists? File.exists? @subject end def file_is_not_a_directory? !File.directory? @subject end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems