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-4.5.4 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.5.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.5.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.5.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.5.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.4.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.4.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.4.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.3.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.3.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.3.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.2.4 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.2.3 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.2.2 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.2.1 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.2.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.1.0 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.0.9 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.0.8 lib/picky-client/spec/support/matchers/have_categories.rb
picky-client-4.0.7 lib/picky-client/spec/support/matchers/have_categories.rb