Mock Version: 3.5 Mock Version: 3.5 Mock Version: 3.5 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-874123-28449/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=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --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'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1674172800 Wrote: /builddir/build/SRPMS/rubygem-rspec-collection_matchers-1.2.0-6.fc38.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-874123-28449/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=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --noclean --target noarch --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'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1674172800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7rwkDu + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf rspec-collection_matchers-1.2.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/rspec-collection_matchers-1.2.0.gem Unpacked gem: '/builddir/build/BUILD/rspec-collection_matchers-1.2.0' + 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.36kA6W + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + 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 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + 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,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer'\'' --with-cxxflags='\''-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer'\'' --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 -Wl,--build-id=sha1 '\'' ' + 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 6 seconds 1 gem installed + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.baaSQB + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch ++ dirname /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + 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 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd rspec-collection_matchers-1.2.0 + mkdir -p /builddir/build/BUILDROOT/rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch/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-6.fc38.noarch/usr/share/gems/ + /usr/bin/find-debuginfo -j8 --strict-build-id -m -i --build-id-seed 1.2.0-6.fc38 --unique-debug-suffix -1.2.0-6.fc38.noarch --unique-debug-src-base rubygem-rspec-collection_matchers-1.2.0-6.fc38.noarch --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 -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/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j8 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.ykjc47 + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + 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 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd rspec-collection_matchers-1.2.0 + pushd ./usr/share/gems/gems/rspec-collection_matchers-1.2.0 + rspec spec ~/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 Run options: include {:focus=>true} All examples were filtered out; ignoring {:focus=>true} Randomized with seed 38905 have matcher 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 have(n).characters where target IS a String passes if the length is correct fails if the length is incorrect expect(...).to have_exactly(n).items passes if target has a collection of items with n members converts :no to 0 fails if target has a collection of items with < n members fails 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 expect(...).to have_at_least(n).items provides educational negative failure messages 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 RSpec::CollectionMatchers::Have does not respond_to? method_missing (because it's private) has method_missing as private respond_to? is true if the owner responds to the method is false if the owner doesn't respond to the method is true for a method that it's superclass (Object) defines is false for a method which neither Object nor nor Have defines is true for a method which Have defines 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 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 RSpec::CollectionMatchers::Have for an Enumerator whose size is nil but count is supplied works fine description generation the have_at_least matcher generates its own description the have_at_most matcher generates its own description the have matcher generates its own description expect(...).to have(1).item when Inflector is defined pluralizes the collection name RSpec::CollectionMatchers::Have for a collection owner that implements #send blows up when the owner doesn't respond to that method works in the straightforward case works when #send is defined directly on an array works when doing automatic pluralization expect(...).to have(n).items converts :no to 0 converts a String argument to Integer passes if target has a collection of items with n members fails if target has a collection of items with > n members fails if target has a collection of items with < n members behaves like an RSpec matcher matches a valid value when using #== so it can be composed does not match an invalid value when using #== so it can be composed have(n).items(args, block) passes args to target passes block to target 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 expectations compounded with RSpec::Matchers::Composable using #or passes when both expectations are met passes when only second expectation is met passes when only first expectation is met fails with relevant error when neither expectation is met using #and fails with relevant error when both expectations fail fails with relevant error when only first expectation fails fails with relevant error when only second expectation fails passes when both expectations are met 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 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 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 errors_on returns the errors on that attribute calls valid? provides a failure message including the number actually given provides a description including the name of what the error is on ActiveModel class that takes no arguments to valid? with non-blank name has no error with nil name has one error have something other than error_on or errors_on has a standard rspec failure message has a standard rspec description error_on provides a failure message including the number actually given provides a description including the name of what the error is on 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 2.18 seconds (files took 8.21 seconds to load) 76 examples, 0 failures, 2 pending Randomized with seed 38905 + 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-2.1.0/lib/aruba/cucumber/file.rb:26 """ 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-2.1.0/lib/aruba/cucumber/command.rb:3 Then the output should contain "16 examples, 8 failures" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected target not to have 3 items, got 3" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 expected "........FFFFFFFF\n\nFailures:\n\n 1) [1, 2, 3] is expected not to have 3 supports_value_expectation...ec ./have_items_spec.rb:25 # [1, 2, 3] is expected to have at most 2 supports_value_expectations?\n" to string includes: "expected target not to have 3 items, got 3" Diff: @@ -1,57 +1,113 @@ -expected target not to have 3 items, got 3 +........FFFFFFFF + +Failures: + + 1) [1, 2, 3] is expected not to have 3 supports_value_expectations? + Failure/Error: it { should_not have(3).items } + expected target not to have 3 supports_value_expectations?, got 3 + # ./have_items_spec.rb:16:in `block (2 levels) in ' + + 2) [1, 2, 3] is expected to have 2 supports_value_expectations? + Failure/Error: it { should have(2).items } + expected 2 supports_value_expectations?, got 3 + # ./have_items_spec.rb:17:in `block (2 levels) in ' + + 3) [1, 2, 3] is expected to have 4 supports_value_expectations? + Failure/Error: it { should have(4).items } + expected 4 supports_value_expectations?, got 3 + # ./have_items_spec.rb:18:in `block (2 levels) in ' + + 4) [1, 2, 3] is expected not to have 3 supports_value_expectations? + Failure/Error: it { should_not have_exactly(3).items } + expected target not to have 3 supports_value_expectations?, got 3 + # ./have_items_spec.rb:20:in `block (2 levels) in ' + + 5) [1, 2, 3] is expected to have 2 supports_value_expectations? + Failure/Error: it { should have_exactly(2).items } + expected 2 supports_value_expectations?, got 3 + # ./have_items_spec.rb:21:in `block (2 levels) in ' + + 6) [1, 2, 3] is expected to have 4 supports_value_expectations? + Failure/Error: it { should have_exactly(4).items } + expected 4 supports_value_expectations?, got 3 + # ./have_items_spec.rb:22:in `block (2 levels) in ' + + 7) [1, 2, 3] is expected to have at least 4 supports_value_expectations? + Failure/Error: it { should have_at_least(4).items } + expected at least 4 supports_value_expectations?, got 3 + # ./have_items_spec.rb:24:in `block (2 levels) in ' + + 8) [1, 2, 3] is expected to have at most 2 supports_value_expectations? + Failure/Error: it { should have_at_most(2).items } + expected at most 2 supports_value_expectations?, got 3 + # ./have_items_spec.rb:25:in `block (2 levels) in ' + +Finished in 0.57169 seconds (files took 2.9 seconds to load) +16 examples, 8 failures + +Failed examples: + +rspec ./have_items_spec.rb:16 # [1, 2, 3] is expected not to have 3 supports_value_expectations? +rspec ./have_items_spec.rb:17 # [1, 2, 3] is expected to have 2 supports_value_expectations? +rspec ./have_items_spec.rb:18 # [1, 2, 3] is expected to have 4 supports_value_expectations? +rspec ./have_items_spec.rb:20 # [1, 2, 3] is expected not to have 3 supports_value_expectations? +rspec ./have_items_spec.rb:21 # [1, 2, 3] is expected to have 2 supports_value_expectations? +rspec ./have_items_spec.rb:22 # [1, 2, 3] is expected to have 4 supports_value_expectations? +rspec ./have_items_spec.rb:24 # [1, 2, 3] is expected to have at least 4 supports_value_expectations? +rspec ./have_items_spec.rb:25 # [1, 2, 3] is expected to have at most 2 supports_value_expectations? (RSpec::Expectations::ExpectationNotMetError) features/have.feature:64:in `the output should contain "expected target not to have 3 items, got 3"' And the output should contain "expected 2 items, got 3" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected 4 items, got 3" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected at least 4 items, got 3" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected at most 2 items, got 3" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 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-2.1.0/lib/aruba/cucumber/file.rb:26 """ 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-2.1.0/lib/aruba/cucumber/command.rb:3 Then the output should contain "16 examples, 8 failures" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected target not to have 5 words, got 5" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 expected "F..F...F.FF.FF.F\n\nFailures:\n\n 1) a sentence with some words is expected to have 5 supports_valu...pec.rb:31 # a sentence with some words is expected to have at most 4 supports_value_expectations?\n" to string includes: "expected target not to have 5 words, got 5" Diff: @@ -1,57 +1,113 @@ -expected target not to have 5 words, got 5 +F..F...F.FF.FF.F + +Failures: + + 1) a sentence with some words is expected to have 5 supports_value_expectations? + Failure/Error: it { should have(5).words } + expected 5 supports_value_expectations?, got 26 + # ./have_words_spec.rb:10:in `block (2 levels) in ' + + 2) a sentence with some words is expected to have 5 supports_value_expectations? + Failure/Error: it { should have_exactly(5).words } + expected 5 supports_value_expectations?, got 26 + # ./have_words_spec.rb:14:in `block (2 levels) in ' + + 3) a sentence with some words is expected to have at most 6 supports_value_expectations? + Failure/Error: it { should have_at_most(6).words } + expected at most 6 supports_value_expectations?, got 26 + # ./have_words_spec.rb:19:in `block (2 levels) in ' + + 4) a sentence with some words is expected to have 4 supports_value_expectations? + Failure/Error: it { should have(4).words } + expected 4 supports_value_expectations?, got 26 + # ./have_words_spec.rb:23:in `block (2 levels) in ' + + 5) a sentence with some words is expected to have 6 supports_value_expectations? + Failure/Error: it { should have(6).words } + expected 6 supports_value_expectations?, got 26 + # ./have_words_spec.rb:24:in `block (2 levels) in ' + + 6) a sentence with some words is expected to have 4 supports_value_expectations? + Failure/Error: it { should have_exactly(4).words } + expected 4 supports_value_expectations?, got 26 + # ./have_words_spec.rb:27:in `block (2 levels) in ' + + 7) a sentence with some words is expected to have 6 supports_value_expectations? + Failure/Error: it { should have_exactly(6).words } + expected 6 supports_value_expectations?, got 26 + # ./have_words_spec.rb:28:in `block (2 levels) in ' + + 8) a sentence with some words is expected to have at most 4 supports_value_expectations? + Failure/Error: it { should have_at_most(4).words } + expected at most 4 supports_value_expectations?, got 26 + # ./have_words_spec.rb:31:in `block (2 levels) in ' + +Finished in 0.43702 seconds (files took 2.66 seconds to load) +16 examples, 8 failures + +Failed examples: + +rspec ./have_words_spec.rb:10 # a sentence with some words is expected to have 5 supports_value_expectations? +rspec ./have_words_spec.rb:14 # a sentence with some words is expected to have 5 supports_value_expectations? +rspec ./have_words_spec.rb:19 # a sentence with some words is expected to have at most 6 supports_value_expectations? +rspec ./have_words_spec.rb:23 # a sentence with some words is expected to have 4 supports_value_expectations? +rspec ./have_words_spec.rb:24 # a sentence with some words is expected to have 6 supports_value_expectations? +rspec ./have_words_spec.rb:27 # a sentence with some words is expected to have 4 supports_value_expectations? +rspec ./have_words_spec.rb:28 # a sentence with some words is expected to have 6 supports_value_expectations? +rspec ./have_words_spec.rb:31 # a sentence with some words is expected to have at most 4 supports_value_expectations? (RSpec::Expectations::ExpectationNotMetError) features/have.feature:108:in `the output should contain "expected target not to have 5 words, got 5"' And the output should contain "expected 4 words, got 5" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected 6 words, got 5" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected at least 6 words, got 5" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 And the output should contain "expected at most 4 words, got 5" # aruba-2.1.0/lib/aruba/cucumber/command.rb:123 Failing Scenarios: cucumber features/have.feature:32 # Scenario: have(x).items on a collection cucumber features/have.feature:70 # Scenario: have(x).words on a String when String#words is defined 2 scenarios (2 failed) 16 steps (2 failed, 8 skipped, 6 passed) 0m16.917s ┌──────────────────────────────────────────────────────────────────────────────┐ │ Share your Cucumber Report with your team at https://reports.cucumber.io │ │ │ │ Command line option: --publish │ │ Environment variable: CUCUMBER_PUBLISH_ENABLED=true │ │ cucumber.yml: default: --publish │ │ │ │ More information at https://cucumber.io/docs/cucumber/environment-variables/ │ │ │ │ To disable this message, specify CUCUMBER_PUBLISH_QUIET=true or use the │ │ --publish-quiet option. You can also add this to your cucumber.yml: │ │ default: --publish-quiet │ └──────────────────────────────────────────────────────────────────────────────┘ error: Bad exit status from /var/tmp/rpm-tmp.ykjc47 (%check) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.ykjc47 (%check) Child return code was: 1 EXCEPTION: [Error('Command failed: \n # bash --login -c /usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec\n', 1)] Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/mockbuild/util.py", line 598, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/rubygem-rspec-collection_matchers.spec