Sha256: 2d8a140e3a324abaab93d6c876572d4a0d90a4be6ccd7a770006b19bea30c7d0

Contents?: true

Size: 701 Bytes

Versions: 92

Compression:

Stored size: 701 Bytes

Contents

(defined?(RSpec) && RSpec || defined?(Spec) && Spec)::Matchers.define :have_categories do |*expected|

  match do |results|
    extract_categories(actual) == expected
  end

  failure_message_for_should do |results|
    "expected categories #{extract_categories(results)} to be named and ordered as #{expected}"
  end

  failure_message_for_should_not do |results|
    "expected categories #{extract_categories(results)} not to be named and ordered as #{expected}"
  end

  description do
    "be categories named and ordered as #{expected}"
  end

  def extract_categories results
    results.allocations.map do |allocation|
      allocation[3].map { |combination| combination[0] }
    end
  end

end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
picky-client-3.6.7 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.6 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.4 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.6.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.5.4 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.5.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.5.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.5.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.5.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.4.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.4.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.4.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.4.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.3.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.3.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.3.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-3.3.0 lib/picky-client/spec/support/matchers/have_categories.rb