Sha256: 6ad9d929d595f267efc922b26594f4b8e6aefc9e10055ab82e844bb06dc5af0d

Contents?: true

Size: 437 Bytes

Versions: 597

Compression:

Stored size: 437 Bytes

Contents

RSpec::Matchers.define :include_in_order do |*expected|

  match do |actual|
    elements = expected.dup
    actual.each do |elt|
      if elt == elements.first
        elements.shift
      end
    end
    elements.empty?
  end

  def failure_message
    "expected #{@actual.inspect} to include#{expected} in order"
  end

  def failure_message_when_negated
    "expected #{@actual.inspect} not to include#{expected} in order"
  end
end

Version data entries

597 entries across 597 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/lib/matchers/include_in_order.rb
puppet-8.3.0-x86-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.3.0-x64-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.3.0-universal-darwin spec/lib/matchers/include_in_order.rb
puppet-8.4.0 spec/lib/matchers/include_in_order.rb
puppet-8.4.0-x86-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.4.0-x64-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.4.0-universal-darwin spec/lib/matchers/include_in_order.rb
puppet-7.28.0 spec/lib/matchers/include_in_order.rb
puppet-7.28.0-x86-mingw32 spec/lib/matchers/include_in_order.rb
puppet-7.28.0-x64-mingw32 spec/lib/matchers/include_in_order.rb
puppet-7.28.0-universal-darwin spec/lib/matchers/include_in_order.rb
puppet-8.3.1 spec/lib/matchers/include_in_order.rb
puppet-8.3.1-x86-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.3.1-x64-mingw32 spec/lib/matchers/include_in_order.rb
puppet-8.3.1-universal-darwin spec/lib/matchers/include_in_order.rb
puppet-7.27.0 spec/lib/matchers/include_in_order.rb
puppet-7.27.0-x86-mingw32 spec/lib/matchers/include_in_order.rb
puppet-7.27.0-x64-mingw32 spec/lib/matchers/include_in_order.rb
puppet-7.27.0-universal-darwin spec/lib/matchers/include_in_order.rb