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

Version Path
deplomat-0.2.12 spec/spec_helper.rb
deplomat-0.2.11 spec/spec_helper.rb
deplomat-0.2.10 spec/spec_helper.rb
deplomat-0.2.9 spec/spec_helper.rb
deplomat-0.2.8 spec/spec_helper.rb
deplomat-0.2.7 spec/spec_helper.rb
deplomat-0.2.6 spec/spec_helper.rb
deplomat-0.2.5 spec/spec_helper.rb
deplomat-0.2.4 spec/spec_helper.rb
deplomat-0.2.3 spec/spec_helper.rb
deplomat-0.2.2 spec/spec_helper.rb
deplomat-0.2.1 spec/spec_helper.rb
deplomat-0.2.0 spec/spec_helper.rb
deplomat-0.1.13 spec/spec_helper.rb
deplomat-0.1.12 spec/spec_helper.rb
deplomat-0.1.11 spec/spec_helper.rb
deplomat-0.1.10 spec/spec_helper.rb
deplomat-0.1.8 spec/spec_helper.rb
deplomat-0.1.7 spec/spec_helper.rb
deplomat-0.1.6 spec/spec_helper.rb