Remove matcher definition.
There are now included in the the openstack/puppet-openstack_spec_helper code. Change-Id: I3e9f29cab124cc5719ab01d4e193ce9a9d4edb0f Depends-On: I2e1a561134db1427d9cb5fd9149ecedecffab404 Depends-On: I420ee94d207c04aade61c3cacc2e5ebdd226f817 Depends-On: I1d89f6a2127772cb2206721e99e9cfb405fad172
This commit is contained in:
@@ -1,3 +1 @@
|
||||
require 'puppet-openstack_spec_helper/beaker_spec_helper'
|
||||
|
||||
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
RSpec::Matchers.define :have_array_of_instances_hash do |expected|
|
||||
expected_array = expected.dup
|
||||
match do |actual|
|
||||
if actual.count != expected_array.count
|
||||
return false
|
||||
end
|
||||
actual_array = actual.map { |i| i.instance_variable_get('@property_hash') }
|
||||
expected_array.each do |e|
|
||||
actual_array.each do |a|
|
||||
if e == a
|
||||
actual_array.delete(a)
|
||||
end
|
||||
end
|
||||
end
|
||||
actual_array.empty?
|
||||
end
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
RSpec::Matchers.define :include_regexp do |expected|
|
||||
regexps = expected.dup
|
||||
regexps = [regexps] unless regexps.is_a?(Array)
|
||||
expected_count = regexps.count
|
||||
count = 0
|
||||
match do |actual|
|
||||
output = actual
|
||||
output = output.split("\n") unless output.is_a?(Array)
|
||||
output.each do |line|
|
||||
regexps.each_with_index do |regex, regexp_idx|
|
||||
if line.match(regex)
|
||||
count += 1
|
||||
regexps.delete_at(regexp_idx)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
expected_count == count
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user