A summary of data about the Ruby ecosystem.

https://github.com/rspec/rspec-collection_matchers

Collection cardinality matchers, extracted from rspec-expectations
https://github.com/rspec/rspec-collection_matchers

Keywords from Contributors

activerecord rspec activejob mvc rubygems crash-reporting rubocop ruby-gem sinatra rdoc

Last synced: about 20 hours ago
JSON representation

Repository metadata

Collection cardinality matchers, extracted from rspec-expectations

README.md

RSpec::CollectionMatchers Build Status

RSpec::CollectionMatchers lets you express expected outcomes on collections
of an object in an example.

expect(account.shopping_cart).to have_exactly(3).items

Install

Add this line to your application's Gemfile:

gem 'rspec-collection_matchers'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-collection_matchers

Basic usage

First of all, you need to require rspec-collection matchers. Add the following line to your spec_helper.rb:

require 'rspec/collection_matchers'

Using rspec-collection_matchers you can match the number of items in a
collection directly, e.g.:

it 'matches number of items in a collection' do
  expect([1,2,3]).to have_at_least(3).items
end

You can also match the number of items returned by a method on an object, e.g.:

class Cart
  def initialize(*products)
    @products = products
  end
  attr_reader :products
end

it 'matches number of items returned from a method' do
  cart = Cart.new('product a', 'product b')
  expect(cart).to have_at_most(2).products
end

The last line of the example expresses an expected outcome:
if cart.products.size <= 2 then the example passes, otherwise it fails with a message like:

expected at most 2 products, got 3

Available matchers

expect(collection).to have(n).items
expect(collection).to have_exactly(n).items
expect(collection).to have_at_most(n).items
expect(collection).to have_at_least(n).items
expect(collection).to have(:no).items

See also


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 120
Total Committers: 15
Avg Commits per committer: 8.0
Development Distribution Score (DDS): 0.583

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Jon Rowe h****o@j****k 50
Hugo Baraúna h****a@p****r 27
Myron Marston m****n@g****m 13
Bradley Schaefer b****r@g****m 12
Olle Jonsson o****n@g****m 3
Benoit Tigeot b****t@h****m 3
Johnson Denen j****n@m****m 3
Akira Matsuda r****e@d****p 2
Phil Pirozhkov h****o@f****u 1
Orien Madgwick _@o****o 1
Matt Whipple m****t@m****m 1
Kassio Borges k****m@g****m 1
Ilya Vassilevsky v****y@g****m 1
Claudio B c****b 1
Siva Gollapalli s****a@j****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 months ago

Total issues: 17
Total pull requests: 39
Average time to close issues: about 1 year
Average time to close pull requests: 8 months
Total issue authors: 14
Total pull request authors: 19
Average comments per issue: 4.76
Average comments per pull request: 2.41
Merged pull request: 33
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 43 minutes
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/rspec/rspec-collection_matchers

Top Issue Authors

  • myronmarston (4)
  • pvalena (1)
  • Charizard (1)
  • stamm (1)
  • ivanovaleksey (1)
  • amilligan (1)
  • JonRowe (1)
  • jaredbeck (1)
  • hugobarauna (1)
  • jscheid (1)
  • ain (1)
  • linkyndy (1)
  • palfvin (1)
  • KelvinMutuma (1)

Top Pull Request Authors

  • JonRowe (12)
  • myronmarston (5)
  • amatsuda (4)
  • olleolleolle (3)
  • benoittgt (2)
  • hugobarauna (2)
  • krissi (1)
  • vassilevsky (1)
  • mwhipple (1)
  • orien (1)
  • claudiob (1)
  • sivagollapalli (1)
  • kassio (1)
  • jdenen (1)
  • soulcutter (1)

Top Issue Labels

  • duplicate (1)

Top Pull Request Labels


Package metadata

gem.coop: rspec-collection_matchers

Collection cardinality matchers, extracted from rspec-expectations

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Documentation: http://www.rubydoc.info/gems/rspec-collection_matchers/
  • Licenses: MIT
  • Latest release: 1.2.1 (published over 2 years ago)
  • Last Synced: 2026-03-02T04:32:57.699Z (1 day ago)
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 48,520,529 Total
  • Docker Downloads: 9,236,989
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.408%
    • Downloads: 0.534%
    • Docker downloads count: 1.096%
  • Maintainers (1)
rubygems.org: rspec-collection_matchers

Collection cardinality matchers, extracted from rspec-expectations

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Documentation: http://www.rubydoc.info/gems/rspec-collection_matchers/
  • Licenses: MIT
  • Latest release: 1.2.1 (published over 2 years ago)
  • Last Synced: 2026-03-02T06:07:00.181Z (1 day ago)
  • Versions: 12
  • Dependent Packages: 368
  • Dependent Repositories: 5,129
  • Downloads: 48,523,005 Total
  • Docker Downloads: 9,236,989
  • Rankings:
    • Dependent packages count: 0.122%
    • Dependent repos count: 0.442%
    • Downloads: 0.525%
    • Docker downloads count: 1.225%
    • Average: 1.979%
    • Stargazers count: 4.061%
    • Forks count: 5.498%
  • Maintainers (1)
proxy.golang.org: github.com/rspec/rspec-collection_matchers

ubuntu-24.04: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 25 days ago)
  • Last Synced: 2026-02-06T15:59:00.524Z (25 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
ubuntu-23.04: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses: mit
  • Latest release: 1.2.0-2 (published 20 days ago)
  • Last Synced: 2026-02-11T06:48:48.240Z (20 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-20.04: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 18 days ago)
  • Last Synced: 2026-02-13T07:22:03.814Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 18 days ago)
  • Last Synced: 2026-02-13T18:31:44.383Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 22 days ago)
  • Last Synced: 2026-02-09T17:13:35.829Z (22 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-11: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Documentation: https://packages.debian.org/bullseye/ruby-rspec-collection-matchers
  • Licenses: mit
  • Latest release: 1.2.0-2 (published 21 days ago)
  • Last Synced: 2026-02-13T08:24:29.599Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-10: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Documentation: https://packages.debian.org/buster/ruby-rspec-collection-matchers
  • Licenses:
  • Latest release: 1.1.2-1 (published 20 days ago)
  • Last Synced: 2026-02-13T04:25:29.787Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-22.04: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 18 days ago)
  • Last Synced: 2026-02-13T13:24:50.805Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-rspec-collection-matchers

debian-13: ruby-rspec-collection-matchers

  • Homepage: https://github.com/rspec/rspec-collection_matchers
  • Documentation: https://packages.debian.org/trixie/ruby-rspec-collection-matchers
  • Licenses:
  • Latest release: 1.2.0-2 (published 19 days ago)
  • Last Synced: 2026-02-13T13:19:13.938Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

Gemfile rubygems
  • aruba >= 0
  • contracts = 0.15.0
  • cucumber ~> 1.3.20
  • cucumber >= 0
  • i18n < 0.7.0
  • json > 2.3.0
  • json < 2
  • rake ~> 12.3.2
  • rake ~> 10.0.0
  • rake ~> 11.0.0
  • rake ~> 13.0.0
  • term-ansicolor < 1.4.0
  • tins ~> 1.6.0
rspec-collection_matchers.gemspec rubygems
  • activemodel >= 3.0 development
  • bundler >= 1.3 development
  • rspec-expectations >= 2.99.0.beta1
.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite

Score: 26.53572324112744