Diff of the two buildlogs: -- --- b1/build.log 2021-09-07 03:55:24.914913494 +0000 +++ b2/build.log 2021-09-07 03:57:25.978564373 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sun Oct 9 22:17:09 -12 2022 -I: pbuilder-time-stamp: 1665397029 +I: Current time: Tue Sep 7 17:55:29 +14 2021 +I: pbuilder-time-stamp: 1630986929 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bullseye-reproducible-base.tgz] I: copying local configuration @@ -16,8 +16,8 @@ I: copying [./ruby-rubocop-rspec_1.42.0-1.debian.tar.xz] I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' -gpgv: keyblock resource '/tmp/dpkg-verify-sig.7dRpFzgK/trustedkeys.kbx': General error -gpgv: Signature made Fri Jul 24 06:26:59 2020 -12 +gpgv: keyblock resource '/tmp/dpkg-verify-sig.EjK_X_lR/trustedkeys.kbx': General error +gpgv: Signature made Sat Jul 25 08:26:59 2020 +14 gpgv: using RSA key 6C9D10484A9AE4CC385F7C71823E967606C34B96 gpgv: issuer "utkarsh@debian.org" gpgv: Can't check signature: No public key @@ -29,135 +29,169 @@ dpkg-source: info: applying 01-disable-bundler.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/24159/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/D01_modify_environment starting +debug: Running on codethink16-arm64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +Removing 'diversion of /bin/sh to /bin/sh.distrib by dash' +Adding 'diversion of /bin/sh to /bin/sh.distrib by bash' +Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash' +Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash' +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='arm64' - DEBIAN_FRONTEND='noninteractive' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="1" [2]="4" [3]="1" [4]="release" [5]="aarch64-unknown-linux-gnu") + BASH_VERSION='5.1.4(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=arm64 + DEBIAN_FRONTEND=noninteractive DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=8' - DISTRIBUTION='' - HOME='/var/lib/jenkins' - HOST_ARCH='arm64' + DIRSTACK=() + DISTRIBUTION= + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/var/lib/jenkins + HOSTNAME=i-capture-the-hostname + HOSTTYPE=aarch64 + HOST_ARCH=arm64 IFS=' ' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='24159' - PS1='# ' - PS2='> ' + LANG=C + LANGUAGE=nl_BE:nl + LC_ALL=C + MACHTYPE=aarch64-unknown-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=2260 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.44TFPeKB8g/pbuilderrc_wiBs --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.44TFPeKB8g/b1 --logfile b1/build.log ruby-rubocop-rspec_1.42.0-1.dsc' - SUDO_GID='117' - SUDO_UID='110' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - USERNAME='root' - _='/usr/bin/systemd-run' - http_proxy='http://192.168.101.16:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.44TFPeKB8g/pbuilderrc_gheZ --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.44TFPeKB8g/b2 --logfile b2/build.log ruby-rubocop-rspec_1.42.0-1.dsc' + SUDO_GID=117 + SUDO_UID=110 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + USERNAME=root + _='I: set' + http_proxy=http://192.168.101.16:3128 I: uname -a - Linux codethink9-arm64 4.15.0-154-generic #161-Ubuntu SMP Fri Jul 30 13:01:15 UTC 2021 aarch64 GNU/Linux + Linux i-capture-the-hostname 4.15.0-154-generic #161-Ubuntu SMP Fri Jul 30 13:01:15 UTC 2021 aarch64 GNU/Linux I: ls -l /bin total 5252 - -rwxr-xr-x 1 root root 1282512 Aug 4 2021 bash - -rwxr-xr-x 3 root root 34808 Jul 20 2020 bunzip2 - -rwxr-xr-x 3 root root 34808 Jul 20 2020 bzcat - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Jul 20 2020 bzdiff - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Sep 4 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Jul 20 2020 bzgrep - -rwxr-xr-x 3 root root 34808 Jul 20 2020 bzip2 - -rwxr-xr-x 1 root root 14264 Jul 20 2020 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 20 2020 bzmore - -rwxr-xr-x 1 root root 39832 Sep 22 2020 cat - -rwxr-xr-x 1 root root 64512 Sep 22 2020 chgrp - -rwxr-xr-x 1 root root 60368 Sep 22 2020 chmod - -rwxr-xr-x 1 root root 64528 Sep 22 2020 chown - -rwxr-xr-x 1 root root 138896 Sep 22 2020 cp - -rwxr-xr-x 1 root root 129544 Dec 10 2020 dash - -rwxr-xr-x 1 root root 101384 Sep 22 2020 date - -rwxr-xr-x 1 root root 80984 Sep 22 2020 dd - -rwxr-xr-x 1 root root 89824 Sep 22 2020 df - -rwxr-xr-x 1 root root 143088 Sep 22 2020 dir - -rwxr-xr-x 1 root root 76152 Jul 28 2021 dmesg - lrwxrwxrwx 1 root root 8 Nov 6 2019 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Nov 6 2019 domainname -> hostname - -rwxr-xr-x 1 root root 35632 Sep 22 2020 echo - -rwxr-xr-x 1 root root 28 Nov 9 2020 egrep - -rwxr-xr-x 1 root root 31512 Sep 22 2020 false - -rwxr-xr-x 1 root root 28 Nov 9 2020 fgrep - -rwxr-xr-x 1 root root 64856 Jul 28 2021 findmnt - -rwsr-xr-x 1 root root 34824 Feb 26 2021 fusermount - -rwxr-xr-x 1 root root 178400 Nov 9 2020 grep - -rwxr-xr-x 2 root root 2346 Mar 2 2021 gunzip - -rwxr-xr-x 1 root root 6376 Mar 2 2021 gzexe - -rwxr-xr-x 1 root root 93744 Mar 2 2021 gzip - -rwxr-xr-x 1 root root 18440 Nov 6 2019 hostname - -rwxr-xr-x 1 root root 68720 Sep 22 2020 ln - -rwxr-xr-x 1 root root 52720 Feb 7 2020 login - -rwxr-xr-x 1 root root 143088 Sep 22 2020 ls - -rwxr-xr-x 1 root root 161960 Jul 28 2021 lsblk - -rwxr-xr-x 1 root root 85200 Sep 22 2020 mkdir - -rwxr-xr-x 1 root root 68744 Sep 22 2020 mknod - -rwxr-xr-x 1 root root 43976 Sep 22 2020 mktemp - -rwxr-xr-x 1 root root 51368 Jul 28 2021 more - -rwsr-xr-x 1 root root 51360 Jul 28 2021 mount - -rwxr-xr-x 1 root root 14496 Jul 28 2021 mountpoint - -rwxr-xr-x 1 root root 134808 Sep 22 2020 mv - lrwxrwxrwx 1 root root 8 Nov 6 2019 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 18 2021 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 35720 Sep 22 2020 pwd - lrwxrwxrwx 1 root root 4 Aug 4 2021 rbash -> bash - -rwxr-xr-x 1 root root 43872 Sep 22 2020 readlink - -rwxr-xr-x 1 root root 68592 Sep 22 2020 rm - -rwxr-xr-x 1 root root 43880 Sep 22 2020 rmdir - -rwxr-xr-x 1 root root 19208 Sep 27 2020 run-parts - -rwxr-xr-x 1 root root 114016 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Sep 23 03:48 sh -> dash - -rwxr-xr-x 1 root root 35656 Sep 22 2020 sleep - -rwxr-xr-x 1 root root 72640 Sep 22 2020 stty - -rwsr-xr-x 1 root root 67776 Jul 28 2021 su - -rwxr-xr-x 1 root root 35672 Sep 22 2020 sync - -rwxr-xr-x 1 root root 535768 Feb 16 2021 tar - -rwxr-xr-x 1 root root 10568 Sep 27 2020 tempfile - -rwxr-xr-x 1 root root 89120 Sep 22 2020 touch - -rwxr-xr-x 1 root root 31512 Sep 22 2020 true - -rwxr-xr-x 1 root root 14264 Feb 26 2021 ulockmgr_server - -rwsr-xr-x 1 root root 30880 Jul 28 2021 umount - -rwxr-xr-x 1 root root 35640 Sep 22 2020 uname - -rwxr-xr-x 2 root root 2346 Mar 2 2021 uncompress - -rwxr-xr-x 1 root root 143088 Sep 22 2020 vdir - -rwxr-xr-x 1 root root 59584 Jul 28 2021 wdctl - lrwxrwxrwx 1 root root 8 Nov 6 2019 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Mar 2 2021 zcat - -rwxr-xr-x 1 root root 1678 Mar 2 2021 zcmp - -rwxr-xr-x 1 root root 5880 Mar 2 2021 zdiff - -rwxr-xr-x 1 root root 29 Mar 2 2021 zegrep - -rwxr-xr-x 1 root root 29 Mar 2 2021 zfgrep - -rwxr-xr-x 1 root root 2081 Mar 2 2021 zforce - -rwxr-xr-x 1 root root 7585 Mar 2 2021 zgrep - -rwxr-xr-x 1 root root 2206 Mar 2 2021 zless - -rwxr-xr-x 1 root root 1842 Mar 2 2021 zmore - -rwxr-xr-x 1 root root 4553 Mar 2 2021 znew -I: user script /srv/workspace/pbuilder/24159/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1282512 Aug 5 10:25 bash + -rwxr-xr-x 3 root root 34808 Jul 21 2020 bunzip2 + -rwxr-xr-x 3 root root 34808 Jul 21 2020 bzcat + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Jul 21 2020 bzdiff + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Sep 5 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Jul 21 2020 bzgrep + -rwxr-xr-x 3 root root 34808 Jul 21 2020 bzip2 + -rwxr-xr-x 1 root root 14264 Jul 21 2020 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 21 2020 bzmore + -rwxr-xr-x 1 root root 39832 Sep 23 2020 cat + -rwxr-xr-x 1 root root 64512 Sep 23 2020 chgrp + -rwxr-xr-x 1 root root 60368 Sep 23 2020 chmod + -rwxr-xr-x 1 root root 64528 Sep 23 2020 chown + -rwxr-xr-x 1 root root 138896 Sep 23 2020 cp + -rwxr-xr-x 1 root root 129544 Dec 11 2020 dash + -rwxr-xr-x 1 root root 101384 Sep 23 2020 date + -rwxr-xr-x 1 root root 80984 Sep 23 2020 dd + -rwxr-xr-x 1 root root 89824 Sep 23 2020 df + -rwxr-xr-x 1 root root 143088 Sep 23 2020 dir + -rwxr-xr-x 1 root root 76152 Jul 29 09:09 dmesg + lrwxrwxrwx 1 root root 8 Nov 8 2019 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Nov 8 2019 domainname -> hostname + -rwxr-xr-x 1 root root 35632 Sep 23 2020 echo + -rwxr-xr-x 1 root root 28 Nov 10 2020 egrep + -rwxr-xr-x 1 root root 31512 Sep 23 2020 false + -rwxr-xr-x 1 root root 28 Nov 10 2020 fgrep + -rwxr-xr-x 1 root root 64856 Jul 29 09:09 findmnt + -rwsr-xr-x 1 root root 34824 Feb 27 2021 fusermount + -rwxr-xr-x 1 root root 178400 Nov 10 2020 grep + -rwxr-xr-x 2 root root 2346 Mar 3 2021 gunzip + -rwxr-xr-x 1 root root 6376 Mar 3 2021 gzexe + -rwxr-xr-x 1 root root 93744 Mar 3 2021 gzip + -rwxr-xr-x 1 root root 18440 Nov 8 2019 hostname + -rwxr-xr-x 1 root root 68720 Sep 23 2020 ln + -rwxr-xr-x 1 root root 52720 Feb 8 2020 login + -rwxr-xr-x 1 root root 143088 Sep 23 2020 ls + -rwxr-xr-x 1 root root 161960 Jul 29 09:09 lsblk + -rwxr-xr-x 1 root root 85200 Sep 23 2020 mkdir + -rwxr-xr-x 1 root root 68744 Sep 23 2020 mknod + -rwxr-xr-x 1 root root 43976 Sep 23 2020 mktemp + -rwxr-xr-x 1 root root 51368 Jul 29 09:09 more + -rwsr-xr-x 1 root root 51360 Jul 29 09:09 mount + -rwxr-xr-x 1 root root 14496 Jul 29 09:09 mountpoint + -rwxr-xr-x 1 root root 134808 Sep 23 2020 mv + lrwxrwxrwx 1 root root 8 Nov 8 2019 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 19 05:38 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 35720 Sep 23 2020 pwd + lrwxrwxrwx 1 root root 4 Aug 5 10:25 rbash -> bash + -rwxr-xr-x 1 root root 43872 Sep 23 2020 readlink + -rwxr-xr-x 1 root root 68592 Sep 23 2020 rm + -rwxr-xr-x 1 root root 43880 Sep 23 2020 rmdir + -rwxr-xr-x 1 root root 19208 Sep 28 2020 run-parts + -rwxr-xr-x 1 root root 114016 Dec 23 2018 sed + lrwxrwxrwx 1 root root 4 Sep 7 17:55 sh -> bash + lrwxrwxrwx 1 root root 4 Aug 21 23:25 sh.distrib -> dash + -rwxr-xr-x 1 root root 35656 Sep 23 2020 sleep + -rwxr-xr-x 1 root root 72640 Sep 23 2020 stty + -rwsr-xr-x 1 root root 67776 Jul 29 09:09 su + -rwxr-xr-x 1 root root 35672 Sep 23 2020 sync + -rwxr-xr-x 1 root root 535768 Feb 17 2021 tar + -rwxr-xr-x 1 root root 10568 Sep 28 2020 tempfile + -rwxr-xr-x 1 root root 89120 Sep 23 2020 touch + -rwxr-xr-x 1 root root 31512 Sep 23 2020 true + -rwxr-xr-x 1 root root 14264 Feb 27 2021 ulockmgr_server + -rwsr-xr-x 1 root root 30880 Jul 29 09:09 umount + -rwxr-xr-x 1 root root 35640 Sep 23 2020 uname + -rwxr-xr-x 2 root root 2346 Mar 3 2021 uncompress + -rwxr-xr-x 1 root root 143088 Sep 23 2020 vdir + -rwxr-xr-x 1 root root 59584 Jul 29 09:09 wdctl + lrwxrwxrwx 1 root root 8 Nov 8 2019 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Mar 3 2021 zcat + -rwxr-xr-x 1 root root 1678 Mar 3 2021 zcmp + -rwxr-xr-x 1 root root 5880 Mar 3 2021 zdiff + -rwxr-xr-x 1 root root 29 Mar 3 2021 zegrep + -rwxr-xr-x 1 root root 29 Mar 3 2021 zfgrep + -rwxr-xr-x 1 root root 2081 Mar 3 2021 zforce + -rwxr-xr-x 1 root root 7585 Mar 3 2021 zgrep + -rwxr-xr-x 1 root root 2206 Mar 3 2021 zless + -rwxr-xr-x 1 root root 1842 Mar 3 2021 zmore + -rwxr-xr-x 1 root root 4553 Mar 3 2021 znew +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -351,7 +385,7 @@ Get: 144 http://deb.debian.org/debian bullseye/main arm64 ruby-rspec-mocks all 3.9.0c2e2m1s3-2 [81.4 kB] Get: 145 http://deb.debian.org/debian bullseye/main arm64 ruby-rspec all 3.9.0c2e2m1s3-2 [8348 B] Get: 146 http://deb.debian.org/debian bullseye/main arm64 yard all 0.9.24-1 [387 kB] -Fetched 45.3 MB in 1s (38.1 MB/s) +Fetched 45.3 MB in 1s (43.5 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package bsdextrautils. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19646 files and directories currently installed.) @@ -960,7 +994,8 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/ruby-rubocop-rspec-1.42.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-rubocop-rspec_1.42.0-1_source.changes +hostname: Temporary failure in name resolution +I: Running cd /build/ruby-rubocop-rspec-1.42.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-rubocop-rspec_1.42.0-1_source.changes dpkg-buildpackage: info: source package ruby-rubocop-rspec dpkg-buildpackage: info: source version 1.42.0-1 dpkg-buildpackage: info: source distribution unstable @@ -991,7 +1026,7 @@ dh_auto_install -O--buildsystem=ruby dh_ruby --install /build/ruby-rubocop-rspec-1.42.0/debian/ruby-rubocop-rspec dh_ruby --install -/usr/bin/ruby2.7 -S gem build --config-file /dev/null --verbose /tmp/d20221009-30542-1lse99b/gemspec +/usr/bin/ruby2.7 -S gem build --config-file /dev/null --verbose /tmp/d20210907-9578-1eag4lt/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash WARNING: open-ended dependency on rubocop (>= 0.87.0) is not recommended if rubocop is semantically versioned, use: @@ -1010,7 +1045,7 @@ Name: rubocop-rspec Version: 1.42.0 File: rubocop-rspec-1.42.0.gem -/usr/bin/ruby2.7 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all /tmp/d20221009-30542-1lse99b/rubocop-rspec-1.42.0.gem +/usr/bin/ruby2.7 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all /tmp/d20210907-9578-1eag4lt/rubocop-rspec-1.42.0.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/ruby-rubocop-rspec-1.42.0/debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all/gems/rubocop-rspec-1.42.0/config/default.yml /build/ruby-rubocop-rspec-1.42.0/debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all/gems/rubocop-rspec-1.42.0/lib/rubocop-rspec.rb @@ -1151,1446 +1186,1201 @@ RUBYLIB=. GEM_PATH=/build/ruby-rubocop-rspec-1.42.0/debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all:/build/ruby-rubocop-rspec-1.42.0/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/2.7.0:/var/lib/gems/2.7.0:/usr/local/lib/ruby/gems/2.7.0:/usr/lib/ruby/gems/2.7.0:/usr/lib/aarch64-linux-gnu/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/aarch64-linux-gnu/rubygems-integration/2.7.0 ruby2.7 -S rake -f debian/ruby-tests.rake /usr/bin/ruby2.7 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.9.3/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.9.2/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.9.2/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 5862 +Randomized with seed 64254 -RuboCop::Cop::RSpec::ImplicitSubject - with EnforcedStyle `single_line_only` - does not flag methods called is_expected and should - allows `is_expected` in single-line examples - flags `is_expected` in multi-line examples - flags `should` in multi-line examples - allows `should` in single-line examples - allows `is_expected` inside `its` block, in multi-line examples - detects usage of `is_expected` inside helper methods - with EnforcedStyle `disallow` - flags `is_expected` in multi-line examples - flags `is_expected` in single-line examples - allows `is_expected` inside `its` block - flags `should` in multi-line examples - flags `should` in single-line examples +RuboCop::Cop::RSpec::DescribeClass + ignores view specs + doesn't flag top level describe in a shared context + supports RSpec.describe + ignores feature specs - also with complex options + checks first-line describe statements + doesn't flag top level describe in a shared example + ignores system specs + ignores request specs + ignores nested describe statements + checks highlights the first argument of a describe + doesn't blow up on single-line describes + ignores feature specs when RSpec.describe is used + checks describe statements after a require + flags normal metadata in describe + flags specs with non :type metadata + ignores feature specs + ignores routing specs + doesn't flag top level describe in an unnamed shared context + ignores an empty describe + supports ::RSpec.describe with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - with EnforcedStyle `single_statement_only` - allows `is_expected` in multi-line example with single statement - flags `is_expected` in multi-statement examples + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when argument is a String literal + ignores value constants with namespace + ignores top-level constants with `::` at start + checks empty strings + ignores class with namespace + ignores class without namespace + checks `camelCase` + ignores value constants + checks numbers at start -RuboCop::Cop::RSpec::ReceiveNever - flags usage of `never` with `is_expected` - flags usage of `never` after `with` - allows method called `never` - flags usage of `never` with `expect_any_instance_of` - flags usage of `never` +RuboCop::Cop::RSpec::RepeatedDescription + ignores descriptions repeated in a shared context + does not flag examples with same metadata and different description + registers offense for repeated descriptions separated by a context + registers offense for repeated description in different iterators + does not flag different descriptions in different iterators + does not flag different methods used as docstring + ignores repeated descriptions in a nested context + does not flag descriptions with different interpolated variables + does not flag tests which do not contain description strings + registers offense for repeated description in same iterator + registers an offense for repeated descriptions + registers offense for repeated description and metadata + registers offense if same method used in docstring + does not flag examples if metadata is different with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::AnyInstance - finds `expect_any_instance_of` instead of an instance double - finds `allow_any_instance_of` instead of an instance double - finds old `any_instance` syntax instead of an instance double +RuboCop::Cop::RSpec::UnspecifiedException with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + with raise_error matcher + allows exception types with messages + allows classes with blocks with braces + detects the `unspecified_exception` offense + allows exception classes + allows exception matching regular expressions + allows empty exception specification when not expecting an error + allows classes with blocks with do/end + allows exception messages + allows parameterized exceptions + allows exception types with matching regular expressions + with raise_exception matcher + allows exception types with matching regular expressions + allows classes with blocks with braces + allows exception matching regular expressions + allows exception types with messages + allows exception classes + allows exception messages + allows parameterized exceptions + allows empty exception specification when not expecting an error + allows classes with blocks with do/end + detects the `unspecified_exception` offense -RuboCop::Cop::RSpec::EmptyLineAfterHook - checks for empty line after `around` hook - approves empty line after `after` hook - handles `before` being the latest node - checks for empty line after `before` hook - approves empty line after `before` hook - handles multiline `before` block - handles multiline `after` block - checks for empty line after `after` hook - approves empty line after `around` hook - handles multiline `around` block +RuboCop::RSpec::Language::SelectorSet + composes sets + compares by value + #send_pattern + builds a send matching pattern + #node_pattern + builds a node pattern + #block_pattern + builds a block matching pattern + #node_pattern_union + builds a node pattern union + #include? + returns false for selectors not in the set + returns true for selectors in the set + +RuboCop::Cop::RSpec::AlignRightLetBrace + works with empty file + registers offense for unaligned braces + does not register offense for let with proc argument with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::InstanceSpy - when not used with `have_received` - does not add an offence - when used with `have_received` - adds an offense for an instance_double with single argument - adds an offense for an instance_double with multiple arguments - ignores instance_double when it is not used with as_null_object +RuboCop::Cop::RSpec::InstanceVariable + flags several instance variables inside a describe + ignores an instance variable without describe + flags an instance variable inside a shared example + ignores an instance variable inside a dynamic class + ignores instance variables outside of specs + ignores non-spec blocks + flags an instance variable inside a describe + when used in a custom matcher + ignores instance variables inside `RSpec::Matchers.define` + flags instance variables outside `matcher` + ignores instance variables inside `matcher` + when configured with AssignmentOnly + ignores an instance variable when it is not assigned + flags an instance variable when it is also assigned + flags an instance variable when it is also assigned in a sibling example group with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ScatteredLet - flags `let` with proc argument - doesnt flag `let!` in the middle of multiple `let`s - flags scattered `let!`s - flags `let` after the first different node - works with heredocs - flags `let` at different nesting levels +RuboCop::Cop::RSpec::VerifiedDoubles + ignores doubles that have no name specified + finds a `double` instead of an `instance_double` + ignores instance_doubles + when configured to ignore symbolic names + still flags doubles whose name is a string + ignores doubles whose name is a symbol with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when configuration does not specify IgnoreSymbolicNames + find doubles whose name is a symbol + finds a `spy` instead of an `instance_spy` + when configured not to ignore nameless doubles + flags doubles that have no name specified RuboCop::Cop::RSpec::Focus + ignores non-rspec code with :focus blocks does not flag a method that is focused twice - flags all rspec example blocks that include `:focus` + flags all rspec example blocks with that include `focus: true` flags focused block types - does not flag unfocused specs flags rspec example blocks that include `:focus` preceding a hash - ignores non-rspec code with :focus blocks - flags all rspec example blocks with that include `focus: true` + flags all rspec example blocks that include `:focus` + does not flag unfocused specs with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation - autocorrects `expect(current_path).to(eq(expected_path))` to `expect(page).to(have_current_path(expected_path, ignore_query: true))` - autocorrects `expect(page.current_path)` to `expect(page.current_path)` - flags violations for `expect(current_path)` - autocorrects `expect(current_path).to_not eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` - autocorrects `expect(current_path).to eq(expected_path)` to `expect(page).to have_current_path(expected_path, ignore_query: true)` - doesn't flag a violation for other references to `current_path` - autocorrects `expect(page.current_path).to match(/regexp/i)` to `expect(page).to have_current_path(/regexp/i)` - autocorrects `expect(current_path).to eq expected_path` to `expect(page).to have_current_path expected_path, ignore_query: true` - flags violations for `expect(page.current_path)` - autocorrects `expect(page.current_path).to eq(foo(bar).path)` to `expect(page).to have_current_path(foo(bar).path, ignore_query: true)` - doesn't flag a violation for other expectations - autocorrects `expect(page.current_path).to match(variable)` to `expect(page.current_path).to match(variable)` - autocorrects `expect(page.current_path).to match("string/")` to `expect(page).to have_current_path(/string\//)` - autocorrects `expect(current_path).not_to eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` - autocorrects `expect(current_path).to eq(expected_path(f: :b))` to `expect(page).to have_current_path(expected_path(f: :b), ignore_query: true)` +RuboCop::Cop::RSpec::Pending + ignores example + flags xspecify + flags skip blocks + ignores feature + flags skip inside of an it + ignores scenario + flags xit + flags xcontext + flags pending examples when receiver is explicit + flags xdescribe + ignores method called pending + ignores specify + ignores context + ignores it + ignores it with skip: false metadata + ignores describe + flags xfeature + flags blocks with skip: string metadata + ignores example_group + flags blocks with pending symbol metadata + flags blocks with skip: true metadata + flags xscenario + flags blocks with skip symbol metadata + flags describe with skip symbol metadata + flags pending blocks + flags xexample with default configuration + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::ReceiveCounts - flags usage of `exactly(1).times` - flags usage of `exactly(1).times` after `with` - flags usage of `exactly(1).times` with return value - allows `exactly(3).times` - flags usage of `at_least(2).times` - allows exactly(1).times when not called on `receive` - flags usage of `exactly(1).times` with a block - flags usage of `at_least(1).times` - allows `exactly(n).times` - flags usage of `at_most(1).times` - flags usage of `at_least(2).times` with a block - autocorrects `expect(foo).to have_published_event(:bar).exactly(2).times` to `expect(foo).to have_published_event(:bar).exactly(2).times` - flags usage of `at_most(2).times` - flags usage of `exactly(2).times` +Weirdness + is empty + works + isnt a simple string + quotes a string weird + has a description too + it does a thing + example at ./spec/smoke_tests/weird_rspec_spec.rb:37 + example at ./spec/smoke_tests/weird_rspec_spec.rb:176 + uses a matcher + example at ./spec/smoke_tests/weird_rspec_spec.rb:51 + isnt a simple string + example at ./spec/smoke_tests/weird_rspec_spec.rb:130 + is expecting you not to raise an error + has chained expectations + should not do the thing + is expecting you + It does a thing + example at ./spec/smoke_tests/weird_rspec_spec.rb:36 + who + who + lets the word 'who' be 'who' + dynamic + dynamic + lets the word 'dynamic' be 'dynamic' + examples + examples + lets the word 'examples' be 'examples' + likes + likes + lets the word 'likes' be 'likes' + +RuboCop::Cop::RSpec::DescribeMethod + ignores describes with only a class + skips specs not having a string second argument + enforces non-method names + skips methods starting with a . or # with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::SingleArgumentMessageChain - receive_message_chain - reports single-argument string calls - accepts single-argument calls with variable - accepts single-argument calls with send node - reports single-argument calls - accepts multi-argument calls - accepts multi-argument string calls - with single-element array argument - reports an offense - with multiple keys hash argument - doesn't report an offense - with single-key hash argument - reports an offense - with multiple-element array argument - doesn't report an offense - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - stub_chain - reports single-argument string calls - accepts multi-argument calls - reports single-argument calls - accepts multi-argument string calls -RuboCop::Cop::RSpec::SharedExamples - registers an offense when using symbolic title - does not register an offense when using Module/Class title - does not register an offense when using string title +RuboCop::RSpec::Wording + rewrites "shouldn't return something" as "does not return something" + rewrites "should worry about the future" as "worries about the future" + rewrites "should echo the input" as "echoes the input" + rewrites "should miss me" as "misses me" + rewrites "should return something" as "returns something" + rewrites "should" as "" + rewrites "should WORRY" as "WORRIES" + rewrites "should fizz" as "fizzes" + rewrites "should do nothing" as "does nothing" + rewrites "should not" as "does not" + rewrites "should alias the method" as "aliases the method" + rewrites "should amass debt" as "amasses debt" + rewrites "should search the internet" as "searches the internet" + rewrites "should WISH me luck" as "WISHES me luck" + rewrites "" as "" + rewrites "should wish me luck" as "wishes me luck" + rewrites "SHOULDN'T BE true" as "IS NOT true" + rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" + rewrites "should not return something" as "does not return something" + rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" + rewrites "should obey my orders" as "obeys my orders" + rewrites "should buy the product" as "buys the product" + rewrites "shouldn't be true" as "is not true" + rewrites "should really only return one item" as "really only returns one item" + rewrites "should pay for pizza" as "pays for pizza" + rewrites "shouldn't" as "does not" + rewrites "should have sweets" as "has sweets" + rewrites "should fax the document" as "faxes the document" + rewrites "should deploy the app" as "deploys the app" + +config/default.yml + sorts configuration keys alphabetically + has configuration for all cops + ends every description with a period + has descriptions for all cops + includes Enabled: true for every cop + does not have newlines in cop descriptions + +RuboCop::Cop::RSpec::ExpectActual + flags boolean literal values within expect(...) + flags regexps containing only literal values within expect(...) + flags numeric literal values within expect(...) + flags string and symbol literal values within expect(...) + flags with `equal` matcher + flags hashes containing only literal values within expect(...) + flags literal nil value within expect(...) + flags but does not autocorrect violations for other matchers + does not flag complex values with dynamic parts within expect(...) + does not flag dynamic values within expect(...) + flags `be` with an argument + flags arrays containing only literal values within expect(...) + flags with `eql` matcher + flags `be ==` + ignores `be` with no argument + flags ranges containing only literal values within expect(...) with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + when inspecting rspec-rails routing specs + ignores rspec-rails routing specs -RuboCop::Cop::RSpec::FilePath - registers an offense for a wrong class name - uses relative path for sibling directory project - allows bang method - skips specs that do not describe a class / method - registers an offense for a file missing a .rb - handles CamelCaps class names - registers an offense for a wrong class but a correct method - handles ACRONYMClassNames - allows flat hierarchies for instance methods - handles alphanumeric class names - registers an offense for a bad path - skips specs that do have multiple top level describes - registers an offense for a file missing _spec - allows subdirs for instance methods - uses relative path for different path project - ignores non-alphanumeric characters - registers an offense for a repeated .rb - registers an offense for a wrong class and highlights metadata - allows flexibility with operators - allows flexibility with predicates - allows flat hierarchies for class methods - handles ALLCAPS class names - allows different parent directories - checks instance methods - registers an offense for a wrong class name with a symbol argument - checks class specs - allows subdirs for class methods - uses relative path - checks class methods +RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation + autocorrects `expect(page.current_path).to match(/regexp/i)` to `expect(page).to have_current_path(/regexp/i)` + autocorrects `expect(current_path).not_to eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` + autocorrects `expect(page.current_path).to match("string/")` to `expect(page).to have_current_path(/string\//)` + flags violations for `expect(page.current_path)` + autocorrects `expect(page.current_path).to match(variable)` to `expect(page.current_path).to match(variable)` + autocorrects `expect(current_path).to(eq(expected_path))` to `expect(page).to(have_current_path(expected_path, ignore_query: true))` + flags violations for `expect(current_path)` + autocorrects `expect(current_path).to_not eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` + autocorrects `expect(page.current_path).to eq(foo(bar).path)` to `expect(page).to have_current_path(foo(bar).path, ignore_query: true)` + doesn't flag a violation for other references to `current_path` + autocorrects `expect(page.current_path)` to `expect(page.current_path)` + autocorrects `expect(current_path).to eq expected_path` to `expect(page).to have_current_path expected_path, ignore_query: true` + autocorrects `expect(current_path).to eq(expected_path(f: :b))` to `expect(page).to have_current_path(expected_path(f: :b), ignore_query: true)` + doesn't flag a violation for other expectations + autocorrects `expect(current_path).to eq(expected_path)` to `expect(page).to have_current_path(expected_path, ignore_query: true)` with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when configured with SpecSuffixOnly - does not care about the described class - registers an offense when _spec.rb suffix is missing - when configured with IgnoreMethods - does not care about the described method - when configured with CustomTransform - ignores routing specs - respects custom module name transformation -RuboCop::Cop::RSpec::ExampleWording - finds leading it in interpolated description - flags a lone should not - skips descriptions without `should` at the beginning - finds interpolated description with `should` at the beginning - finds description with `should` at the beginning - flags a lone should - finds leading its - finds description with `shouldn't` at the beginning - flags \-separated multiline interpolated strings - skips interpolated description without literal `should` at the start - ignores non-example blocks - skips descriptions starting with words that begin with `should` - finds description with `SHOULDN'T` at the beginning - finds description with `Should` at the beginning - skips words beginning with 'it' - flags \-separated multiline strings +RuboCop::Cop::RSpec::HookArgument with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when EnforcedStyle is :example + generates a todo based on the detected style + ignores non-rspec hooks + generates a todo based on the detected style + autocorrects `before(:example) { }` to `before(:example) { }` + autocorrects `before(:each) { }` to `before(:example) { }` + generates a todo based on the detected style + does not flag hooks without default scopes + autocorrects `config.before(:each) { }` to `config.before(:example) { }` + ignores :context and :suite + detects :example for hooks + detects :each for hooks + autocorrects `config.before { }` to `config.before(:example) { }` + ignores hooks with more than one argument + autocorrects `config.before(:example) { }` to `config.before(:example) { }` + autocorrects `before { }` to `before(:example) { }` + when EnforcedStyle is :implicit + detects :example for hooks + autocorrects `before { }` to `before { }` + does not flag hooks without default scopes + generates a todo based on the detected style + autocorrects `before(:example) { }` to `before { }` + detects :each for hooks + autocorrects `config.before { }` to `config.before { }` + ignores non-rspec hooks + ignores :context and :suite + autocorrects `before(:each) { }` to `before { }` + ignores hooks with more than one argument + generates a todo based on the detected style + autocorrects `config.before(:each) { }` to `config.before { }` + generates a todo based on the detected style + autocorrects `config.before(:example) { }` to `config.before { }` + when EnforcedStyle is :each + detects hooks without default scopes + autocorrects `config.before(:example) { }` to `config.before(:each) { }` + autocorrects `before(:each) { }` to `before(:each) { }` + generates a todo based on the detected style + autocorrects `config.before(:each) { }` to `config.before(:each) { }` + ignores non-rspec hooks + ignores hooks with more than one argument + generates a todo based on the detected style + detects :example for hooks + generates a todo based on the detected style + autocorrects `before { }` to `before(:each) { }` + autocorrects `before(:example) { }` to `before(:each) { }` + detects :each for hooks + ignores :context and :suite + autocorrects `config.before { }` to `config.before(:each) { }` -RuboCop::Cop::RSpec::EmptyLineAfterSubject - approves empty line after subject - handles subject being the latest node - checks for empty line after subject - checks for empty line after subject! - approves empty line after subject! - handles multiline subject block - handles subjects in tests +RuboCop::Cop::RSpec::LeakyConstantDeclaration + constant assignment + flags inside an example group + flags inside shared example group + flags inside an example + ignores outside of example/shared group + class defined + flags inside an example group + flags namespaced class + ignores anonymous classes with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + module defined + flags inside an example group -RuboCop::RSpec::ExampleGroup - exposes examples in scope - -RuboCop::Cop::RSpec::VoidExpect - accepts non-void `expect` with block - registers offenses to void `expect` with block - accepts non-void `expect` - registers offenses to void `expect` - registers offenses to void `expect` when block has one expression +RuboCop::Cop::RSpec::Cop + when the source path starts with `spec/` + registers an offense + when the source path ends with `_spec.rb` + ignores the file if it is ignored + registers an offense + when custom patterns are specified + registers offenses when the path matches a custom specified pattern + when the file is a source file without "spec" in the name + ignores the source when the path is not a specified pattern + ignores the source when the path is not a spec file with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - -Project requires - alphabetizes cop requires + when the source path contains `/spec/` + registers an offense -RuboCop::Cop::RSpec::RepeatedExampleGroupDescription - registers offense only for example group - does not register offense for describe block with several docstring - registers an offense for repeated describe descriptions - does not register offense for describe block with additional docstring - registers offense correctly for interpolated docstrings - registers an offense for repeated context descriptions - registers an offense with right pointing to lines of code - considers interpolated docstrings as different descriptions - registers offense only for RSPEC namespace example groups - register offense for different example group with similar descriptions - does not register offense for different block descriptions - registers offense only for RSPEC namespace example groups in any order - considers different classes as different descriptions - register offense if same method used in docstring - registers offense correctly if example groups are separated - does not register offense for example group without descriptions +RuboCop::Cop::RSpec::VariableName with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - -RuboCop::Cop::RSpec::VariableName + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb when configured for `camelCase` - when `subject!` - registers an offense for snake_case + when `let` does not register offense for camelCase + registers an offense for snake_case when `let!` does not register offense for camelCase registers an offense for snake_case - when `subject` - does not register offense for camelCase + when `subject!` registers an offense for snake_case - when `let` + does not register offense for camelCase + when `subject` registers an offense for snake_case does not register offense for camelCase - with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb when configured for `snake_case` when `let` with string names - registers an offense for kebab-case registers an offense for camelCase does not register an offense for snake_case does not register offense for interpolated string - when `subject!` - does not register offense for snake_case + registers an offense for kebab-case + when `let` with symbol names + registers an offense for PascalCase + registers offense with multiple lets + does not register an offense for snake_case registers an offense for camelCase + does not register offense for interpolated symbol + when `let` with proc + registers offense when `let!` does not register offense for snake_case registers an offense for camelCase when `subject` - registers an offense for camelCase does not register offense for snake_case - when `let` with proc - registers offense - when `let` with symbol names - does not register an offense for snake_case - registers offense with multiple lets registers an offense for camelCase - registers an offense for PascalCase - does not register offense for interpolated symbol - -RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically - accepts valid traits_for_enum definition - registers an offense in a transient block - registers an offense for attributes defined on explicit receiver - autocorrects ` FactoryBot.define do - factory :post do - title "Something" - comments_count 0 - tag Tag::MAGIC - recent_statuses [] - status([:draft, :published].sample) - published_at 1.day.from_now - created_at(1.day.ago) - updated_at Time.current - update_times [Time.current] - meta_tags(foo: Time.current) - other_tags({ foo: Time.current }) - options color: :blue - other_options Tag::MAGIC => :magic - self.end Date.tomorrow + when `subject!` + registers an offense for camelCase + does not register offense for snake_case - trait :old do - published_at 1.week.ago - end - end - end -` to ` FactoryBot.define do - factory :post do - title { "Something" } - comments_count { 0 } - tag { Tag::MAGIC } - recent_statuses { [] } - status { [:draft, :published].sample } - published_at { 1.day.from_now } - created_at { 1.day.ago } - updated_at { Time.current } - update_times { [Time.current] } - meta_tags { { foo: Time.current } } - other_tags { { foo: Time.current } } - options { { color: :blue } } - other_options { { Tag::MAGIC => :magic } } - self.end { Date.tomorrow } +RuboCop::Cop::RSpec::ImplicitBlockExpectation + flags lambda in subject! + flags with `should_not` as implicit subject + flags with `should` as implicit subject + flags proc + ignores named subject with deeply nested lambda + ignores non-lambda subject + flags when subject is defined in the outer example group + ignores when there is no subject defined + ignores normal local subject + flags Proc.new + flags named subject + flags literal lambda + flags lambda in subject + with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb - trait :old do - published_at { 1.week.ago } - end - end - end -` - does not add offense if method called on another object - registers an offense for an attribute defined on `self` - accepts valid sequence definition - accepts valid association definitions - registers an offense in a trait - accepts valid factory definitions - registers an offense for offending code - does not add offense if out of factory bot block - does not add offense if method called on a local variable +RuboCop::Cop::RSpec::ExampleLength + allows an empty example + ignores comments + ignores non-spec blocks + allows a short example + with CountComments enabled + flags the example with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + when inspecting large examples + flags the example + +RuboCop::Cop::RSpec::ExampleWording + flags \-separated multiline strings + skips descriptions starting with words that begin with `should` + finds leading it in interpolated description + flags \-separated multiline interpolated strings + flags a lone should + ignores non-example blocks + skips descriptions without `should` at the beginning + finds description with `shouldn't` at the beginning + skips interpolated description without literal `should` at the start + finds description with `Should` at the beginning + finds interpolated description with `should` at the beginning + finds description with `should` at the beginning + finds leading its + finds description with `SHOULDN'T` at the beginning + flags a lone should not + skips words beginning with 'it' + with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + +RuboCop::Cop::RSpec::ScatteredLet + doesnt flag `let!` in the middle of multiple `let`s + flags `let` with proc argument + flags scattered `let!`s + flags `let` after the first different node + works with heredocs + flags `let` at different nesting levels + with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb RuboCop::Cop::RSpec::EmptyHook - with `append_after` hook - detects offense for empty `append_after` - accepts multiline `append_after` hook - accepts non-empty `append_after` hook + with `prepend_before` hook + accepts non-empty `prepend_before` hook + detects offense for empty `prepend_before` + accepts multiline `prepend_before` hook with `around` hook - detects offense for empty `around` accepts multiline `around` hook + detects offense for empty `around` accepts non-empty `around` hook + with `append_after` hook + detects offense for empty `append_after` + accepts non-empty `append_after` hook + accepts multiline `append_after` hook with `before` hook - detects offense for empty `before` with :each scope - detects offense for empty `before` + detects offense for empty `before` with :all scope + autocorrects `before` with semicolon detects offense for empty `before` with :example scope detects offense for empty `before` with :suite scope detects offense for empty `before` with :context scope - accepts non-empty `before` hook + detects offense for empty `before` + detects offense for empty `before` with :each scope accepts multiline `before` hook - detects offense for empty `before` with :all scope - autocorrects `before` with semicolon - with `prepend_before` hook - accepts multiline `prepend_before` hook - accepts non-empty `prepend_before` hook - detects offense for empty `prepend_before` - with `append_before` hook - detects offense for empty `append_before` - accepts non-empty `append_before` hook - accepts multiline `append_before` hook - with `after` hook - accepts non-empty `after` hook - detects offense for empty `after` - accepts multiline `after` hook + accepts non-empty `before` hook with `prepend_after` hook - detects offense for empty `prepend_after` accepts multiline `prepend_after` hook accepts non-empty `prepend_after` hook + detects offense for empty `prepend_after` + with `after` hook + accepts multiline `after` hook + detects offense for empty `after` + accepts non-empty `after` hook with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + with `append_before` hook + accepts multiline `append_before` hook + accepts non-empty `append_before` hook + detects offense for empty `append_before` -RuboCop::Cop::RSpec::InvalidPredicateMatcher - accepts valid predicate matcher - registers an offense for double question with `not_to` - registers an offense for double question - registers an offense for double question with `to_not` - registers an offense for double question with `have_something?` +RuboCop::Cop::RSpec::ItBehavesLike with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when the enforced style is `it_should_behave_like` + flags a violation for it_behaves_like + does not flag a violation for it_behaves_like + when the enforced style is `it_behaves_like` + does not flag a violation for it_behaves_like + flags a violation for it_should_behave_like -RuboCop::Cop::RSpec::AlignRightLetBrace - works with empty file - registers offense for unaligned braces - does not register offense for let with proc argument +RuboCop::Cop::RSpec::VariableDefinition with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when EnforcedStyle is `strings` + registers an offense for symbol name + registers an offense for interpolated symbol + does not register offense for string names + when EnforcedStyle is `symbols` + registers an offense for interpolated string + does not register offense for symbol names + registers an offense for string name + registers an offense for multiline string -RuboCop::Cop::RSpec::DescribedClass - when SkipBlocks is `false` - flags violations within all blocks - when EnforcedStyle is :described_class - takes class from innermost describe - ignores describe that do not reference to a class - accepts an empty block - flags the use of described class with nested namespace - ignores non-matching namespace - ignores non-matching namespace in usages - flags with metadata - flags the use of described class with module - flags for the use of the described class - ignores non-matching namespace defined on `describe` level - ignores if a local variable is part of the namespace - ignores violations within a hook scope change - ignores described class as string - ignores class if the scope is changing - ignores violations within a class scope change - flags the use of described class with namespace - ignores if `described_class` is a part of the constant - ignores subclasses +RubocopBug + has a single example + has an expectation + +RuboCop::Cop::RSpec::Rails::HttpStatus with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - when EnforcedStyle is :explicit - ignores violations within a hook scope change - flags the use of the described_class - ignores violations within a class scope change - ignores described_class as string - ignores describe that do not reference to a class - autocorrects corresponding - when SkipBlocks is `true` - ignores violations within non-rspec blocks - -RuboCop::RSpec::Language::SelectorSet - compares by value - composes sets - #node_pattern_union - builds a node pattern union - #block_pattern - builds a block matching pattern - #include? - returns true for selectors in the set - returns false for selectors not in the set - #node_pattern - builds a node pattern - #send_pattern - builds a send matching pattern + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + when EnforcedStyle is `numeric` + registers an offense when using symbolic value + does not register an offense when using allowed symbols + autocorrects `it { is_expected.to have_http_status :ok }` to `it { is_expected.to have_http_status 200 }` + autocorrects `it { is_expected.to have_http_status :not_found }` to `it { is_expected.to have_http_status 404 }` + does not register an offense when using numeric value + with parenthesis + autocorrects `it { is_expected.to have_http_status(:ok) }` to `it { is_expected.to have_http_status(200) }` + autocorrects `it { is_expected.to have_http_status(:not_found) }` to `it { is_expected.to have_http_status(404) }` + when EnforcedStyle is `symbolic` + does not register an offense when using custom HTTP code + autocorrects `it { is_expected.to have_http_status 404 }` to `it { is_expected.to have_http_status :not_found }` + does not register an offense when using symbolic value + autocorrects `it { is_expected.to have_http_status 200 }` to `it { is_expected.to have_http_status :ok }` + registers an offense when using numeric value + with parenthesis + autocorrects `it { is_expected.to have_http_status(404) }` to `it { is_expected.to have_http_status(:not_found) }` + autocorrects `it { is_expected.to have_http_status(200) }` to `it { is_expected.to have_http_status(:ok) }` -RuboCop::Cop::RSpec::EmptyExampleGroup - flags an empty context - does not flag include_examples - does not recognize custom include methods by default - flags an empty top level describe - does not flag methods matching example group names - when a custom include method is specified - does not flag an otherwise empty example group +RuboCop::Cop::RSpec::ExpectInHook + adds an offense for `expect` in `before` hook + adds an offense for `expect` in `around` hook + adds an offense for `expect` in `after` hook + accepts an empty `before` hook + adds an offense for `expect` with block in `before` hook + accepts `expect` in `it` + accepts `allow` in `before` hook with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::IteratedExpectation - ignores `each` without expectation - ignore `each` when the body does not contain only expectations - flags `each` with an expectation - ignores `each` when there is a negative expectation - flags `each` with multiple expectations - ignores assignments in the iteration - ignores `each` with expectation on property - flags `each` when expectation calls method with arguments +RuboCop::Cop::RSpec::AroundBlock + when #run is called + does not register an offense + when no value is yielded + registers an offense + when the hook is scoped with a symbol + registers an offense + when the yielded value is unused + registers an offense + when passed to another method + does not register an offense + when #call is called + does not register an offense + when used as a block arg + does not register an offense + when yielded to another block + does not register an offense with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when the yielded value is referenced but not used + registers an offense + when two values are yielded and the first is unused + registers an offense for the first argument + when a method other than #run or #call is called + registers an offense -RuboCop::Cop::RSpec::ExpectOutput - registers an offense for overwriting $stderr within an example scoped hook - does not flag assignments to $stdout in example_group scope - does not flag assignments to other global variables - does not flag assigns to $stdout when in the root scope - registers an offense for overwriting $stdout within an example - does not flag assignments to $stdout outside of example scope - does not register an offense for interacting with $stdout +RuboCop::Cop::RSpec::AnyInstance + finds `expect_any_instance_of` instead of an instance double + finds `allow_any_instance_of` instead of an instance double + finds old `any_instance` syntax instead of an instance double with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb RuboCop::Cop::RSpec::EmptyLineAfterFinalLet handles let being the latest node - ignores empty lines between the lets + handles silly HEREDOC syntax for let flags missing empty line after the comment that comes after last let handles silly HEREDOC offense - check for empty line after the last `let!` approves empty line after let - checks for empty line after last let handles multiline let block handles HEREDOC for let - checks for empty line after let with proc argument - handles let in tests - handles silly HEREDOC syntax for let + ignores empty lines between the lets allows comment followed by an empty line after let + checks for empty line after let with proc argument + checks for empty line after last let flags missing empty line after a multiline comment after last let + check for empty line after the last `let!` + handles let in tests with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - -RuboCop::Cop::RSpec::ExpectActual - flags arrays containing only literal values within expect(...) - flags hashes containing only literal values within expect(...) - flags `be` with an argument - does not flag complex values with dynamic parts within expect(...) - does not flag dynamic values within expect(...) - flags with `equal` matcher - flags ranges containing only literal values within expect(...) - flags `be ==` - flags boolean literal values within expect(...) - flags numeric literal values within expect(...) - flags but does not autocorrect violations for other matchers - flags literal nil value within expect(...) - flags string and symbol literal values within expect(...) - flags with `eql` matcher - ignores `be` with no argument - flags regexps containing only literal values within expect(...) - when inspecting rspec-rails routing specs - ignores rspec-rails routing specs - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - - is insane - -RuboCop::Cop::RSpec::PredicateMatcher - when enforced style is `explicit` - when strict is false - autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be_truthy` - registers an offense for a predicate mather - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be_truthy` - autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be_truthy` - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be_truthy` - autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be_truthy` - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be_truthy` - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be_truthy` - autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be_truthy` - autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be_truthy` - autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be_falsey` - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be_truthy` - autocorrects ` expect(foo).to be_all do |x| - x + 1 - x >= 2 - end -` to ` expect(foo.all? do |x| - x + 1 - x >= 2 - end).to be_truthy -` - registers an offense for a predicate mather with argument - registers an offense for a predicate matcher with a block - autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` - accepts built in matchers - accepts non-predicate matcher - autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be_truthy` - autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be_truthy` - when custom matchers are allowed - accepts custom allowed explicit matchers - when strict is true - registers an offense for a predicate mather - autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be(true)` - autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be(true)` - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` - registers an offense for a predicate matcher with a block - autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` - autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be(true)` - autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be(true)` - autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be(true)` - autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(true)` - autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be(true)` - accepts non-predicate matcher - autocorrects ` expect(foo).to be_all do |x| - x + 1 - x >= 2 - end -` to ` expect(foo.all? do |x| - x + 1 - x >= 2 - end).to be(true) -` - registers an offense for a predicate mather with argument - autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be(true)` - accepts built in matchers - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be(true)` - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` - when custom matchers are allowed - accepts custom allowed explicit matchers - when enforced style is `inflected` - when strict is true - accepts non-predicate method - autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` - accepts strict checking boolean matcher - autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` - autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` - autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` - autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` - registers an offense for a predicate method with a block - autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` - autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` - registers an offense for a predicate method with built-in equiv - accepts a predicate method that is not ckeced true/false - autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` - registers an offense for a predicate method in actual - autocorrects ` expect(foo.all? do |x| - x + 1 - x >= 2 - end).to be_truthy -` to ` expect(foo).to be_all do |x| - x + 1 - x >= 2 - end -` - autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` - autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` - autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` - autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` - autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` - autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` - autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` - autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` - autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` - registers an offense for a predicate method with argument - autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - when strict is false - autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` - autocorrects `expect(foo.empty?).not_to be(true)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` - autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).to be(true)` to `expect(foo).to be_empty` - autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` - autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` - autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` - autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` - autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` - registers an offense for a predicate method in actual - accepts non-predicate method - autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` - autocorrects ` expect(foo.all? do |x| - x + 1 - x >= 2 - end).to be_truthy -` to ` expect(foo).to be_all do |x| - x + 1 - x >= 2 - end -` - registers an offense for a predicate method with built-in equiv - autocorrects `expect(foo.empty?).to eq(true)` to `expect(foo).to be_empty` - autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` - autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` - autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` - autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - autocorrects `expect(foo.empty?).to be(false)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` - autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` - autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` - autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - registers an offense for a predicate method with a block - accepts a predicate method that is not ckeced true/false - autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` - registers an offense for a predicate method in actual - autocorrects `expect(foo.empty?).not_to be(false)` to `expect(foo).to be_empty` - registers an offense for a predicate method with argument - autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` +RuboCop::Cop::RSpec::DescribedClassModuleWrapping + registers an offense when RSpec.describe is nested within two modules + registers an offense when RSpec.describe is nested within a module + allows a describe block in the outermost scope + allows a module that does not contain RSpec.describe with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::RSpec::Example - returns nil for examples without doc strings - extracts doc string - extracts doc string for unimplemented examples - extracts interpolated doc string - returns node - extracts keywords - extracts implementation - extracts symbol doc string - extracts method doc string - value object semantics - computes #hash based on class and node - compares by value - can be used as a key in a hash - -RuboCop::Cop::RSpec::ItBehavesLike +RuboCop::Cop::RSpec::SharedContext with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when the enforced style is `it_should_behave_like` - does not flag a violation for it_behaves_like - flags a violation for it_behaves_like - when the enforced style is `it_behaves_like` - does not flag a violation for it_behaves_like - flags a violation for it_should_behave_like + shared_context + does not register an offense for `shared_context` with let + does not register an offense for empty contexts + does not register an offense for `shared_context` with subject + registers an offense for shared_context with only examples + does not register an offense for `shared_context` with before + shared_examples + registers an offense for shared_examples with only hooks + does not register an offense for empty examples + registers an offense for shared_examples with only subject + registers an offense for shared_examples with only let + does not register an offense for `shared_examples` with it -RuboCop::Cop::RSpec::SubjectStub - flags when there are several top level example groups - flags chain stubs - flags multiple-method stubs - flags when subject is stubbed and there are several named subjects in the same example group - ignores stub within context where subject name changed - flags when subject is mocked - ignores nested stubs when nested subject is anonymous - flags nested subject stubs when nested subject uses same name - flags negated runners - flags nested subject stubs - flags when subject is stubbed - flags when an unnamed subject is mocked - flags an expectation made on an unnamed subject - flags nested subject stubs when example group does not define subject - flags nested subject stubs when adjacent context redefines - flags deeply nested subject stubs - flags when an implicit subject is mocked - flags one-line expectcation syntax - flags stub inside all matcher - flags spy subject stubs - top level example groups - flags in top level fcontext - flags in top level shared_examples - flags in top level fdescribe - flags in top level xfeature - flags in top level ffeature - flags in top level shared_context - flags in top level feature - flags in top level context - flags in top level xcontext - flags in top level shared_examples_for - flags in top level describe - flags in top level example_group - flags in top level xdescribe +RuboCop::RSpec::ExampleGroup + exposes examples in scope + +RuboCop::Cop::RSpec::Be + allows `be` with an argument + registers an offense for `be` without an argument + registers an offense for not_to be + allows specific `be_` matchers with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::BeEql - does not register an offense for `eql` when argument is a string - registers an offense for `eql` when argument is an integer - does not register an offense for `eql` when expectation is negated - registers an offense for `eql` when argument is a boolean - registers an offense for `eql` when argument is nil - registers an offense for `eql` when argument is a float - registers an offense for `eql` when argument is a symbol +RuboCop::Cop::RSpec::NestedGroups + flags nested contexts + counts nesting correctly when non-spec nesting + support --auto-gen-config + ignores non-spec context methods with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::HooksBeforeExamples - does not flag hooks before the examples - ignores single-line example blocks - flags `after` after an example - does not flag `before` in a nested context - flags scoped hook after an example - flags `before` after `context` - flags `before` after `include_examples` - allows inclusion of context before hooks - flags `before` after `it` - with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + when configured with MaxNesting + emits a deprecation warning + when Max is configured as 2 + flags two levels of nesting -RuboCop::Cop::RSpec::BeforeAfterAll - when using before each - does not register an offense +RuboCop::Cop::RSpec::ExpectChange with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when using after all - registers an offense - when using before all - registers an offense - when using after each - does not register an offense - -CHANGELOG.md - has link definitions for all implicit links - entry - has a link to the contributors at the end - has a whitespace between the * and the body - link to related issue on github - has a valid URL - has a colon and a whitespace at the end - has an issue number prefixed with # - body - does not start with a lower case - ends with a punctuation - -RuboCop::Cop::RSpec::ExpectChange - with EnforcedStyle `block` - flags change matcher without block - flags change matcher when receiver is a variable - flags implicit block expectation syntax - ignores methods called change with EnforcedStyle `method_call` - ignores blocks that cannot be converted to obj/attribute pair ignores change method of object that happens to receive a block flags blocks that contain simple message sending + ignores blocks that cannot be converted to obj/attribute pair flags implicit block expectation syntax - with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - -RuboCop::Cop::RSpec::NamedSubject - when IgnoreSharedExamples is false - checks shared_examples for explicit subject usage - behaves like checking subject outside of shared examples - checks around(:each) for explicit subject usage - checks before and after for explicit subject usage - ignores subject when not wrapped inside a test - checks `it` and `specify` for explicit subject usage - with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - when IgnoreSharedExamples is true - ignores explicit subject in shared_examples - behaves like checking subject outside of shared examples - checks around(:each) for explicit subject usage - checks before and after for explicit subject usage - checks `it` and `specify` for explicit subject usage - ignores subject when not wrapped inside a test + with EnforcedStyle `block` + flags implicit block expectation syntax + flags change matcher without block + ignores methods called change + flags change matcher when receiver is a variable RuboCop::Cop::RSpec::NotToNot - when AcceptedMethod is `to_not` - detects the `not_to` offense on an expect block - detects the `not_to` offense - detects no offense when using `to_not` with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb when EnforcedStyle is `not_to` - detects the `to_not` offense on an expect block detects the `to_not` offense detects no offense when using `not_to` + detects the `to_not` offense on an expect block + when AcceptedMethod is `to_not` + detects no offense when using `to_not` + detects the `not_to` offense + detects the `not_to` offense on an expect block -RuboCop::RSpec::Wording - rewrites "shouldn't return something" as "does not return something" - rewrites "should WISH me luck" as "WISHES me luck" - rewrites "should miss me" as "misses me" - rewrites "should search the internet" as "searches the internet" - rewrites "should echo the input" as "echoes the input" - rewrites "should have sweets" as "has sweets" - rewrites "should" as "" - rewrites "should buy the product" as "buys the product" - rewrites "should really only return one item" as "really only returns one item" - rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" - rewrites "" as "" - rewrites "should fizz" as "fizzes" - rewrites "SHOULDN'T BE true" as "IS NOT true" - rewrites "should pay for pizza" as "pays for pizza" - rewrites "should not" as "does not" - rewrites "should deploy the app" as "deploys the app" - rewrites "should obey my orders" as "obeys my orders" - rewrites "shouldn't" as "does not" - rewrites "should wish me luck" as "wishes me luck" - rewrites "should alias the method" as "aliases the method" - rewrites "should amass debt" as "amasses debt" - rewrites "should worry about the future" as "worries about the future" - rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" - rewrites "should not return something" as "does not return something" - rewrites "shouldn't be true" as "is not true" - rewrites "should do nothing" as "does nothing" - rewrites "should WORRY" as "WORRIES" - rewrites "should return something" as "returns something" - rewrites "should fax the document" as "faxes the document" - -Weirdness - is empty - example at ./spec/smoke_tests/weird_rspec_spec.rb:176 - quotes a string weird - is expecting you not to raise an error - isnt a simple string - works - is expecting you - has a description too - should not do the thing - example at ./spec/smoke_tests/weird_rspec_spec.rb:51 - it does a thing - has chained expectations - isnt a simple string - example at ./spec/smoke_tests/weird_rspec_spec.rb:37 - It does a thing - example at ./spec/smoke_tests/weird_rspec_spec.rb:36 - uses a matcher - example at ./spec/smoke_tests/weird_rspec_spec.rb:130 - dynamic - dynamic - lets the word 'dynamic' be 'dynamic' - examples - examples - lets the word 'examples' be 'examples' - who - who - lets the word 'who' be 'who' - likes - likes - lets the word 'likes' be 'likes' - -config/default.yml - does not have newlines in cop descriptions - has configuration for all cops - includes Enabled: true for every cop - sorts configuration keys alphabetically - has descriptions for all cops - ends every description with a period - -RuboCop::Cop::RSpec::FactoryBot::FactoryClassName - when not passing block - flags passing a class - ignores passing class name +RuboCop::Cop::RSpec::Dialect + allows calling methods named context in examples + allows describe blocks + registers an offense for RSpec.context blocks + registers an offense for context blocks with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when passing block - ignores passing OpenStruct - flags passing a class from global namespace - ignores passing class name - flags passing a subclass - ignores passing Hash - flags passing a class + without preferred methods + allows all methods blocks -RuboCop::Cop::RSpec::LeakyConstantDeclaration - module defined - flags inside an example group - constant assignment - ignores outside of example/shared group - flags inside an example - flags inside an example group - flags inside shared example group - class defined - flags inside an example group - flags namespaced class - ignores anonymous classes +RuboCop::Cop::RSpec::ReturnFromStub + with EnforcedStyle `block` + ignores string with interpolation returned from method + finds static values returned from chained method + ignores multiple values being returned from method + ignores dynamic values returned from method + finds nil returned from method + finds hash with only static values returned from method + finds static values returned from method + finds concatenated strings with no variables with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::VariableDefinition - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when EnforcedStyle is `symbols` - registers an offense for multiline string - registers an offense for interpolated string - does not register offense for symbol names - registers an offense for string name - when EnforcedStyle is `strings` - registers an offense for symbol name - registers an offense for interpolated symbol - does not register offense for string names + with EnforcedStyle `and_return` + ignores hash with dynamic values returned from block + finds static values returned from block + finds array with only static values returned from block + ignores stubs without return value + finds static values in a block when there are chained methods + finds concatenated strings with no variables + finds hash with only static values returned from block + ignores array with dynamic values returned from block + finds empty values returned from block + ignores block returning string with interpolation + finds nested constants returned from block + ignores variables return from block + handles stubs in a method + ignores dynamic values returned from block + finds constants returned from block -RuboCop::Cop::RSpec::MissingExampleGroupArgument - accepts describe with an argument - checks first argument of context - accepts methods with a name like an example block - checks first argument of nested describe - checks first argument of describe +RuboCop::RSpec::Hook + extracts name + #metadata + extracts hash metadata with no scope given + extracts symbol metadata + extracts hash metadata + withstands no arguments + combines symbol and hash metadata + #knowable_scope? + knows the scope of a hook with a symbol literal + does not break if a hook is not given a symbol literal + knows the scope of a hook with no argument + knows the scope of a hook with hash metadata + #scope + classifies :each as an example hook + interprets after(:suite) { } as having scope suite + interprets before(:each) { } as having scope each + interprets around(:example) { } as having scope each + interprets before(:all) { } as having scope context + ignores other arguments to hooks + interprets around(:context) { } as having scope context + defaults to example hook with hash metadata + interprets after { } as having scope each + +RuboCop::Cop::RSpec::RepeatedExample + does not flag examples with different implementations + does not flag examples when different its arguments are used + does not register a violation if rspec tag magic is involved + registers an offense for repeated example + does not flag repeated examples in different scopes with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::ContextWording - finds context without separate `when` at the beginning - finds shared_context without `when` at the beginning - finds context without `when` at the beginning - skips describe blocks - skips descriptions beginning with 'when' +RuboCop::Cop::RSpec::SharedExamples + registers an offense when using symbolic title + does not register an offense when using Module/Class title + does not register an offense when using string title with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - with metadata hash - finds context without separate `when` at the beginning - when configured - finds context without allowed prefixes at the beginning - skips descriptions with allowed prefixes at the beginning - with symbol metadata - finds context without separate `when` at the beginning - with mixed metadata - finds context without separate `when` at the beginning - -RuboCop::RSpec::Hook - extracts name - #scope - interprets around(:example) { } as having scope each - interprets before(:each) { } as having scope each - ignores other arguments to hooks - interprets after(:suite) { } as having scope suite - interprets before(:all) { } as having scope context - interprets after { } as having scope each - classifies :each as an example hook - defaults to example hook with hash metadata - interprets around(:context) { } as having scope context - #knowable_scope? - does not break if a hook is not given a symbol literal - knows the scope of a hook with hash metadata - knows the scope of a hook with a symbol literal - knows the scope of a hook with no argument - #metadata - extracts hash metadata - withstands no arguments - extracts symbol metadata - combines symbol and hash metadata - extracts hash metadata with no scope given + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::DescribeMethod - skips specs not having a string second argument - ignores describes with only a class - enforces non-method names - skips methods starting with a . or # +RuboCop::Cop::RSpec::Capybara::FeatureMethods + autocorrects ` describe Foo do + background { } + end +` to ` describe Foo do + before { } + end +` + autocorrects ` describe Foo do + given!(:foo) { } + end +` to ` describe Foo do + let!(:foo) { } + end +` + flags violations for `background` + allows includes before the spec + ignores variables inside examples + ignores feature calls outside spec + flags violations for `scenario` + flags violations for `xscenario` + flags violations for `given` + autocorrects ` describe Foo do + given(:foo) { } + end +` to ` describe Foo do + let(:foo) { } + end +` + flags violations for `given!` + autocorrects ` describe Foo do + RSpec.feature { } + end +` to ` describe Foo do + RSpec.describe { } + end +` + autocorrects ` describe Foo do + scenario { } + end +` to ` describe Foo do + it { } + end +` + flags violations for `feature` + autocorrects ` describe Foo do + xscenario { } + end +` to ` describe Foo do + xit { } + end +` + with configured `EnabledMethods` + ignores usage of the enabled method + flags other methods with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::MessageSpies - when EnforcedStyle is have_received - flags expect(...).to_not receive - flags expect(...).not_to receive - flags expect(send).to receive - flags expect(const).to receive - approves of expect(...).to have_received - flags expect(...).to receive at_most - flags expect(ivar).to receive - generates a todo based on the detected style - generates a todo based on the detected style - flags expect(...).to receive with - flags expect(lvar).to receive - when EnforcedStyle is receive - flags expect(...).to have_received with - flags expect(send).to have_received - flags expect(const).to have_received - approves of expect(...).to receive - flags expect(...).not_to have_received - flags expect(...).to_not have_received - generates a todo based on the detected style - flags expect(ivar).to have_received - flags expect(lvar).to have_received - generates a todo based on the detected style - flags expect(...).to have_received at_most +RuboCop::Cop::RSpec::BeforeAfterAll + when using after each + does not register an offense + when using before all + registers an offense + when using before each + does not register an offense + when using after all + registers an offense with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::Be - registers an offense for not_to be - registers an offense for `be` without an argument - allows `be` with an argument - allows specific `be_` matchers +RuboCop::Cop::RSpec::ImplicitExpect + when EnforcedStyle is is_expected + approves of is_expected.not_to + approves of is_expected.to + generates a todo based on the detected style + flags it { should } + approves of is_expected.to_not + flags it { should_not } with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when EnforcedStyle is should + flags it { is_expected.not_to } + flags it { is_expected.to_not } + flags it { is_expected.to } + approves of should_not + approves of should + generates a todo based on the detected style + generates a todo based on the detected style -RuboCop::Cop::RSpec::RepeatedExampleGroupBody - does not register offense for different block body implementation - does not register offense for same examples with different data - does not register offense if no descriptions, but different body - registers an offense for several repeated context body - registers an offense for when module arg and namespace are identical - registers offense no descriptions and similar body - registers offense only for RSPEC namespace example groups in any order - registers an offense for repeated context body - does not register offense when module arg namespace is different - skips `skip` and `pending` statements - does not register offense for example groups in different groups - does not register offense if module arg is different - registers offense only for RSPEC namespace example groups - does not register offense if metadata is different - registers offense only for example group - registers offense for different groups - registers offense correctly if example groups are separated - does not register offense with several docstring - registers an offense for repeated describe body +RuboCop::Cop::RSpec::FilePath + uses relative path + handles ALLCAPS class names + checks class methods + registers an offense for a file missing _spec + registers an offense for a file missing a .rb + uses relative path for sibling directory project + allows subdirs for class methods + allows flat hierarchies for instance methods + registers an offense for a wrong class name + skips specs that do have multiple top level describes + skips specs that do not describe a class / method + allows bang method + handles CamelCaps class names + checks instance methods + checks class specs + handles alphanumeric class names + ignores non-alphanumeric characters + allows flexibility with operators + registers an offense for a wrong class but a correct method + registers an offense for a wrong class and highlights metadata + uses relative path for different path project + allows flexibility with predicates + registers an offense for a repeated .rb + allows subdirs for instance methods + handles ACRONYMClassNames + registers an offense for a wrong class name with a symbol argument + registers an offense for a bad path + allows flat hierarchies for class methods + allows different parent directories + when configured with IgnoreMethods + does not care about the described method + when configured with CustomTransform + ignores routing specs + respects custom module name transformation with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when configured with SpecSuffixOnly + does not care about the described class + registers an offense when _spec.rb suffix is missing -RuboCop::Cop::RSpec::ExpectInHook - adds an offense for `expect` in `around` hook - adds an offense for `expect` with block in `before` hook - accepts an empty `before` hook - accepts `expect` in `it` - accepts `allow` in `before` hook - adds an offense for `expect` in `after` hook - adds an offense for `expect` in `before` hook +RuboCop::Cop::RSpec::MultipleSubjects + does not try to autocorrect subject! + does not flag shared example groups + autocorrects + registers an offense for every overwritten subject with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::LeadingSubject - handles subjects in tests - handles subjects in contexts - checks subject below let with proc argument - checks subject below example - checks subject below let! - checks subject below hook - checks subject below let - approves of subject above let +RuboCop::Cop::RSpec::ImplicitSubject + with EnforcedStyle `single_statement_only` + allows `is_expected` in multi-line example with single statement + flags `is_expected` in multi-statement examples + with EnforcedStyle `disallow` + flags `should` in single-line examples + flags `is_expected` in multi-line examples + flags `is_expected` in single-line examples + allows `is_expected` inside `its` block + flags `should` in multi-line examples with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + with EnforcedStyle `single_line_only` + flags `should` in multi-line examples + allows `should` in single-line examples + allows `is_expected` inside `its` block, in multi-line examples + does not flag methods called is_expected and should + flags `is_expected` in multi-line examples + detects usage of `is_expected` inside helper methods + allows `is_expected` in single-line examples -RuboCop::Cop::RSpec::UnspecifiedException - with raise_exception matcher - allows empty exception specification when not expecting an error - allows exception matching regular expressions - allows exception types with matching regular expressions - allows classes with blocks with braces - allows exception messages - allows parameterized exceptions - allows classes with blocks with do/end - allows exception types with messages - detects the `unspecified_exception` offense - allows exception classes - with raise_error matcher - allows exception messages - allows exception classes - detects the `unspecified_exception` offense - allows exception types with matching regular expressions - allows classes with blocks with braces - allows classes with blocks with do/end - allows exception types with messages - allows exception matching regular expressions - allows parameterized exceptions - allows empty exception specification when not expecting an error +RuboCop::Cop::RSpec::LetSetup + ignores let! when used in example + complains when let! is used and not referenced within nested group + complains when let! used in shared example including + complains when there is only one nested node into example group + complains when let! is used and not referenced + complains when let! is used and not referenced in shared example group + complains when there is a custom nesting level + ignores let! when used in `before` with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::ReturnFromStub +RuboCop::Cop::RSpec::BeEql + does not register an offense for `eql` when argument is a string + registers an offense for `eql` when argument is a symbol + registers an offense for `eql` when argument is a boolean + registers an offense for `eql` when argument is nil + does not register an offense for `eql` when expectation is negated + registers an offense for `eql` when argument is a float + registers an offense for `eql` when argument is an integer with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - with EnforcedStyle `and_return` - handles stubs in a method - ignores stubs without return value - finds array with only static values returned from block - finds concatenated strings with no variables - finds empty values returned from block - ignores hash with dynamic values returned from block - finds hash with only static values returned from block - finds constants returned from block - finds static values in a block when there are chained methods - ignores block returning string with interpolation - ignores array with dynamic values returned from block - finds static values returned from block - ignores variables return from block - ignores dynamic values returned from block - finds nested constants returned from block - with EnforcedStyle `block` - ignores string with interpolation returned from method - finds hash with only static values returned from method - finds static values returned from chained method - finds nil returned from method - ignores dynamic values returned from method - finds concatenated strings with no variables - finds static values returned from method - ignores multiple values being returned from method -RuboCop::Cop::RSpec::MultipleDescribes - finds multiple top level describes with class and method - finds multiple top level describes only with class - skips single top level describe +RuboCop::Cop::RSpec::FactoryBot::FactoryClassName + when passing block + flags passing a subclass + flags passing a class + flags passing a class from global namespace + ignores passing Hash + ignores passing OpenStruct + ignores passing class name + when not passing block + flags passing a class + ignores passing class name with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - -RuboCop::Cop::RSpec::ContextMethod - ignores describe blocks - flags context with `.` at the beginning - flags context with `#` at the beginning - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb RuboCop::Cop::RSpec::MessageExpectation - when EnforcedStyle is expect - generates a todo based on the detected style - flags allow(...).to receive - approves of expect(...).to receive - generates a todo based on the detected style when EnforcedStyle is allow - approves of allow(...).to receive + generates a todo based on the detected style flags expect(...).to receive + approves of allow(...).to receive + generates a todo based on the detected style + when EnforcedStyle is expect + approves of expect(...).to receive + flags allow(...).to receive generates a todo based on the detected style generates a todo based on the detected style with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ScatteredSetup - flags hooks with similar metadata - flags multiple hooks in the same example group - flags multiple hooks of the same scope with different symbols - ignores hooks in different shared contexts - ignores different hooks - ignores different hook types - flags multiple before(:all) hooks in the same example group - ignores similar method names inside of examples - ignores hooks in different example groups - ignores hooks with different metadata +RuboCop::Cop::RSpec::VoidExpect + registers offenses to void `expect` + accepts non-void `expect` with block + registers offenses to void `expect` when block has one expression + registers offenses to void `expect` with block + accepts non-void `expect` with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::Dialect - allows describe blocks - registers an offense for RSpec.context blocks - allows calling methods named context in examples - registers an offense for context blocks - without preferred methods - allows all methods blocks +RuboCop::Cop::RSpec::Yield + ignores stub when `block.call` is not the only statement + flags multiple `block.call` with arguments + flags `block.call` + flags `block.call` when `receive` is chained + ignores `receive` with no block arguments + flags `block.call` with arguments + flags multiple `block.call` with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::DescribeSymbol - flags violations for `RSpec.describe :symbol` - does not flag non-Symbol arguments - flags violations for a nested `describe` - flags violations for `describe :symbol` with multiple arguments - flags violations for `describe :symbol` - does not flag `context :symbol` +RuboCop::Cop::RSpec::MultipleExpectations + generates a todo based on the worst violation + without configuration + flags multiple expects with blocks + flags multiple is_expected + flags multiple expect_any_instance_of + counts every aggregate_failures as an expectation + flags multiple expectations + counts aggregate_failures as one expectation + approves of one expectation per example + with Max configuration + permits two expectations + flags three expectations with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + with metadata + checks examples with siblings with `aggregate_failures: true` + ignores example groups with `aggregate_failures: true` + ignores examples with `aggregate_failures: true` defined deeply + ignores examples with `aggregate_failures: true` + prefers example metadata over example group metadata + checks example groups with `aggregate_failures: false` + ignores example groups with `:aggregate_failures` + ignores examples with `:aggregate_failures` + checks examples with `aggregate_failures: false` -RuboCop::Cop::RSpec::RepeatedDescription - registers offense for repeated description in same iterator - registers offense for repeated description and metadata - registers an offense for repeated descriptions - does not flag descriptions with different interpolated variables - does not flag different descriptions in different iterators - does not flag examples if metadata is different - does not flag tests which do not contain description strings - ignores repeated descriptions in a nested context - registers offense for repeated descriptions separated by a context - registers offense if same method used in docstring - ignores descriptions repeated in a shared context - registers offense for repeated description in different iterators - does not flag different methods used as docstring - does not flag examples with same metadata and different description +RuboCop::Cop::RSpec::FactoryBot::CreateList with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup - checks for empty line after context - checks for empty line after describe - approves empty line after describe - approves empty line after context - handles describes in an if block - highlights single line formulations correctly - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::FactoryBot::CreateList - with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when EnforcedStyle is :n_times - ignores create method of other object - flags usage of create_list - autocorrects `create_list :user, 5` to `5.times { create :user }` - flags usage of FactoryGirl.create_list with a block - autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` - autocorrects `create_list(:user, 5, :trait)` to `5.times { create(:user, :trait) }` - autocorrects `create_list :user, 5, :trait, key: val` to `5.times { create :user, :trait, key: val }` - flags usage of FactoryGirl.create_list when EnforcedStyle is :create_list - autocorrects ` 3.times do - create(:user, :trait) { |user| create :account, user: user } - end -` to ` create_list(:user, 3, :trait) { |user| create :account, user: user } -` ignores n.times when there is other calls but create + flags FactoryGirl.create calls with a block + ignores n.times when there is no create call inside autocorrects ` 3.times do create(:user, :trait) do |user| create :account, user: user @@ -2602,347 +2392,307 @@ create :profile, user: user end ` - flags usage of n.times with no arguments - autocorrects `5.times { create(:user, :trait) }` to `create_list(:user, 5, :trait)` autocorrects `5.times { create :user }` to `create_list :user, 5` ignores create in other block - ignores create method of other object - ignores n.times with argument - ignores n.times when there is no create call inside - flags FactoryGirl.create calls with a block flags usage of n.times when FactoryGirl.create is used + ignores n.times with argument + ignores create method of other object + autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` flags usage of n.times when FactoryBot.create is used + flags usage of n.times with no arguments + autocorrects `5.times { create(:user, :trait) }` to `create_list(:user, 5, :trait)` + autocorrects ` 3.times do + create(:user, :trait) { |user| create :account, user: user } + end +` to ` create_list(:user, 3, :trait) { |user| create :account, user: user } +` autocorrects `5.times { create :user, :trait, key: val }` to `create_list :user, 5, :trait, key: val` - autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` + when EnforcedStyle is :n_times + autocorrects `create_list :user, 5` to `5.times { create :user }` + flags usage of FactoryGirl.create_list + flags usage of create_list + ignores create method of other object + autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` + autocorrects `create_list(:user, 5, :trait)` to `5.times { create(:user, :trait) }` + flags usage of FactoryGirl.create_list with a block + autocorrects `create_list :user, 5, :trait, key: val` to `5.times { create :user, :trait, key: val }` -RuboCop::Cop::RSpec::DescribedClassModuleWrapping - registers an offense when RSpec.describe is nested within two modules - allows a describe block in the outermost scope - allows a module that does not contain RSpec.describe - registers an offense when RSpec.describe is nested within a module +RuboCop::Cop::RSpec::InstanceSpy + when not used with `have_received` + does not add an offence with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + when used with `have_received` + adds an offense for an instance_double with single argument + ignores instance_double when it is not used with as_null_object + adds an offense for an instance_double with multiple arguments -RuboCop::Cop::RSpec::DescribeClass - flags normal metadata in describe - ignores an empty describe - flags specs with non :type metadata - ignores system specs - ignores nested describe statements - ignores routing specs - supports ::RSpec.describe - doesn't flag top level describe in a shared context - checks describe statements after a require - doesn't flag top level describe in an unnamed shared context - ignores feature specs - checks first-line describe statements - ignores feature specs - also with complex options - doesn't blow up on single-line describes - supports RSpec.describe - ignores request specs - doesn't flag top level describe in a shared example - checks highlights the first argument of a describe - ignores view specs - ignores feature specs when RSpec.describe is used - when argument is a String literal - ignores value constants - ignores class with namespace - ignores class without namespace - checks empty strings - checks numbers at start - checks `camelCase` - ignores value constants with namespace - ignores top-level constants with `::` at start +RuboCop::Cop::RSpec::ContextWording + skips descriptions beginning with 'when' + finds context without `when` at the beginning + finds shared_context without `when` at the beginning + skips describe blocks + finds context without separate `when` at the beginning + when configured + finds context without allowed prefixes at the beginning + skips descriptions with allowed prefixes at the beginning + with symbol metadata + finds context without separate `when` at the beginning with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + with mixed metadata + finds context without separate `when` at the beginning + with metadata hash + finds context without separate `when` at the beginning -RuboCop::Cop::RSpec::InstanceVariable - flags an instance variable inside a describe - ignores instance variables outside of specs - flags an instance variable inside a shared example - ignores an instance variable inside a dynamic class - ignores non-spec blocks - ignores an instance variable without describe - flags several instance variables inside a describe - when used in a custom matcher - ignores instance variables inside `matcher` - ignores instance variables inside `RSpec::Matchers.define` - flags instance variables outside `matcher` +RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup + checks for empty line after describe + approves empty line after describe + handles describes in an if block + checks for empty line after context + approves empty line after context + highlights single line formulations correctly with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when configured with AssignmentOnly - ignores an instance variable when it is not assigned - flags an instance variable when it is also assigned - flags an instance variable when it is also assigned in a sibling example group + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::Pending - flags blocks with skip: string metadata - flags blocks with skip: true metadata - flags blocks with skip symbol metadata - flags pending blocks - flags xscenario - flags xdescribe - flags xfeature - flags skip blocks - ignores it with skip: false metadata - flags skip inside of an it - flags xexample - flags pending examples when receiver is explicit - ignores example - flags xit - ignores it - ignores example_group - ignores feature - ignores specify - flags xspecify - ignores describe - ignores context - ignores scenario - flags describe with skip symbol metadata - flags xcontext - ignores method called pending - flags blocks with pending symbol metadata +RuboCop::Cop::RSpec::MessageChain + finds `receive_message_chain` + finds old `stub_chain` syntax with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::VerifiedDoubles - finds a `double` instead of an `instance_double` - ignores instance_doubles - ignores doubles that have no name specified - when configured to ignore symbolic names - ignores doubles whose name is a symbol - still flags doubles whose name is a string - when configured not to ignore nameless doubles - flags doubles that have no name specified - when configuration does not specify IgnoreSymbolicNames - find doubles whose name is a symbol - finds a `spy` instead of an `instance_spy` +RuboCop::Cop::RSpec::ReceiveCounts + flags usage of `exactly(2).times` + flags usage of `at_most(1).times` + flags usage of `exactly(1).times` after `with` + flags usage of `at_least(1).times` + autocorrects `expect(foo).to have_published_event(:bar).exactly(2).times` to `expect(foo).to have_published_event(:bar).exactly(2).times` + allows `exactly(n).times` + flags usage of `at_most(2).times` + flags usage of `exactly(1).times` + allows `exactly(3).times` + flags usage of `at_least(2).times` with a block + flags usage of `exactly(1).times` with return value + allows exactly(1).times when not called on `receive` + flags usage of `at_least(2).times` + flags usage of `exactly(1).times` with a block with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::ExampleWithoutDescription - with EnforcedStyle `always_allow` - flags empty strings for description - ignores `it` without an argument - ignores `it` with a description - with EnforcedStyle `disallow` - flags missing description in multi-line examples - ignores `it` with a description - flags missing description in single-line examples - with EnforcedStyle `single_line_only` - flags example with an empty string for description - ignores missing description in single-line examples - flags missing description in multi-line examples +RuboCop::RSpec::DescriptionExtractor + builds a hash of descriptions + +RuboCop::Cop::RSpec::Capybara::VisibilityMatcher + registers an offense when using `visible: false` + does not register an offense when using `visible: :hidden` + does not register an offense when no options are given` + does not register an offense when using other options + registers an offense when using a selector` + does not register an offense when using `visible: :all` + does not register an offense when using multiple options + recognizes multiple matchers + registers an offense when using `visible: true` + registers an offense when using a using multiple options` + does not register an offense when using `visible: :visible` with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ImplicitExpect - when EnforcedStyle is should - approves of should - flags it { is_expected.to } - flags it { is_expected.to_not } - approves of should_not - flags it { is_expected.not_to } - generates a todo based on the detected style - generates a todo based on the detected style - when EnforcedStyle is is_expected - flags it { should } - approves of is_expected.not_to - approves of is_expected.to - approves of is_expected.to_not - flags it { should_not } - generates a todo based on the detected style +RuboCop::Cop::RSpec::ContextMethod + ignores describe blocks + flags context with `#` at the beginning + flags context with `.` at the beginning with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::Cop - when the source path ends with `_spec.rb` - registers an offense - ignores the file if it is ignored +RuboCop::Cop::RSpec::ExpectOutput + registers an offense for overwriting $stderr within an example scoped hook + registers an offense for overwriting $stdout within an example + does not flag assignments to other global variables + does not flag assignments to $stdout in example_group scope + does not flag assignments to $stdout outside of example scope + does not flag assigns to $stdout when in the root scope + does not register an offense for interacting with $stdout with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when custom patterns are specified - registers offenses when the path matches a custom specified pattern - when the source path starts with `spec/` - registers an offense - when the source path contains `/spec/` - registers an offense - when the file is a source file without "spec" in the name - ignores the source when the path is not a spec file - ignores the source when the path is not a specified pattern -RuboCop::RSpec::DescriptionExtractor - builds a hash of descriptions +RuboCop::Cop::RSpec::EmptyLineAfterSubject + checks for empty line after subject! + handles subjects in tests + approves empty line after subject! + checks for empty line after subject + handles subject being the latest node + approves empty line after subject + handles multiline subject block + with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::MultipleExpectations - generates a todo based on the worst violation - with Max configuration - flags three expectations - permits two expectations +CHANGELOG.md + has link definitions for all implicit links + entry + has a whitespace between the * and the body + has a link to the contributors at the end + body + does not start with a lower case + ends with a punctuation + link to related issue on github + has a colon and a whitespace at the end + has a valid URL + has an issue number prefixed with # + +RuboCop::Cop::RSpec::SingleArgumentMessageChain + with default configuration + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + stub_chain + reports single-argument calls + accepts multi-argument string calls + accepts multi-argument calls + reports single-argument string calls + receive_message_chain + reports single-argument string calls + accepts multi-argument calls + accepts single-argument calls with variable + reports single-argument calls + accepts multi-argument string calls + accepts single-argument calls with send node + with single-element array argument + reports an offense + with multiple-element array argument + doesn't report an offense + with multiple keys hash argument + doesn't report an offense + with single-key hash argument + reports an offense + +RuboCop::Cop::RSpec::MultipleDescribes + skips single top level describe + finds multiple top level describes only with class + finds multiple top level describes with class and method with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - with metadata - prefers example metadata over example group metadata - checks example groups with `aggregate_failures: false` - checks examples with siblings with `aggregate_failures: true` - ignores examples with `aggregate_failures: true` - ignores example groups with `aggregate_failures: true` - ignores examples with `aggregate_failures: true` defined deeply - checks examples with `aggregate_failures: false` - ignores example groups with `:aggregate_failures` - ignores examples with `:aggregate_failures` - without configuration - flags multiple expect_any_instance_of - approves of one expectation per example - counts every aggregate_failures as an expectation - flags multiple expectations - flags multiple expects with blocks - counts aggregate_failures as one expectation - flags multiple is_expected -RuboCop::Cop::RSpec::RepeatedExample - does not flag examples with different implementations - does not flag examples when different its arguments are used - does not flag repeated examples in different scopes - does not register a violation if rspec tag magic is involved - registers an offense for repeated example +RuboCop::Cop::RSpec::NamedSubject + when IgnoreSharedExamples is true + ignores explicit subject in shared_examples + behaves like checking subject outside of shared examples + checks before and after for explicit subject usage + ignores subject when not wrapped inside a test + checks `it` and `specify` for explicit subject usage + checks around(:each) for explicit subject usage + when IgnoreSharedExamples is false + checks shared_examples for explicit subject usage + behaves like checking subject outside of shared examples + checks `it` and `specify` for explicit subject usage + ignores subject when not wrapped inside a test + checks before and after for explicit subject usage + checks around(:each) for explicit subject usage with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RubocopBug - has an expectation - has a single example +RuboCop::Cop::RSpec::DescribeSymbol + flags violations for `RSpec.describe :symbol` + flags violations for `describe :symbol` + does not flag non-Symbol arguments + does not flag `context :symbol` + flags violations for `describe :symbol` with multiple arguments + flags violations for a nested `describe` + with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::AroundBlock - when the hook is scoped with a symbol - registers an offense - when passed to another method - does not register an offense - when the yielded value is referenced but not used - registers an offense - when yielded to another block - does not register an offense - when #call is called - does not register an offense +RuboCop::Cop::RSpec::LeadingSubject + handles subjects in contexts + checks subject below let + handles subjects in tests + checks subject below hook + checks subject below let with proc argument + checks subject below example + checks subject below let! + approves of subject above let with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when two values are yielded and the first is unused - registers an offense for the first argument - when #run is called - does not register an offense - when a method other than #run or #call is called - registers an offense - when the yielded value is unused - registers an offense - when no value is yielded - registers an offense - when used as a block arg - does not register an offense + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::HookArgument - when EnforcedStyle is :each - ignores :context and :suite - autocorrects `config.before(:each) { }` to `config.before(:each) { }` - autocorrects `config.before(:example) { }` to `config.before(:each) { }` - ignores hooks with more than one argument - autocorrects `before { }` to `before(:each) { }` - autocorrects `config.before { }` to `config.before(:each) { }` - ignores non-rspec hooks - generates a todo based on the detected style - detects :each for hooks - autocorrects `before(:example) { }` to `before(:each) { }` - autocorrects `before(:each) { }` to `before(:each) { }` - generates a todo based on the detected style - detects hooks without default scopes - generates a todo based on the detected style - detects :example for hooks - when EnforcedStyle is :implicit - autocorrects `config.before(:example) { }` to `config.before { }` - autocorrects `before(:example) { }` to `before { }` - autocorrects `before { }` to `before { }` - autocorrects `before(:each) { }` to `before { }` - detects :example for hooks - ignores hooks with more than one argument - ignores non-rspec hooks - generates a todo based on the detected style - autocorrects `config.before { }` to `config.before { }` - does not flag hooks without default scopes - generates a todo based on the detected style - detects :each for hooks - ignores :context and :suite - generates a todo based on the detected style - autocorrects `config.before(:each) { }` to `config.before { }` +RuboCop::Cop::RSpec::ReceiveNever + flags usage of `never` with `expect_any_instance_of` + flags usage of `never` with `is_expected` + allows method called `never` + flags usage of `never` + flags usage of `never` after `with` with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - when EnforcedStyle is :example - ignores :context and :suite - detects :example for hooks - autocorrects `before { }` to `before(:example) { }` - does not flag hooks without default scopes - generates a todo based on the detected style - ignores non-rspec hooks - ignores hooks with more than one argument - autocorrects `before(:each) { }` to `before(:example) { }` - detects :each for hooks - generates a todo based on the detected style - autocorrects `config.before(:example) { }` to `config.before(:example) { }` - generates a todo based on the detected style - autocorrects `before(:example) { }` to `before(:example) { }` - autocorrects `config.before { }` to `config.before(:example) { }` - autocorrects `config.before(:each) { }` to `config.before(:example) { }` -RuboCop::Cop::RSpec::Yield - flags `block.call` - ignores `receive` with no block arguments - ignores stub when `block.call` is not the only statement - flags `block.call` with arguments - flags multiple `block.call` - flags `block.call` when `receive` is chained - flags multiple `block.call` with arguments +RuboCop::Cop::RSpec::RepeatedExampleGroupDescription + does not register offense for example group without descriptions + registers offense correctly for interpolated docstrings + registers offense only for RSPEC namespace example groups in any order + registers an offense for repeated context descriptions + register offense for different example group with similar descriptions + registers an offense for repeated describe descriptions + considers interpolated docstrings as different descriptions + register offense if same method used in docstring + does not register offense for different block descriptions + registers offense correctly if example groups are separated + considers different classes as different descriptions + registers offense only for RSPEC namespace example groups + does not register offense for describe block with additional docstring + registers an offense with right pointing to lines of code + registers offense only for example group + does not register offense for describe block with several docstring with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb RuboCop::Cop::RSpec::LetBeforeExamples - does not flag `let` before the examples + flags `let` with proc argument + allows inclusion of context before `let` + ignores single-line example blocks + flags `let` after `include_examples` + flags `let` after `context` autocorrects ` RSpec.describe User do include_examples('should be after let') @@ -2959,273 +2709,558 @@ end ` flags `let` after `it` - flags `let` after `context` - allows inclusion of context before `let` - flags `let` after `include_examples` + does not flag `let` before the examples does not flag `let` in a nested context - flags `let` with proc argument - ignores single-line example blocks with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::ImplicitBlockExpectation - flags proc - flags named subject - ignores non-lambda subject - flags with `should_not` as implicit subject - ignores named subject with deeply nested lambda - flags when subject is defined in the outer example group - flags lambda in subject - flags Proc.new - flags lambda in subject! - flags literal lambda - flags with `should` as implicit subject - ignores normal local subject - ignores when there is no subject defined +RuboCop::Cop::RSpec::InvalidPredicateMatcher + accepts valid predicate matcher + registers an offense for double question with `to_not` + registers an offense for double question with `not_to` + registers an offense for double question with `have_something?` + registers an offense for double question with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + +RuboCop::Cop::RSpec::RepeatedExampleGroupBody + registers offense only for RSPEC namespace example groups + does not register offense for different block body implementation + does not register offense if no descriptions, but different body + registers an offense for repeated context body + registers an offense for repeated describe body + registers an offense for when module arg and namespace are identical + does not register offense for same examples with different data + does not register offense if metadata is different + does not register offense for example groups in different groups + registers offense only for example group + does not register offense when module arg namespace is different + registers an offense for several repeated context body + does not register offense if module arg is different + registers offense no descriptions and similar body + skips `skip` and `pending` statements + registers offense for different groups + registers offense correctly if example groups are separated + registers offense only for RSPEC namespace example groups in any order + does not register offense with several docstring + with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::AlignLeftLetBrace - does not register offense for let with proc argument - works with empty file - registers offense for unaligned braces +RuboCop::Cop::RSpec::MessageSpies + when EnforcedStyle is receive + generates a todo based on the detected style + flags expect(...).to have_received with + generates a todo based on the detected style + flags expect(send).to have_received + flags expect(...).to_not have_received + flags expect(lvar).to have_received + approves of expect(...).to receive + flags expect(...).not_to have_received + flags expect(...).to have_received at_most + flags expect(const).to have_received + flags expect(ivar).to have_received with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + when EnforcedStyle is have_received + flags expect(...).to_not receive + flags expect(...).not_to receive + flags expect(...).to receive at_most + flags expect(lvar).to receive + flags expect(ivar).to receive + approves of expect(...).to have_received + flags expect(...).to receive with + flags expect(send).to receive + flags expect(const).to receive + generates a todo based on the detected style + generates a todo based on the detected style -RuboCop::Cop::RSpec::MultipleSubjects - registers an offense for every overwritten subject - autocorrects - does not flag shared example groups - does not try to autocorrect subject! +RuboCop::Cop::RSpec::MissingExampleGroupArgument + checks first argument of context + accepts describe with an argument + checks first argument of nested describe + accepts methods with a name like an example block + checks first argument of describe with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::LetSetup - complains when let! is used and not referenced - complains when let! is used and not referenced within nested group - complains when let! is used and not referenced in shared example group - complains when there is a custom nesting level - complains when let! used in shared example including - ignores let! when used in `before` - complains when there is only one nested node into example group - ignores let! when used in example +RuboCop::Cop::RSpec::DescribedClass + when SkipBlocks is `false` + flags violations within all blocks + when SkipBlocks is `true` + ignores violations within non-rspec blocks + when EnforcedStyle is :explicit + ignores violations within a class scope change + flags the use of the described_class + autocorrects corresponding + ignores describe that do not reference to a class + ignores violations within a hook scope change + ignores described_class as string + when EnforcedStyle is :described_class + ignores non-matching namespace defined on `describe` level + ignores violations within a hook scope change + accepts an empty block + ignores if a local variable is part of the namespace + ignores if `described_class` is a part of the constant + ignores violations within a class scope change + takes class from innermost describe + ignores described class as string + flags the use of described class with module + flags for the use of the described class + flags the use of described class with nested namespace + ignores non-matching namespace + flags with metadata + flags the use of described class with namespace + ignores class if the scope is changing + ignores describe that do not reference to a class + ignores non-matching namespace in usages + ignores subclasses with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ExampleLength - allows a short example - ignores comments - ignores non-spec blocks - allows an empty example +RuboCop::Cop::RSpec::HooksBeforeExamples + does not flag hooks before the examples + flags `before` after `context` + does not flag `before` in a nested context + flags `before` after `include_examples` + flags scoped hook after an example + flags `after` after an example + ignores single-line example blocks + flags `before` after `it` + allows inclusion of context before hooks with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + +RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically + does not add offense if method called on another object + accepts valid traits_for_enum definition + registers an offense for attributes defined on explicit receiver + does not add offense if out of factory bot block + registers an offense in a trait + autocorrects ` FactoryBot.define do + factory :post do + title "Something" + comments_count 0 + tag Tag::MAGIC + recent_statuses [] + status([:draft, :published].sample) + published_at 1.day.from_now + created_at(1.day.ago) + updated_at Time.current + update_times [Time.current] + meta_tags(foo: Time.current) + other_tags({ foo: Time.current }) + options color: :blue + other_options Tag::MAGIC => :magic + self.end Date.tomorrow + + trait :old do + published_at 1.week.ago + end + end + end +` to ` FactoryBot.define do + factory :post do + title { "Something" } + comments_count { 0 } + tag { Tag::MAGIC } + recent_statuses { [] } + status { [:draft, :published].sample } + published_at { 1.day.from_now } + created_at { 1.day.ago } + updated_at { Time.current } + update_times { [Time.current] } + meta_tags { { foo: Time.current } } + other_tags { { foo: Time.current } } + options { { color: :blue } } + other_options { { Tag::MAGIC => :magic } } + self.end { Date.tomorrow } + + trait :old do + published_at { 1.week.ago } + end + end + end +` + accepts valid factory definitions + accepts valid association definitions + registers an offense for an attribute defined on `self` + accepts valid sequence definition + registers an offense in a transient block + registers an offense for offending code + does not add offense if method called on a local variable + with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - with CountComments enabled - flags the example - when inspecting large examples - flags the example + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::Rails::HttpStatus - when EnforcedStyle is `numeric` - registers an offense when using symbolic value - does not register an offense when using allowed symbols - autocorrects `it { is_expected.to have_http_status :not_found }` to `it { is_expected.to have_http_status 404 }` - does not register an offense when using numeric value - autocorrects `it { is_expected.to have_http_status :ok }` to `it { is_expected.to have_http_status 200 }` - with parenthesis - autocorrects `it { is_expected.to have_http_status(:ok) }` to `it { is_expected.to have_http_status(200) }` - autocorrects `it { is_expected.to have_http_status(:not_found) }` to `it { is_expected.to have_http_status(404) }` +Project requires + alphabetizes cop requires + +RuboCop::Cop::RSpec::SubjectStub + flags one-line expectcation syntax + flags when there are several top level example groups + flags nested subject stubs when nested subject uses same name + flags when subject is stubbed and there are several named subjects in the same example group + flags stub inside all matcher + flags nested subject stubs when example group does not define subject + ignores stub within context where subject name changed + flags chain stubs + flags deeply nested subject stubs + flags negated runners + flags when subject is mocked + flags when an unnamed subject is mocked + ignores nested stubs when nested subject is anonymous + flags an expectation made on an unnamed subject + flags nested subject stubs when adjacent context redefines + flags multiple-method stubs + flags when an implicit subject is mocked + flags spy subject stubs + flags nested subject stubs + flags when subject is stubbed with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when EnforcedStyle is `symbolic` - autocorrects `it { is_expected.to have_http_status 404 }` to `it { is_expected.to have_http_status :not_found }` - autocorrects `it { is_expected.to have_http_status 200 }` to `it { is_expected.to have_http_status :ok }` - does not register an offense when using custom HTTP code - registers an offense when using numeric value - does not register an offense when using symbolic value - with parenthesis - autocorrects `it { is_expected.to have_http_status(404) }` to `it { is_expected.to have_http_status(:not_found) }` - autocorrects `it { is_expected.to have_http_status(200) }` to `it { is_expected.to have_http_status(:ok) }` + top level example groups + flags in top level context + flags in top level fcontext + flags in top level xfeature + flags in top level describe + flags in top level example_group + flags in top level xcontext + flags in top level shared_examples_for + flags in top level fdescribe + flags in top level shared_context + flags in top level shared_examples + flags in top level xdescribe + flags in top level ffeature + flags in top level feature -RuboCop::Cop::RSpec::SharedContext - shared_context - registers an offense for shared_context with only examples - does not register an offense for `shared_context` with let - does not register an offense for empty contexts - does not register an offense for `shared_context` with subject - does not register an offense for `shared_context` with before + + is insane + +RuboCop::Cop::RSpec::EmptyLineAfterExample + flags one-line examples + flags a missing empty line after `it` + flags mixed one-line and multi-line examples + ignores when an empty line is present + flags a missing empty line after `specify` + ignores consecutive one-liners + when AllowConsecutiveOneLiners is false + ignores consecutive one-liners with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + +RuboCop::Cop::RSpec::EmptyLineAfterHook + checks for empty line after `around` hook + handles multiline `after` block + approves empty line after `around` hook + handles `before` being the latest node + handles multiline `before` block + handles multiline `around` block + checks for empty line after `after` hook + approves empty line after `before` hook + approves empty line after `after` hook + checks for empty line after `before` hook + with default configuration + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - shared_examples - registers an offense for shared_examples with only let - registers an offense for shared_examples with only hooks - does not register an offense for empty examples - does not register an offense for `shared_examples` with it - registers an offense for shared_examples with only subject + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::Capybara::VisibilityMatcher - recognizes multiple matchers - registers an offense when using `visible: false` - does not register an offense when using other options - does not register an offense when using `visible: :hidden` - registers an offense when using `visible: true` - does not register an offense when using `visible: :all` - registers an offense when using a using multiple options` - registers an offense when using a selector` - does not register an offense when using multiple options - does not register an offense when using `visible: :visible` - does not register an offense when no options are given` +RuboCop::Cop::RSpec::ExampleWithoutDescription + with EnforcedStyle `disallow` + ignores `it` with a description + flags missing description in multi-line examples + flags missing description in single-line examples + with EnforcedStyle `always_allow` + ignores `it` without an argument + ignores `it` with a description + flags empty strings for description + with EnforcedStyle `single_line_only` + ignores missing description in single-line examples + flags example with an empty string for description + flags missing description in multi-line examples with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::Capybara::FeatureMethods - autocorrects ` describe Foo do - given!(:foo) { } - end -` to ` describe Foo do - let!(:foo) { } - end -` - autocorrects ` describe Foo do - RSpec.feature { } - end -` to ` describe Foo do - RSpec.describe { } - end -` - ignores feature calls outside spec - ignores variables inside examples - flags violations for `background` - allows includes before the spec - flags violations for `feature` - flags violations for `scenario` - flags violations for `given` - flags violations for `given!` - autocorrects ` describe Foo do - xscenario { } - end -` to ` describe Foo do - xit { } - end -` - flags violations for `xscenario` - autocorrects ` describe Foo do - background { } - end -` to ` describe Foo do - before { } - end -` - autocorrects ` describe Foo do - given(:foo) { } - end -` to ` describe Foo do - let(:foo) { } - end -` - autocorrects ` describe Foo do - scenario { } - end -` to ` describe Foo do - it { } - end -` +RuboCop::Cop::RSpec::AlignLeftLetBrace + works with empty file + does not register offense for let with proc argument + registers offense for unaligned braces with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - with configured `EnabledMethods` - flags other methods - ignores usage of the enabled method + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb RuboCop::RSpec::ConfigFormatter builds a YAML dump with spacing between cops -RuboCop::Cop::RSpec::OverwritingSetup - handles dynamic names for `let` - finds overwriten `let` - ignores overwriting in different context - finds `let!` overwriting `let` - handles string arguments - finds overwriten `subject` - handles unnamed subjects - works with `subject!` and `let!` +RuboCop::Cop::RSpec::IteratedExpectation + ignore `each` when the body does not contain only expectations + ignores `each` when there is a negative expectation + flags `each` when expectation calls method with arguments + flags `each` with multiple expectations + ignores assignments in the iteration + flags `each` with an expectation + ignores `each` with expectation on property + ignores `each` without expectation with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::NestedGroups - flags nested contexts - ignores non-spec context methods - support --auto-gen-config - counts nesting correctly when non-spec nesting +RuboCop::Cop::RSpec::EmptyExampleGroup + flags an empty context + does not recognize custom include methods by default + flags an empty top level describe + does not flag methods matching example group names + does not flag include_examples with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when Max is configured as 2 - flags two levels of nesting - when configured with MaxNesting - emits a deprecation warning + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when a custom include method is specified + does not flag an otherwise empty example group -RuboCop::Cop::RSpec::EmptyLineAfterExample - ignores consecutive one-liners - ignores when an empty line is present - flags a missing empty line after `specify` - flags one-line examples - flags a missing empty line after `it` - flags mixed one-line and multi-line examples - when AllowConsecutiveOneLiners is false - ignores consecutive one-liners +RuboCop::Cop::RSpec::OverwritingSetup + handles unnamed subjects + handles string arguments + finds overwriten `subject` + works with `subject!` and `let!` + finds overwriten `let` + finds `let!` overwriting `let` + handles dynamic names for `let` + ignores overwriting in different context with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::MessageChain - finds `receive_message_chain` - finds old `stub_chain` syntax +RuboCop::Cop::RSpec::PredicateMatcher + when enforced style is `inflected` + when strict is false + autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` + autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` + registers an offense for a predicate method with built-in equiv + accepts non-predicate method + autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` + autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.empty?).to eq(true)` to `expect(foo).to be_empty` + autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` + autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` + autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` + autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` + autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` + autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` + registers an offense for a predicate method with a block + autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` + autocorrects `expect(foo.empty?).to be(false)` to `expect(foo).not_to be_empty` + autocorrects ` expect(foo.all? do |x| + x + 1 + x >= 2 + end).to be_truthy +` to ` expect(foo).to be_all do |x| + x + 1 + x >= 2 + end +` + autocorrects `expect(foo.empty?).to be(true)` to `expect(foo).to be_empty` + registers an offense for a predicate method in actual + autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` + autocorrects `expect(foo.empty?).not_to be(true)` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.empty?).not_to be(false)` to `expect(foo).to be_empty` + registers an offense for a predicate method with argument + registers an offense for a predicate method in actual + accepts a predicate method that is not ckeced true/false + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` + autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` + autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` + autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` + autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` + when strict is true + autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` + autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` + autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` + autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` + autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` + accepts non-predicate method + autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` + autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` + autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + accepts a predicate method that is not ckeced true/false + accepts strict checking boolean matcher + autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` + autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` + autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` + registers an offense for a predicate method with a block + autocorrects ` expect(foo.all? do |x| + x + 1 + x >= 2 + end).to be_truthy +` to ` expect(foo).to be_all do |x| + x + 1 + x >= 2 + end +` + autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` + autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` + registers an offense for a predicate method with built-in equiv + autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` + autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` + autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` + registers an offense for a predicate method with argument + autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` + registers an offense for a predicate method in actual + when enforced style is `explicit` + when strict is true + registers an offense for a predicate mather with argument + autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be(true)` + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be(true)` + autocorrects ` expect(foo).to be_all do |x| + x + 1 + x >= 2 + end +` to ` expect(foo.all? do |x| + x + 1 + x >= 2 + end).to be(true) +` + autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be(true)` + autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be(true)` + registers an offense for a predicate mather + autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` + autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be(true)` + autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be(true)` + registers an offense for a predicate matcher with a block + autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` + autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` + autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` + autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be(true)` + accepts built in matchers + accepts non-predicate matcher + autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(true)` + autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` + autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be(true)` + when custom matchers are allowed + accepts custom allowed explicit matchers + when strict is false + autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be_truthy` + autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be_truthy` + autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be_falsey` + accepts built in matchers + autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be_truthy` + registers an offense for a predicate matcher with a block + autocorrects ` expect(foo).to be_all do |x| + x + 1 + x >= 2 + end +` to ` expect(foo.all? do |x| + x + 1 + x >= 2 + end).to be_truthy +` + registers an offense for a predicate mather + autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be_truthy` + autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be_truthy` + autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be_truthy` + accepts non-predicate matcher + autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be_truthy` + registers an offense for a predicate mather with argument + autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be_truthy` + autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be_truthy` + autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be_truthy` + autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be_truthy` + autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be_truthy` + when custom matchers are allowed + accepts custom allowed explicit matchers with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + +RuboCop::Cop::RSpec::ScatteredSetup + flags hooks with similar metadata + flags multiple hooks of the same scope with different symbols + flags multiple hooks in the same example group + flags multiple before(:all) hooks in the same example group + ignores different hooks + ignores hooks with different metadata + ignores similar method names inside of examples + ignores hooks in different example groups + ignores different hook types + ignores hooks in different shared contexts + with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + +RuboCop::RSpec::Example + extracts interpolated doc string + extracts implementation + extracts doc string + extracts doc string for unimplemented examples + extracts keywords + extracts symbol doc string + extracts method doc string + returns node + returns nil for examples without doc strings + value object semantics + computes #hash based on class and node + compares by value + can be used as a key in a hash -Finished in 20.75 seconds (files took 3.42 seconds to load) +Finished in 29.94 seconds (files took 4.78 seconds to load) 1499 examples, 0 failures -Randomized with seed 5862 +Randomized with seed 64254 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -3257,12 +3292,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/2260/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/24159 and its subdirectories -I: Current time: Sun Oct 9 22:18:23 -12 2022 -I: pbuilder-time-stamp: 1665397103 +I: removing directory /srv/workspace/pbuilder/2260 and its subdirectories +I: Current time: Tue Sep 7 17:57:24 +14 2021 +I: pbuilder-time-stamp: 1630987044