Sha256: 880c74b15bf671910c4e6762b5d642e4ea6ac02d7fe8bd75090128a82646aafb

Contents?: true

Size: 927 Bytes

Versions: 515

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'
require 'matchers/include'

describe "include matchers" do
  include Matchers::Include

  context :include_in_any_order do
    it "matches an empty list" do
      expect([]).to include_in_any_order()
    end

    it "matches a list with a single element" do
      expect([1]).to include_in_any_order(eq(1))
    end

    it "does not match when an expected element is missing" do
      expect([1]).to_not include_in_any_order(eq(2))
    end

    it "matches a list with 2 elements in a different order from the expectation" do
      expect([1, 2]).to include_in_any_order(eq(2), eq(1))
    end

    it "does not match when there are more than just the expected elements" do
      expect([1, 2]).to_not include_in_any_order(eq(1))
    end

    it "matches multiple, equal elements when there are multiple, equal exepectations" do
      expect([1, 1]).to include_in_any_order(eq(1), eq(1))
    end
  end
end

Version data entries

515 entries across 515 versions & 1 rubygems

Version Path
puppet-7.4.1 spec/lib/matchers/include_spec.rb
puppet-7.4.1-x86-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.4.1-x64-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.4.1-universal-darwin spec/lib/matchers/include_spec.rb
puppet-6.21.1 spec/lib/matchers/include_spec.rb
puppet-6.21.1-x86-mingw32 spec/lib/matchers/include_spec.rb
puppet-6.21.1-x64-mingw32 spec/lib/matchers/include_spec.rb
puppet-6.21.1-universal-darwin spec/lib/matchers/include_spec.rb
puppet-7.4.0 spec/lib/matchers/include_spec.rb
puppet-7.4.0-x86-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.4.0-x64-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.4.0-universal-darwin spec/lib/matchers/include_spec.rb
puppet-6.21.0 spec/lib/matchers/include_spec.rb
puppet-6.21.0-x86-mingw32 spec/lib/matchers/include_spec.rb
puppet-6.21.0-x64-mingw32 spec/lib/matchers/include_spec.rb
puppet-6.21.0-universal-darwin spec/lib/matchers/include_spec.rb
puppet-7.3.0 spec/lib/matchers/include_spec.rb
puppet-7.3.0-x86-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.3.0-x64-mingw32 spec/lib/matchers/include_spec.rb
puppet-7.3.0-universal-darwin spec/lib/matchers/include_spec.rb