Sha256: 083248d5193082e5879cd99fce0bcc484b6a8c9ecfdad251dc146abe35270279
Contents?: true
Size: 924 Bytes
Versions: 4
Compression:
Stored size: 924 Bytes
Contents
require 'rspec/expectations/version' # @!method be_an_existing_directory # This matchers checks if <directory> exists in filesystem # # @return [TrueClass, FalseClass] The result # # false: # * if directory does not exist # true: # * if directory exists # # @example Use matcher # # RSpec.describe do # it { expect(directory1).to be_an_existing_directory } # end RSpec::Matchers.define :be_an_existing_directory do |_| match do |actual| stop_processes! next false unless actual.is_a? String directory?(actual) end failure_message do |actual| format("expected that directory \"%s\" exists", actual) end failure_message_when_negated do |actual| format("expected that directory \"%s\" does not exist", actual) end end if RSpec::Expectations::Version::STRING >= '3.0' RSpec::Matchers.alias_matcher :an_existing_directory, :be_an_existing_directory end
Version data entries
4 entries across 4 versions & 1 rubygems