Sha256: d93f6c27429c5250fde262cad50b96e80aa4ddb47b15be4d6a444a66d80d1ed5
Contents?: true
Size: 892 Bytes
Versions: 22
Compression:
Stored size: 892 Bytes
Contents
require 'rspec/expectations' require "fileutils" require_relative "../lib/deplomat" RSpec::Matchers.define :have_files do |*expected| match do |actual| actual = actual.split("\n") actual.pop if actual.last == "" expected.each do |e| return false unless actual.include?(e) end true end failure_message do |actual| "expected these files in the directory:\n\t#{actual.split("\n").inspect}\nwould include all of these:\n\t#{expected.inspect}" end end RSpec::Matchers.define :not_have_files do |*expected| match do |actual| actual = actual.split("\n") actual.pop if actual.last == "" expected.each do |e| return false if actual.include?(e) end true end failure_message do |actual| "expected these files in the directory:\n\t#{actual.split("\n").inspect}\nwould NOT include any of these:\n\t#{expected.inspect}" end end
Version data entries
22 entries across 22 versions & 1 rubygems