Mock Version: 2.15 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1639238015.627711/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=FalseprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'a124e216fa2b4358acd59b8778f01f7d', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1639238015.627711/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1626998400 Wrote: /builddir/build/SRPMS/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1639238015.627711/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=FalseprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'a90f0e5add504d00b622c19f5bb51453', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1639238015.627711/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.4tj9mluo:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1626998400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Qrzwlx + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf rspec-collection_matchers-1.2.0 + /usr/bin/gem unpack /builddir/build/SOURCES/rspec-collection_matchers-1.2.0.gem Unpacked gem: '/builddir/build/BUILD/rspec-collection_matchers-1.2.0' + /usr/bin/gem spec /builddir/build/SOURCES/rspec-collection_matchers-1.2.0.gem --ruby + STATUS=0 + '[' 0 -ne 0 ']' + cd rspec-collection_matchers-1.2.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.1wICiY + umask 022 + cd /builddir/build/BUILD + cd rspec-collection_matchers-1.2.0 + gem build ../rspec-collection_matchers-1.2.0.gemspec WARNING: prerelease dependency on rspec-expectations (>= 2.99.0.beta1) is not recommended WARNING: open-ended dependency on bundler (>= 1.3, development) is not recommended if bundler is semantically versioned, use: add_development_dependency 'bundler', '~> 1.3' WARNING: open-ended dependency on activemodel (>= 3.0, development) is not recommended if activemodel is semantically versioned, use: add_development_dependency 'activemodel', '~> 3.0' WARNING: See https://guides.rubygems.org/specification-reference/ for help Successfully built RubyGem Name: rspec-collection_matchers Version: 1.2.0 File: rspec-collection_matchers-1.2.0.gem + mkdir -p ./usr/share/gems + CONFIGURE_ARGS='--with-cflags='\''-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'\'' --with-cxxflags='\''-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'\'' --with-ldflags='\''-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '\'' ' + gem install -V --local --build-root . --force --document=ri,rdoc rspec-collection_matchers-1.2.0.gem WARNING: You build with buildroot. Build root: /builddir/build/BUILD/rspec-collection_matchers-1.2.0 Bin dir: /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/bin Gem home: /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems Plugins dir: /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/plugins /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/.gitignore /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/.rspec /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/.travis.yml /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/Changelog.md /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/Gemfile /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/LICENSE.txt /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/README.md /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/Rakefile /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/features/have.feature /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/features/support/env.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib/rspec/collection_matchers.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib/rspec/collection_matchers/have.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib/rspec/collection_matchers/matchers.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib/rspec/collection_matchers/rails_extensions.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib/rspec/collection_matchers/version.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/rspec-collection_matchers.gemspec /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/script/test_all /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/rspec/collection_matchers/have_spec.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/rspec/collection_matchers/rails_extensions_spec.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/spec_helper.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/support/classes.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/support/matchers.rb /builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/spec/support/shared_examples.rb Successfully installed rspec-collection_matchers-1.2.0 Parsing documentation for rspec-collection_matchers-1.2.0 Parsing sources... 20% [ 1/ 5] lib/rspec/collection_matchers.rb 40% [ 2/ 5] lib/rspec/collection_matchers/have.rb 60% [ 3/ 5] lib/rspec/collection_matchers/matchers.rb 80% [ 4/ 5] lib/rspec/collection_matchers/rails_extensions.rb 100% [ 5/ 5] lib/rspec/collection_matchers/version.rb Installing ri documentation for rspec-collection_matchers-1.2.0 Installing darkfish documentation for rspec-collection_matchers-1.2.0 Done installing documentation for rspec-collection_matchers after 0 seconds 1 gem installed + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.dvpJN5 + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 ++ dirname /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 + cd rspec-collection_matchers-1.2.0 + mkdir -p /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64/usr/share/gems + cp -a ./usr/share/gems/build_info ./usr/share/gems/cache ./usr/share/gems/doc ./usr/share/gems/extensions ./usr/share/gems/gems ./usr/share/gems/plugins ./usr/share/gems/specifications /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64/usr/share/gems/ + /usr/bin/find-debuginfo -j2 --strict-build-id -m -i --build-id-seed 1.2.0-3.1.fc36 --unique-debug-suffix -1.2.0-3.1.fc36.x86_64 --unique-debug-src-base rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/rspec-collection_matchers-1.2.0 + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs mangling shebang in /usr/share/gems/gems/rspec-collection_matchers-1.2.0/script/test_all from /bin/bash to #!/usr/bin/bash + /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.JJVHis + umask 022 + cd /builddir/build/BUILD + cd rspec-collection_matchers-1.2.0 + pushd ./usr/share/gems/gems/rspec-collection_matchers-1.2.0 ~/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0 ~/build/BUILD/rspec-collection_matchers-1.2.0 + rspec spec Run options: include {:focus=>true} All examples were filtered out; ignoring {:focus=>true} Randomized with seed 2983 have matcher RSpec::CollectionMatchers::Have for a collection owner that implements #send blows up when the owner doesn't respond to that method works when doing automatic pluralization works when #send is defined directly on an array works in the straightforward case expect(...).to have(n).items where result responds to items but returns something other than a collection provides a meaningful error provides a meaningful error expect(...).to have(1).item when ActiveSupport::Inflector is defined pluralizes the collection name when ActiveSupport::Inflector is partially loaded without its inflectors does not pluralize the collection name RSpec::CollectionMatchers::Have for an Enumerator whose size is nil but count is supplied works fine have(n).items where target IS a collection fails when the number of items IN the collection is not as expected references the number of items IN the collection description generation the have matcher generates its own description the have_at_least matcher generates its own description the have_at_most matcher generates its own description expect(...).to have(1).item when Inflector is defined pluralizes the collection name expect(...).to have_at_least(n).items passes if target has a collection of items with n members fails if target has a collection of items with < n members passes if target has a collection of items with > n members provides educational negative failure messages RSpec::CollectionMatchers::Have has method_missing as private does not respond_to? method_missing (because it's private) respond_to? is true for a method which Have defines is false if the owner doesn't respond to the method is false for a method which neither Object nor nor Have defines is true for a method that it's superclass (Object) defines is true if the owner responds to the method expect(...).to have(n).items converts :no to 0 passes if target has a collection of items with n members fails if target has a collection of items with < n members converts a String argument to Integer fails if target has a collection of items with > n members behaves like an RSpec matcher does not match an invalid value when using #== so it can be composed matches a valid value when using #== so it can be composed expectations compounded with RSpec::Matchers::Composable using the have matcher as an argument of another matcher has an alias for the have_at_most matcher (PENDING: Not yet implemented) has an alias for the have_at_least matcher (PENDING: Not yet implemented) has an alias for the have matcher using #and fails with relevant error when only second expectation fails passes when both expectations are met fails with relevant error when both expectations fail fails with relevant error when only first expectation fails using #or passes when only second expectation is met fails with relevant error when neither expectation is met passes when only first expectation is met passes when both expectations are met have(n).characters where target IS a String fails if the length is incorrect passes if the length is correct expect(...).not_to have(n).items passes if target has a collection of items with < n members passes if target has a collection of items with > n members fails if target has a collection of items with n members expect(...).to have_at_most(n).items provides educational negative failure messages passes if target has a collection of items with < n members fails if target has a collection of items with > n members passes if target has a collection of items with n members have(n).things on an object which is not a collection nor contains one fails have(n).items(args, block) passes block to target passes args to target expect(...).to have_exactly(n).items fails if target has a collection of items with < n members passes if target has a collection of items with n members fails if target has a collection of items with > n members converts :no to 0 RSpec::CollectionMatchers::Syntax expression generation when only :expect is enabled generates a negative expression using the expect syntax generates a positive expression using the expect syntax when only :should is enabled generates a negative expression using the expect syntax generates a positive expression using the expect syntax when both :should and :expect are enabled generates a positive expression using the expect syntax generates a negative expression using the expect syntax Have extensions for rails error_on provides a description including the name of what the error is on provides a failure message including the number actually given have something other than error_on or errors_on has a standard rspec failure message has a standard rspec description errors_on provides a description including the name of what the error is on provides a failure message including the number actually given calls valid? returns the errors on that attribute ActiveModel class that takes no arguments to valid? with non-blank name has no error with nil name has one error Pending: (Failures listed here are expected and do not affect your suite's status) 1) have matcher expectations compounded with RSpec::Matchers::Composable using the have matcher as an argument of another matcher has an alias for the have_at_most matcher # Not yet implemented # ./spec/rspec/collection_matchers/have_spec.rb:443 2) have matcher expectations compounded with RSpec::Matchers::Composable using the have matcher as an argument of another matcher has an alias for the have_at_least matcher # Not yet implemented # ./spec/rspec/collection_matchers/have_spec.rb:444 Finished in 0.09529 seconds (files took 0.20987 seconds to load) 76 examples, 0 failures, 2 pending Randomized with seed 2983 + RUBYOPT=-I/builddir/build/BUILD/rspec-collection_matchers-1.2.0/usr/share/gems/gems/rspec-collection_matchers-1.2.0/lib + cucumber Feature: have(n).items matcher RSpec provides several matchers that make it easy to set expectations about the size of a collection. There are three basic forms: ```ruby collection.should have(x).items collection.should have_at_least(x).items collection.should have_at_most(x).items ``` In addition, #have_exactly is provided as an alias to #have. These work on any collection-like object--the object just needs to respond to #size or #length (or both). When the matcher is called directly on a collection object, the #items call is pure syntactic sugar. You can use anything you want here. These are equivalent: ```ruby collection.should have(x).items collection.should have(x).things ``` You can also use this matcher on a non-collection object that returns a collection from one of its methods. For example, Dir#entries returns an array, so you could set an expectation using the following: ```ruby Dir.new("my/directory").should have(7).entries ``` Scenario: have(x).items on a collection # features/have.feature:32 Given a file named "have_items_spec.rb" with: # aruba-0.14.14/lib/aruba/cucumber/file.rb:23 """ require 'rspec/collection_matchers' describe [1, 2, 3] do it { should have(3).items } it { should_not have(2).items } it { should_not have(4).items } it { should have_exactly(3).items } it { should_not have_exactly(2).items } it { should_not have_exactly(4).items } it { should have_at_least(2).items } it { should have_at_most(4).items } # deliberate failures it { should_not have(3).items } it { should have(2).items } it { should have(4).items } it { should_not have_exactly(3).items } it { should have_exactly(2).items } it { should have_exactly(4).items } it { should have_at_least(4).items } it { should have_at_most(2).items } end """ When I run `rspec have_items_spec.rb` # aruba-0.14.14/lib/aruba/cucumber/command.rb:6 Then the output should contain "16 examples, 8 failures" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected target not to have 3 items, got 3" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected 2 items, got 3" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected 4 items, got 3" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected at least 4 items, got 3" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected at most 2 items, got 3" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 Scenario: have(x).words on a String when String#words is defined # features/have.feature:70 Given a file named "have_words_spec.rb" with: # aruba-0.14.14/lib/aruba/cucumber/file.rb:23 """ require 'rspec/collection_matchers' class String def words split(' ') end end describe "a sentence with some words" do it { should have(5).words } it { should_not have(4).words } it { should_not have(6).words } it { should have_exactly(5).words } it { should_not have_exactly(4).words } it { should_not have_exactly(6).words } it { should have_at_least(4).words } it { should have_at_most(6).words } # deliberate failures it { should_not have(5).words } it { should have(4).words } it { should have(6).words } it { should_not have_exactly(5).words } it { should have_exactly(4).words } it { should have_exactly(6).words } it { should have_at_least(6).words } it { should have_at_most(4).words } end """ When I run `rspec have_words_spec.rb` # aruba-0.14.14/lib/aruba/cucumber/command.rb:6 Then the output should contain "16 examples, 8 failures" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected target not to have 5 words, got 5" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected 4 words, got 5" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected 6 words, got 5" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected at least 6 words, got 5" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 And the output should contain "expected at most 4 words, got 5" # aruba-0.14.14/lib/aruba/cucumber/command.rb:139 2 scenarios (2 passed) 16 steps (16 passed) 0m0.427s + popd ~/build/BUILD/rspec-collection_matchers-1.2.0 + RPM_EC=0 ++ jobs -p + exit 0 Processing files: rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.noarch Provides: rubygem(rspec-collection_matchers) = 1.2.0 rubygem-rspec-collection_matchers = 1.2.0-3.1.fc36 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/bash ruby(rubygems) rubygem(rspec-expectations) >= 2.99.0.beta1 Processing files: rubygem-rspec-collection_matchers-doc-1.2.0-3.1.fc36.noarch Provides: rubygem-rspec-collection_matchers-doc = 1.2.0-3.1.fc36 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 Wrote: /builddir/build/RPMS/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.noarch.rpm Wrote: /builddir/build/RPMS/rubygem-rspec-collection_matchers-doc-1.2.0-3.1.fc36.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.z8Cc38 + umask 022 + cd /builddir/build/BUILD + cd rspec-collection_matchers-1.2.0 + /usr/bin/rm -rf /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-3.1.fc36.x86_64 + RPM_EC=0 ++ jobs -p + exit 0 Child return code was: 0