Skip to content

Commit 5c5e09e

Browse files
committed
(PUP-10942) Use rspec's contain_exactly matcher
Our `include_in_any_order` matcher predates `contain_exactly`.
1 parent b9ea3c5 commit 5c5e09e

File tree

4 files changed

+4
-69
lines changed

4 files changed

+4
-69
lines changed

spec/integration/indirector/direct_file_server_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'spec_helper'
2-
require 'matchers/include'
32

43
require 'puppet/indirector/file_content/file'
54
require 'puppet/indirector/file_metadata/file'
@@ -30,7 +29,6 @@
3029

3130
describe Puppet::Indirector::DirectFileServer, " when interacting with FileServing::Fileset and the model" do
3231
include PuppetSpec::Files
33-
include Matchers::Include
3432

3533
matcher :file_with_content do |name, content|
3634
match do |actual|
@@ -52,7 +50,7 @@
5250
terminus = Puppet::Indirector::FileContent::File.new
5351
request = terminus.indirection.request(:search, Puppet::Util.path_to_uri(path).to_s, nil, :recurse => true)
5452

55-
expect(terminus.search(request)).to include_in_any_order(
53+
expect(terminus.search(request)).to contain_exactly(
5654
file_with_content(File.join(path, "one"), "one content"),
5755
file_with_content(File.join(path, "two"), "two content"),
5856
directory_named(path))

spec/lib/matchers/include.rb

Lines changed: 0 additions & 27 deletions
This file was deleted.

spec/lib/matchers/include_spec.rb

Lines changed: 0 additions & 32 deletions
This file was deleted.

spec/unit/environments_spec.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
require 'spec_helper'
22
require 'puppet/environments'
33
require 'puppet/file_system'
4-
require 'matchers/include'
5-
require 'matchers/include_in_order'
64

75
module PuppetEnvironments
86
describe Puppet::Environments do
9-
include Matchers::Include
10-
117
FS = Puppet::FileSystem
128

139
before(:each) do
@@ -49,7 +45,7 @@ module PuppetEnvironments
4945
loader_from(:filesystem => [directory_tree, global_path_1, global_path_2],
5046
:directory => directory_tree.children.first,
5147
:modulepath => [global_path_1_location, global_path_2_location]) do |loader|
52-
expect(loader.list).to include_in_any_order(
48+
expect(loader.list).to contain_exactly(
5349
environment(:an_environment).
5450
with_manifest("#{FS.path_string(directory_tree)}/envdir/an_environment/manifests").
5551
with_modulepath(["#{FS.path_string(directory_tree)}/envdir/an_environment/modules",
@@ -87,7 +83,7 @@ module PuppetEnvironments
8783

8884
loader_from(:filesystem => [envdir],
8985
:directory => envdir) do |loader|
90-
expect(loader.list).to include_in_any_order(environment(:env1), environment(:env2))
86+
expect(loader.list).to contain_exactly(environment(:env1), environment(:env2))
9187
end
9288
end
9389

@@ -559,7 +555,7 @@ module PuppetEnvironments
559555
describe "cached loaders" do
560556
it "lists environments" do
561557
loader_from(:filesystem => [directory_tree], :directory => directory_tree.children.first) do |loader|
562-
expect(Puppet::Environments::Cached.new(loader).list).to include_in_any_order(
558+
expect(Puppet::Environments::Cached.new(loader).list).to contain_exactly(
563559
environment(:an_environment),
564560
environment(:another_environment),
565561
environment(:symlinked_environment))

0 commit comments

Comments
 (0)