Diff of the two buildlogs: -- --- b1/build.log 2021-06-23 17:01:30.532690477 +0000 +++ b2/build.log 2021-06-23 17:07:18.595579135 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Tue Jul 26 11:23:50 -12 2022 -I: pbuilder-time-stamp: 1658877830 +I: Current time: Thu Jun 24 07:01:33 +14 2021 +I: pbuilder-time-stamp: 1624467693 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bullseye-reproducible-base.tgz] I: copying local configuration @@ -17,8 +17,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.zsB8KHOr/trustedkeys.kbx': General error -gpgv: Signature made Fri Jul 24 06:26:59 2020 -12 +gpgv: keyblock resource '/tmp/dpkg-verify-sig.m2q6nHIz/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 @@ -30,137 +30,171 @@ 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/15580/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/9462/tmp/hooks/D01_modify_environment starting +debug: Running on ionos12-i386. +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/9462/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/9462/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='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=18' - DISTRIBUTION='' - HOME='/root' - HOST_ARCH='i386' + 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]="i686-pc-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=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=10' + DIRSTACK=() + DISTRIBUTION= + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='c92f3637bac0425d92e39ab43c4985a1' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - 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='15580' - PS1='# ' - PS2='> ' + INVOCATION_ID=260709f370e94cd8811dc21da6595c28 + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-pc-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=9462 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.X4HgadNZ7C/pbuilderrc_EGvQ --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.X4HgadNZ7C/b1 --logfile b1/build.log ruby-rubocop-rspec_1.42.0-1.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://85.184.249.68: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.X4HgadNZ7C/pbuilderrc_aFXK --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.X4HgadNZ7C/b2 --logfile b2/build.log --extrapackages usrmerge ruby-rubocop-rspec_1.42.0-1.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://78.137.99.97:3128 I: uname -a - Linux ionos16-i386 4.19.0-17-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux + Linux i-capture-the-hostname 4.19.0-17-686-pae #1 SMP Debian 4.19.194-1 (2021-06-10) i686 GNU/Linux I: ls -l /bin total 5776 - -rwxr-xr-x 1 root root 1367848 Jun 21 2021 bash - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bunzip2 - -rwxr-xr-x 3 root root 38280 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 38280 Jul 20 2020 bzip2 - -rwxr-xr-x 1 root root 17768 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 38824 Sep 22 2020 cat - -rwxr-xr-x 1 root root 71624 Sep 22 2020 chgrp - -rwxr-xr-x 1 root root 67528 Sep 22 2020 chmod - -rwxr-xr-x 1 root root 75752 Sep 22 2020 chown - -rwxr-xr-x 1 root root 157960 Sep 22 2020 cp - -rwxr-xr-x 1 root root 128724 Dec 10 2020 dash - -rwxr-xr-x 1 root root 124904 Sep 22 2020 date - -rwxr-xr-x 1 root root 92172 Sep 22 2020 dd - -rwxr-xr-x 1 root root 100752 Sep 22 2020 df - -rwxr-xr-x 1 root root 153964 Sep 22 2020 dir - -rwxr-xr-x 1 root root 83644 Feb 7 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 34664 Sep 22 2020 echo - -rwxr-xr-x 1 root root 28 Nov 9 2020 egrep - -rwxr-xr-x 1 root root 34664 Sep 22 2020 false - -rwxr-xr-x 1 root root 28 Nov 9 2020 fgrep - -rwxr-xr-x 1 root root 71928 Feb 7 2021 findmnt - -rwsr-xr-x 1 root root 30112 Feb 26 2021 fusermount - -rwxr-xr-x 1 root root 210488 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 100952 Mar 2 2021 gzip - -rwxr-xr-x 1 root root 21916 Nov 6 2019 hostname - -rwxr-xr-x 1 root root 83980 Sep 22 2020 ln - -rwxr-xr-x 1 root root 55572 Feb 7 2020 login - -rwxr-xr-x 1 root root 153964 Sep 22 2020 ls - -rwxr-xr-x 1 root root 153124 Feb 7 2021 lsblk - -rwxr-xr-x 1 root root 96328 Sep 22 2020 mkdir - -rwxr-xr-x 1 root root 79912 Sep 22 2020 mknod - -rwxr-xr-x 1 root root 47048 Sep 22 2020 mktemp - -rwxr-xr-x 1 root root 58920 Feb 7 2021 more - -rwsr-xr-x 1 root root 50720 Feb 7 2021 mount - -rwxr-xr-x 1 root root 13856 Feb 7 2021 mountpoint - -rwxr-xr-x 1 root root 157996 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 38824 Sep 22 2020 pwd - lrwxrwxrwx 1 root root 4 Jun 21 2021 rbash -> bash - -rwxr-xr-x 1 root root 46984 Sep 22 2020 readlink - -rwxr-xr-x 1 root root 75720 Sep 22 2020 rm - -rwxr-xr-x 1 root root 46984 Sep 22 2020 rmdir - -rwxr-xr-x 1 root root 22292 Sep 27 2020 run-parts - -rwxr-xr-x 1 root root 125036 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Jul 25 03:46 sh -> dash - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sleep - -rwxr-xr-x 1 root root 83880 Sep 22 2020 stty - -rwsr-xr-x 1 root root 79396 Feb 7 2021 su - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sync - -rwxr-xr-x 1 root root 602584 Feb 16 2021 tar - -rwxr-xr-x 1 root root 13860 Sep 27 2020 tempfile - -rwxr-xr-x 1 root root 108520 Sep 22 2020 touch - -rwxr-xr-x 1 root root 34664 Sep 22 2020 true - -rwxr-xr-x 1 root root 17768 Feb 26 2021 ulockmgr_server - -rwsr-xr-x 1 root root 30236 Feb 7 2021 umount - -rwxr-xr-x 1 root root 34664 Sep 22 2020 uname - -rwxr-xr-x 2 root root 2346 Mar 2 2021 uncompress - -rwxr-xr-x 1 root root 153964 Sep 22 2020 vdir - -rwxr-xr-x 1 root root 63024 Feb 7 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/15580/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1367848 Jun 22 16:25 bash + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bunzip2 + -rwxr-xr-x 3 root root 38280 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 38280 Jul 21 2020 bzip2 + -rwxr-xr-x 1 root root 17768 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 38824 Sep 23 2020 cat + -rwxr-xr-x 1 root root 71624 Sep 23 2020 chgrp + -rwxr-xr-x 1 root root 67528 Sep 23 2020 chmod + -rwxr-xr-x 1 root root 75752 Sep 23 2020 chown + -rwxr-xr-x 1 root root 157960 Sep 23 2020 cp + -rwxr-xr-x 1 root root 128724 Dec 11 2020 dash + -rwxr-xr-x 1 root root 124904 Sep 23 2020 date + -rwxr-xr-x 1 root root 92172 Sep 23 2020 dd + -rwxr-xr-x 1 root root 100752 Sep 23 2020 df + -rwxr-xr-x 1 root root 153964 Sep 23 2020 dir + -rwxr-xr-x 1 root root 83644 Feb 8 04:38 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 34664 Sep 23 2020 echo + -rwxr-xr-x 1 root root 28 Nov 10 2020 egrep + -rwxr-xr-x 1 root root 34664 Sep 23 2020 false + -rwxr-xr-x 1 root root 28 Nov 10 2020 fgrep + -rwxr-xr-x 1 root root 71928 Feb 8 04:38 findmnt + -rwsr-xr-x 1 root root 30112 Feb 27 06:12 fusermount + -rwxr-xr-x 1 root root 210488 Nov 10 2020 grep + -rwxr-xr-x 2 root root 2346 Mar 3 13:30 gunzip + -rwxr-xr-x 1 root root 6376 Mar 3 13:30 gzexe + -rwxr-xr-x 1 root root 100952 Mar 3 13:30 gzip + -rwxr-xr-x 1 root root 21916 Nov 8 2019 hostname + -rwxr-xr-x 1 root root 83980 Sep 23 2020 ln + -rwxr-xr-x 1 root root 55572 Feb 8 2020 login + -rwxr-xr-x 1 root root 153964 Sep 23 2020 ls + -rwxr-xr-x 1 root root 153124 Feb 8 04:38 lsblk + -rwxr-xr-x 1 root root 96328 Sep 23 2020 mkdir + -rwxr-xr-x 1 root root 79912 Sep 23 2020 mknod + -rwxr-xr-x 1 root root 47048 Sep 23 2020 mktemp + -rwxr-xr-x 1 root root 58920 Feb 8 04:38 more + -rwsr-xr-x 1 root root 50720 Feb 8 04:38 mount + -rwxr-xr-x 1 root root 13856 Feb 8 04:38 mountpoint + -rwxr-xr-x 1 root root 157996 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 38824 Sep 23 2020 pwd + lrwxrwxrwx 1 root root 4 Jun 22 16:25 rbash -> bash + -rwxr-xr-x 1 root root 46984 Sep 23 2020 readlink + -rwxr-xr-x 1 root root 75720 Sep 23 2020 rm + -rwxr-xr-x 1 root root 46984 Sep 23 2020 rmdir + -rwxr-xr-x 1 root root 22292 Sep 28 2020 run-parts + -rwxr-xr-x 1 root root 125036 Dec 23 2018 sed + lrwxrwxrwx 1 root root 4 Jun 24 07:04 sh -> bash + lrwxrwxrwx 1 root root 4 Jun 22 23:26 sh.distrib -> dash + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sleep + -rwxr-xr-x 1 root root 83880 Sep 23 2020 stty + -rwsr-xr-x 1 root root 79396 Feb 8 04:38 su + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sync + -rwxr-xr-x 1 root root 602584 Feb 17 23:55 tar + -rwxr-xr-x 1 root root 13860 Sep 28 2020 tempfile + -rwxr-xr-x 1 root root 108520 Sep 23 2020 touch + -rwxr-xr-x 1 root root 34664 Sep 23 2020 true + -rwxr-xr-x 1 root root 17768 Feb 27 06:12 ulockmgr_server + -rwsr-xr-x 1 root root 30236 Feb 8 04:38 umount + -rwxr-xr-x 1 root root 34664 Sep 23 2020 uname + -rwxr-xr-x 2 root root 2346 Mar 3 13:30 uncompress + -rwxr-xr-x 1 root root 153964 Sep 23 2020 vdir + -rwxr-xr-x 1 root root 63024 Feb 8 04:38 wdctl + lrwxrwxrwx 1 root root 8 Nov 8 2019 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Mar 3 13:30 zcat + -rwxr-xr-x 1 root root 1678 Mar 3 13:30 zcmp + -rwxr-xr-x 1 root root 5880 Mar 3 13:30 zdiff + -rwxr-xr-x 1 root root 29 Mar 3 13:30 zegrep + -rwxr-xr-x 1 root root 29 Mar 3 13:30 zfgrep + -rwxr-xr-x 1 root root 2081 Mar 3 13:30 zforce + -rwxr-xr-x 1 root root 7585 Mar 3 13:30 zgrep + -rwxr-xr-x 1 root root 2206 Mar 3 13:30 zless + -rwxr-xr-x 1 root root 1842 Mar 3 13:30 zmore + -rwxr-xr-x 1 root root 4553 Mar 3 13:30 znew +I: user script /srv/workspace/pbuilder/9462/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -354,7 +388,7 @@ Get: 144 http://deb.debian.org/debian bullseye/main i386 ruby-rspec-mocks all 3.9.0c2e2m1s3-2 [81.4 kB] Get: 145 http://deb.debian.org/debian bullseye/main i386 ruby-rspec all 3.9.0c2e2m1s3-2 [8348 B] Get: 146 http://deb.debian.org/debian bullseye/main i386 yard all 0.9.24-1 [387 kB] -Fetched 46.9 MB in 5s (10.3 MB/s) +Fetched 46.9 MB in 7s (7042 kB/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 ... 19675 files and directories currently installed.) @@ -962,8 +996,44 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +The following additional packages will be installed: + libfile-find-rule-perl libnumber-compare-perl libtext-glob-perl +The following NEW packages will be installed: + libfile-find-rule-perl libnumber-compare-perl libtext-glob-perl usrmerge +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Need to get 59.5 kB of archives. +After this operation, 157 kB of additional disk space will be used. +Get:1 http://deb.debian.org/debian bullseye/main i386 libnumber-compare-perl all 0.03-1.1 [6956 B] +Get:2 http://deb.debian.org/debian bullseye/main i386 libtext-glob-perl all 0.11-1 [8888 B] +Get:3 http://deb.debian.org/debian bullseye/main i386 libfile-find-rule-perl all 0.34-1 [30.6 kB] +Get:4 http://deb.debian.org/debian bullseye/main i386 usrmerge all 25 [13.0 kB] +debconf: delaying package configuration, since apt-utils is not installed +Fetched 59.5 kB in 0s (1054 kB/s) +Selecting previously unselected package libnumber-compare-perl. +(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 ... 29934 files and directories currently installed.) +Preparing to unpack .../libnumber-compare-perl_0.03-1.1_all.deb ... +Unpacking libnumber-compare-perl (0.03-1.1) ... +Selecting previously unselected package libtext-glob-perl. +Preparing to unpack .../libtext-glob-perl_0.11-1_all.deb ... +Unpacking libtext-glob-perl (0.11-1) ... +Selecting previously unselected package libfile-find-rule-perl. +Preparing to unpack .../libfile-find-rule-perl_0.34-1_all.deb ... +Unpacking libfile-find-rule-perl (0.34-1) ... +Selecting previously unselected package usrmerge. +Preparing to unpack .../archives/usrmerge_25_all.deb ... +Unpacking usrmerge (25) ... +Setting up libtext-glob-perl (0.11-1) ... +Setting up libnumber-compare-perl (0.03-1.1) ... +Setting up libfile-find-rule-perl (0.34-1) ... +Setting up usrmerge (25) ... +The system has been successfully converted. +Processing triggers for man-db (2.9.4-2) ... +Not building database; man-db/auto-update is not 'true'. 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 +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 dpkg-buildpackage: info: source package ruby-rubocop-rspec dpkg-buildpackage: info: source version 1.42.0-1 dpkg-buildpackage: info: source distribution unstable @@ -994,7 +1064,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/d20220726-23250-1kmhdv0/gemspec +/usr/bin/ruby2.7 -S gem build --config-file /dev/null --verbose /tmp/d20210624-24979-1p5ihq8/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: @@ -1013,7 +1083,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/d20220726-23250-1kmhdv0/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/d20210624-24979-1p5ihq8/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 @@ -1134,7 +1204,7 @@ rm -rf extensions cd gems/rubocop-rspec-1.42.0 rm -f -chmod 644 lib/rubocop/cop/rspec_cops.rb lib/rubocop/cop/rspec/empty_hook.rb lib/rubocop/cop/rspec/before_after_all.rb lib/rubocop/cop/rspec/nested_groups.rb lib/rubocop/cop/rspec/expect_output.rb lib/rubocop/cop/rspec/capybara/feature_methods.rb lib/rubocop/cop/rspec/capybara/visibility_matcher.rb lib/rubocop/cop/rspec/capybara/current_path_expectation.rb lib/rubocop/cop/rspec/yield.rb lib/rubocop/cop/rspec/repeated_example_group_body.rb lib/rubocop/cop/rspec/empty_line_after_example_group.rb lib/rubocop/cop/rspec/receive_counts.rb lib/rubocop/cop/rspec/shared_examples.rb lib/rubocop/cop/rspec/be.rb lib/rubocop/cop/rspec/describe_symbol.rb lib/rubocop/cop/rspec/around_block.rb lib/rubocop/cop/rspec/expect_in_hook.rb lib/rubocop/cop/rspec/any_instance.rb lib/rubocop/cop/rspec/instance_spy.rb lib/rubocop/cop/rspec/repeated_example_group_description.rb lib/rubocop/cop/rspec/predicate_matcher.rb lib/rubocop/cop/rspec/focus.rb lib/rubocop/cop/rspec/leaky_constant_declaration.rb lib/rubocop/cop/rspec/single_argument_message_chain.rb lib/rubocop/cop/rspec/dialect.rb lib/rubocop/cop/rspec/context_method.rb lib/rubocop/cop/rspec/multiple_describes.rb lib/rubocop/cop/rspec/missing_example_group_argument.rb lib/rubocop/cop/rspec/described_class_module_wrapping.rb lib/rubocop/cop/rspec/context_wording.rb lib/rubocop/cop/rspec/implicit_expect.rb lib/rubocop/cop/rspec/void_expect.rb lib/rubocop/cop/rspec/message_spies.rb lib/rubocop/cop/rspec/variable_name.rb lib/rubocop/cop/rspec/example_wording.rb lib/rubocop/cop/rspec/implicit_subject.rb lib/rubocop/cop/rspec/message_expectation.rb lib/rubocop/cop/rspec/verified_doubles.rb lib/rubocop/cop/rspec/repeated_description.rb lib/rubocop/cop/rspec/instance_variable.rb lib/rubocop/cop/rspec/describe_method.rb lib/rubocop/cop/rspec/multiple_expectations.rb lib/rubocop/cop/rspec/let_setup.rb lib/rubocop/cop/rspec/it_behaves_like.rb lib/rubocop/cop/rspec/example_length.rb lib/rubocop/cop/rspec/invalid_predicate_matcher.rb lib/rubocop/cop/rspec/shared_context.rb lib/rubocop/cop/rspec/scattered_let.rb lib/rubocop/cop/rspec/scattered_setup.rb lib/rubocop/cop/rspec/align_right_let_brace.rb lib/rubocop/cop/rspec/overwriting_setup.rb lib/rubocop/cop/rspec/named_subject.rb lib/rubocop/cop/rspec/multiple_subjects.rb lib/rubocop/cop/rspec/empty_line_after_final_let.rb lib/rubocop/cop/rspec/implicit_block_expectation.rb lib/rubocop/cop/rspec/example_without_description.rb lib/rubocop/cop/rspec/let_before_examples.rb lib/rubocop/cop/rspec/be_eql.rb lib/rubocop/cop/rspec/variable_definition.rb lib/rubocop/cop/rspec/pending.rb lib/rubocop/cop/rspec/expect_change.rb lib/rubocop/cop/rspec/expect_actual.rb lib/rubocop/cop/rspec/empty_line_after_subject.rb lib/rubocop/cop/rspec/return_from_stub.rb lib/rubocop/cop/rspec/empty_example_group.rb lib/rubocop/cop/rspec/repeated_example.rb lib/rubocop/cop/rspec/cop.rb lib/rubocop/cop/rspec/subject_stub.rb lib/rubocop/cop/rspec/message_chain.rb lib/rubocop/cop/rspec/rails/http_status.rb lib/rubocop/cop/rspec/file_path.rb lib/rubocop/cop/rspec/leading_subject.rb lib/rubocop/cop/rspec/hook_argument.rb lib/rubocop/cop/rspec/empty_line_after_example.rb lib/rubocop/cop/rspec/describe_class.rb lib/rubocop/cop/rspec/factory_bot/create_list.rb lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb lib/rubocop/cop/rspec/empty_line_after_hook.rb lib/rubocop/cop/rspec/unspecified_exception.rb lib/rubocop/cop/rspec/hooks_before_examples.rb lib/rubocop/cop/rspec/iterated_expectation.rb lib/rubocop/cop/rspec/not_to_not.rb lib/rubocop/cop/rspec/align_left_let_brace.rb lib/rubocop/cop/rspec/described_class.rb lib/rubocop/cop/rspec/receive_never.rb lib/rubocop/rspec.rb lib/rubocop/rspec/variable.rb lib/rubocop/rspec/wording.rb lib/rubocop/rspec/language.rb lib/rubocop/rspec/inject.rb lib/rubocop/rspec/example.rb lib/rubocop/rspec/concept.rb lib/rubocop/rspec/top_level_describe.rb lib/rubocop/rspec/node.rb lib/rubocop/rspec/final_end_location.rb lib/rubocop/rspec/align_let_brace.rb lib/rubocop/rspec/version.rb lib/rubocop/rspec/top_level_group.rb lib/rubocop/rspec/hook.rb lib/rubocop/rspec/blank_line_separation.rb lib/rubocop/rspec/language/node_pattern.rb lib/rubocop/rspec/corrector/move_node.rb lib/rubocop/rspec/config_formatter.rb lib/rubocop/rspec/description_extractor.rb lib/rubocop/rspec/factory_bot.rb lib/rubocop/rspec/example_group.rb lib/rubocop-rspec.rb +chmod 644 lib/rubocop/rspec/config_formatter.rb lib/rubocop/rspec/blank_line_separation.rb lib/rubocop/rspec/corrector/move_node.rb lib/rubocop/rspec/version.rb lib/rubocop/rspec/top_level_describe.rb lib/rubocop/rspec/hook.rb lib/rubocop/rspec/node.rb lib/rubocop/rspec/variable.rb lib/rubocop/rspec/description_extractor.rb lib/rubocop/rspec/align_let_brace.rb lib/rubocop/rspec/concept.rb lib/rubocop/rspec/top_level_group.rb lib/rubocop/rspec/language/node_pattern.rb lib/rubocop/rspec/example.rb lib/rubocop/rspec/inject.rb lib/rubocop/rspec/wording.rb lib/rubocop/rspec/factory_bot.rb lib/rubocop/rspec/final_end_location.rb lib/rubocop/rspec/language.rb lib/rubocop/rspec/example_group.rb lib/rubocop/rspec.rb lib/rubocop/cop/rspec/expect_actual.rb lib/rubocop/cop/rspec/not_to_not.rb lib/rubocop/cop/rspec/message_spies.rb lib/rubocop/cop/rspec/empty_line_after_example.rb lib/rubocop/cop/rspec/hooks_before_examples.rb lib/rubocop/cop/rspec/align_right_let_brace.rb lib/rubocop/cop/rspec/scattered_setup.rb lib/rubocop/cop/rspec/align_left_let_brace.rb lib/rubocop/cop/rspec/multiple_describes.rb lib/rubocop/cop/rspec/expect_output.rb lib/rubocop/cop/rspec/empty_line_after_hook.rb lib/rubocop/cop/rspec/rails/http_status.rb lib/rubocop/cop/rspec/let_before_examples.rb lib/rubocop/cop/rspec/variable_definition.rb lib/rubocop/cop/rspec/multiple_subjects.rb lib/rubocop/cop/rspec/context_method.rb lib/rubocop/cop/rspec/receive_never.rb lib/rubocop/cop/rspec/hook_argument.rb lib/rubocop/cop/rspec/variable_name.rb lib/rubocop/cop/rspec/around_block.rb lib/rubocop/cop/rspec/be.rb lib/rubocop/cop/rspec/any_instance.rb lib/rubocop/cop/rspec/scattered_let.rb lib/rubocop/cop/rspec/expect_change.rb lib/rubocop/cop/rspec/nested_groups.rb lib/rubocop/cop/rspec/describe_method.rb lib/rubocop/cop/rspec/empty_line_after_final_let.rb lib/rubocop/cop/rspec/repeated_description.rb lib/rubocop/cop/rspec/it_behaves_like.rb lib/rubocop/cop/rspec/named_subject.rb lib/rubocop/cop/rspec/example_wording.rb lib/rubocop/cop/rspec/message_chain.rb lib/rubocop/cop/rspec/void_expect.rb lib/rubocop/cop/rspec/receive_counts.rb lib/rubocop/cop/rspec/repeated_example_group_description.rb lib/rubocop/cop/rspec/example_without_description.rb lib/rubocop/cop/rspec/implicit_block_expectation.rb lib/rubocop/cop/rspec/instance_spy.rb lib/rubocop/cop/rspec/file_path.rb lib/rubocop/cop/rspec/verified_doubles.rb lib/rubocop/cop/rspec/leading_subject.rb lib/rubocop/cop/rspec/dialect.rb lib/rubocop/cop/rspec/pending.rb lib/rubocop/cop/rspec/instance_variable.rb lib/rubocop/cop/rspec/example_length.rb lib/rubocop/cop/rspec/message_expectation.rb lib/rubocop/cop/rspec/repeated_example_group_body.rb lib/rubocop/cop/rspec/subject_stub.rb lib/rubocop/cop/rspec/iterated_expectation.rb lib/rubocop/cop/rspec/invalid_predicate_matcher.rb lib/rubocop/cop/rspec/overwriting_setup.rb lib/rubocop/cop/rspec/shared_context.rb lib/rubocop/cop/rspec/describe_class.rb lib/rubocop/cop/rspec/described_class.rb lib/rubocop/cop/rspec/empty_line_after_example_group.rb lib/rubocop/cop/rspec/focus.rb lib/rubocop/cop/rspec/multiple_expectations.rb lib/rubocop/cop/rspec/context_wording.rb lib/rubocop/cop/rspec/empty_line_after_subject.rb lib/rubocop/cop/rspec/before_after_all.rb lib/rubocop/cop/rspec/implicit_subject.rb lib/rubocop/cop/rspec/cop.rb lib/rubocop/cop/rspec/describe_symbol.rb lib/rubocop/cop/rspec/empty_example_group.rb lib/rubocop/cop/rspec/expect_in_hook.rb lib/rubocop/cop/rspec/single_argument_message_chain.rb lib/rubocop/cop/rspec/be_eql.rb lib/rubocop/cop/rspec/empty_hook.rb lib/rubocop/cop/rspec/yield.rb lib/rubocop/cop/rspec/return_from_stub.rb lib/rubocop/cop/rspec/described_class_module_wrapping.rb lib/rubocop/cop/rspec/repeated_example.rb lib/rubocop/cop/rspec/implicit_expect.rb lib/rubocop/cop/rspec/predicate_matcher.rb lib/rubocop/cop/rspec/let_setup.rb lib/rubocop/cop/rspec/leaky_constant_declaration.rb lib/rubocop/cop/rspec/factory_bot/create_list.rb lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb lib/rubocop/cop/rspec/unspecified_exception.rb lib/rubocop/cop/rspec/capybara/visibility_matcher.rb lib/rubocop/cop/rspec/capybara/current_path_expectation.rb lib/rubocop/cop/rspec/capybara/feature_methods.rb lib/rubocop/cop/rspec/shared_examples.rb lib/rubocop/cop/rspec/missing_example_group_argument.rb lib/rubocop/cop/rspec_cops.rb lib/rubocop-rspec.rb find lib/ -type d -empty -delete cd - cd - @@ -1154,841 +1224,1234 @@ 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/i386-linux-gnu/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/i386-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 47623 - -RuboCop::RSpec::ExampleGroup - exposes examples in scope - -RuboCop::RSpec::Example - extracts doc string for unimplemented examples - extracts doc string - returns node - extracts interpolated doc string - extracts symbol doc string - extracts method doc string - extracts implementation - returns nil for examples without doc strings - extracts keywords - value object semantics - computes #hash based on class and node - compares by value - can be used as a key in a hash +Randomized with seed 13903 -config/default.yml - includes Enabled: true for every cop - sorts configuration keys alphabetically - has configuration for all cops - does not have newlines in cop descriptions - has descriptions for all cops - ends every description with a period - -RuboCop::Cop::RSpec::MultipleSubjects - does not try to autocorrect subject! - autocorrects - registers an offense for every overwritten subject - does not flag shared example groups +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/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 -RuboCop::Cop::RSpec::ExpectActual - flags `be` with an argument - ignores `be` with no argument - flags arrays containing only literal values within expect(...) - flags but does not autocorrect violations for other matchers - flags with `equal` matcher - flags string and symbol literal values within expect(...) - flags regexps containing only literal values within expect(...) - does not flag dynamic values within expect(...) - does not flag complex values with dynamic parts within expect(...) - flags hashes containing only literal values within expect(...) - flags literal nil value within expect(...) - flags with `eql` matcher - flags `be ==` - flags ranges containing only literal values within expect(...) - flags boolean literal values within expect(...) - flags numeric literal values within expect(...) - when inspecting rspec-rails routing specs - ignores rspec-rails routing specs +RuboCop::Cop::RSpec::LeakyConstantDeclaration + class defined + ignores anonymous classes + flags namespaced class + flags inside an example group 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 + module defined + flags inside an example group + constant assignment + flags inside shared example group + flags inside an example group + ignores outside of example/shared group + flags inside an example + +RuboCop::Cop::RSpec::ImplicitExpect + when EnforcedStyle is is_expected + approves of is_expected.to + approves of is_expected.to_not + generates a todo based on the detected style + flags it { should_not } + approves of is_expected.not_to + flags it { should } + 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 EnforcedStyle is should + approves of should + flags it { is_expected.to } + generates a todo based on the detected style + approves of should_not + flags it { is_expected.to_not } + generates a todo based on the detected style + flags it { is_expected.not_to } -Weirdness - is empty - it does a thing - example at ./spec/smoke_tests/weird_rspec_spec.rb:37 - example at ./spec/smoke_tests/weird_rspec_spec.rb:36 - example at ./spec/smoke_tests/weird_rspec_spec.rb:176 - example at ./spec/smoke_tests/weird_rspec_spec.rb:130 - isnt a simple string - has chained expectations - isnt a simple string - is expecting you not to raise an error - is expecting you - quotes a string weird - has a description too - works - should not do the thing - It does a thing - example at ./spec/smoke_tests/weird_rspec_spec.rb:51 - uses a matcher - likes - likes - lets the word 'likes' be 'likes' - dynamic - dynamic - lets the word 'dynamic' be 'dynamic' - examples - examples - lets the word 'examples' be 'examples' - who - who - lets the word 'who' be 'who' - -RuboCop::Cop::RSpec::AroundBlock - when passed to another method - does not register an offense - when #run is called - does not register an offense +RuboCop::Cop::RSpec::SingleArgumentMessageChain 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 + receive_message_chain + accepts single-argument calls with send node + accepts multi-argument string calls + accepts single-argument calls with variable + reports single-argument calls + reports single-argument string calls + accepts multi-argument 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 + stub_chain + accepts multi-argument calls + reports single-argument calls + reports single-argument string calls + accepts multi-argument string calls + +RuboCop::Cop::RSpec::MissingExampleGroupArgument + accepts methods with a name like an example block + accepts describe with an argument + checks first argument of nested describe + checks first argument of context + 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/no_tests_spec.rb - when the hook is scoped with a symbol - registers an offense - when no value is yielded - registers 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 - when two values are yielded and the first is unused - registers an offense for the first argument - when the yielded value is referenced but not used - registers an offense - when a method other than #run or #call is called - registers an offense - when the yielded value is unused - registers an offense + 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::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::ContextMethod + flags context with `.` at the beginning + flags context with `#` at the beginning + ignores describe blocks 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 + +RuboCop::Cop::RSpec::Yield + flags `block.call` with arguments + flags multiple `block.call` with arguments + flags multiple `block.call` + flags `block.call` when `receive` is chained + flags `block.call` + ignores stub when `block.call` is not the only statement + ignores `receive` with no block arguments + 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 - does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::DescribeSymbol - does not flag `context :symbol` - flags violations for a nested `describe` - does not flag non-Symbol arguments - flags violations for `RSpec.describe :symbol` - flags violations for `describe :symbol` with multiple arguments - flags violations for `describe :symbol` +Project requires + alphabetizes cop requires + +RuboCop::Cop::RSpec::ReceiveCounts + flags usage of `exactly(1).times` with a block + flags usage of `exactly(1).times` after `with` + allows exactly(1).times when not called on `receive` + 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 `exactly(1).times` + flags usage of `at_least(1).times` + flags usage of `at_most(2).times` + flags usage of `at_most(1).times` + allows `exactly(n).times` + flags usage of `exactly(1).times` with return value + flags usage of `exactly(2).times` + allows `exactly(3).times` + flags usage of `at_least(2).times` + flags usage of `at_least(2).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/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 -RuboCop::Cop::RSpec::Rails::HttpStatus - when EnforcedStyle is `symbolic` - autocorrects `it { is_expected.to have_http_status 404 }` to `it { is_expected.to have_http_status :not_found }` - registers an offense when using numeric value - does not register an offense when using custom HTTP code - 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 }` - with parenthesis - autocorrects `it { is_expected.to have_http_status(200) }` to `it { is_expected.to have_http_status(:ok) }` - autocorrects `it { is_expected.to have_http_status(404) }` to `it { is_expected.to have_http_status(:not_found) }` +RuboCop::Cop::RSpec::AlignRightLetBrace + registers offense for unaligned braces + does not register offense for let with proc argument + works with empty file 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 - when EnforcedStyle is `numeric` - 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 allowed symbols - registers an offense when using symbolic value - does not register an offense when using numeric value - with parenthesis - autocorrects `it { is_expected.to have_http_status(:not_found) }` to `it { is_expected.to have_http_status(404) }` - autocorrects `it { is_expected.to have_http_status(:ok) }` to `it { is_expected.to have_http_status(200) }` + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::IteratedExpectation - ignores `each` without expectation - flags `each` with multiple expectations - flags `each` with an expectation - ignores `each` when there is a negative expectation - flags `each` when expectation calls method with arguments - ignores assignments in the iteration - ignore `each` when the body does not contain only expectations - ignores `each` with expectation on property +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/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 -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 - link to related issue on github - has a colon and a whitespace at the end - has an issue number prefixed with # - has a valid URL - body - ends with a punctuation - does not start with a lower case - -RuboCop::Cop::RSpec::VariableName - when configured for `snake_case` - when `subject!` - does not register offense for snake_case - registers an offense for camelCase - when `let!` - registers an offense for camelCase - does not register offense for snake_case - when `let` with proc - registers offense - when `let` with symbol names - registers an offense for camelCase - does not register offense for interpolated symbol - does not register an offense for snake_case - registers offense with multiple lets - registers an offense for PascalCase - when `let` with string names - registers an offense for kebab-case - registers an offense for camelCase - does not register offense for interpolated string - does not register an offense for snake_case - when `subject` - does not register offense for snake_case - registers an offense for camelCase - when configured for `camelCase` - when `subject!` - registers an offense for snake_case - does not register offense for camelCase - when `subject` - registers an offense for snake_case - does not register offense for camelCase - when `let!` - registers an offense for snake_case - does not register offense for camelCase - when `let` - does not register offense for camelCase - registers an offense for snake_case +RuboCop::Cop::RSpec::LeadingSubject + handles subjects in contexts + approves of subject above let + checks subject below example + checks subject below let + checks subject below let! + checks subject below let with proc argument + checks subject below hook + handles subjects in tests 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/empty_spec.rb -RuboCop::RSpec::ConfigFormatter - builds a YAML dump with spacing between cops - -RuboCop::Cop::RSpec::MessageChain - finds old `stub_chain` syntax - finds `receive_message_chain` +RuboCop::Cop::RSpec::LetSetup + complains when let! used in shared example including + complains when let! is used and not referenced + complains when let! is used and not referenced within nested group + complains when there is a custom nesting level + complains when there is only one nested node into example group + ignores let! when used in example + ignores let! when used in `before` + complains when let! is used and not referenced in shared example group 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 -RuboCop::Cop::RSpec::ImplicitSubject - with EnforcedStyle `single_line_only` - flags `should` in multi-line examples - allows `is_expected` 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 `should` in single-line examples +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 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 - with EnforcedStyle `disallow` - allows `is_expected` inside `its` block - flags `should` in single-line examples - flags `is_expected` in multi-line examples - flags `is_expected` in single-line examples - flags `should` in multi-line examples - with EnforcedStyle `single_statement_only` - flags `is_expected` in multi-statement examples - allows `is_expected` in multi-line example with single statement - -RuboCop::Cop::RSpec::FilePath - handles ACRONYMClassNames - allows flexibility with operators - allows subdirs for instance methods - uses relative path for sibling directory project - registers an offense for a repeated .rb - handles ALLCAPS class names - handles alphanumeric class names - allows different parent directories - registers an offense for a file missing a .rb - uses relative path - allows subdirs for class methods - registers an offense for a wrong class and highlights metadata - checks instance methods - allows flexibility with predicates - allows flat hierarchies for instance methods - skips specs that do have multiple top level describes - uses relative path for different path project - allows flat hierarchies for class methods - registers an offense for a wrong class name - handles CamelCaps class names - registers an offense for a wrong class but a correct method - allows bang method - checks class methods - checks class specs - registers an offense for a bad path - registers an offense for a file missing _spec - skips specs that do not describe a class / method - registers an offense for a wrong class name with a symbol argument - ignores non-alphanumeric characters - when configured with IgnoreMethods - does not care about the described method - 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 + +RuboCop::Cop::RSpec::NestedGroups + flags nested contexts + support --auto-gen-config + ignores non-spec context methods + counts nesting correctly when non-spec nesting + 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 - when configured with CustomTransform - respects custom module name transformation - ignores routing specs - when configured with SpecSuffixOnly - does not care about the described class - registers an offense when _spec.rb suffix is missing + does not crash on smoke test: spec/smoke_tests/factory_bot_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 +RuboCop::Cop::RSpec::VoidExpect + accepts non-void `expect` with block + registers offenses to void `expect` with block + registers offenses to void `expect` when block has one expression + registers offenses to void `expect` + accepts non-void `expect` 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 + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + +RuboCop::RSpec::ConfigFormatter + builds a YAML dump with spacing between cops + +RuboCop::Cop::RSpec::SharedContext + 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 - when using before all + 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 + shared_examples + does not register an offense for empty examples + registers an offense for shared_examples with only let + registers an offense for shared_examples with only hooks + registers an offense for shared_examples with only subject + does not register an offense for `shared_examples` with it + shared_context + does not register an offense for `shared_context` with subject + does not register an offense for `shared_context` with before + does not register an offense for empty contexts + registers an offense for shared_context with only examples + does not register an offense for `shared_context` with let + +RuboCop::Cop::RSpec::BeforeAfterAll + when using after all registers an offense - when using before each - does not register an offense when using after each does not register an offense - when using after all + when using before each + does not register an offense + when using before all registers an offense - -RuboCop::Cop::RSpec::DescribeMethod - skips methods starting with a . or # - skips specs not having a string second argument - enforces non-method names - ignores describes with only a class 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 - -RuboCop::Cop::RSpec::InstanceSpy - 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 - when not used with `have_received` - does not add an offence - 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 -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 shared example group - flags inside an example group +RuboCop::Cop::RSpec::EmptyLineAfterSubject + approves 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 + handles multiline subject block + checks for empty line after subject! 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/no_tests_spec.rb - class defined - flags inside an example group - flags namespaced class - ignores anonymous classes + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::Yield - flags `block.call` - flags `block.call` with arguments - flags multiple `block.call` - flags `block.call` when `receive` is chained - flags multiple `block.call` with arguments - ignores `receive` with no block arguments - ignores stub when `block.call` is not the only statement +RuboCop::Cop::RSpec::PredicateMatcher 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/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + when enforced style is `explicit` + when strict is true + accepts built in matchers + autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(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_all do; end` to `expect(foo.all? do; end).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(1, 2)` to `expect(foo.something?(1, 2)).to be(true)` + autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` + autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be(true)` + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be(true)` + autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` + autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` + registers an offense for a predicate mather with argument + autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` + registers an offense for a predicate matcher with a block + accepts non-predicate matcher + autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` + autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be(true)` + autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be(true)` + when custom matchers are allowed + accepts custom allowed explicit matchers + when strict is false + autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be_truthy` + autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be_truthy` + autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be_falsey` + autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be_truthy` + accepts non-predicate matcher + autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be_truthy` + registers an offense for a predicate matcher with a block + 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_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_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` + registers an offense for a predicate mather + autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be_truthy` + 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 +` + accepts built in matchers + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be_truthy` + autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` + when custom matchers are allowed + accepts custom allowed explicit matchers + when enforced style is `inflected` + when strict is false + autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` + registers an offense for a predicate method in actual + autocorrects `expect(foo.empty?).to be(false)` to `expect(foo).not_to be_empty` + 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.something?()).to be_truthy` to `expect(foo).to be_something()` + autocorrects `expect(foo.empty?).to be(true)` to `expect(foo).to be_empty` + registers an offense for a predicate method with argument + autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` + autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` + autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` + autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` + accepts a predicate method that is not ckeced true/false + 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.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + autocorrects `expect(foo.empty?).not_to be(true)` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` + 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.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` + registers an offense for a predicate method in actual + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` + autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.empty?).not_to be(false)` to `expect(foo).to be_empty` + accepts non-predicate method + autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` + registers an offense for a predicate method with built-in equiv + autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_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.empty?).to be_truthy` to `expect(foo).to be_empty` + autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` + autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` + when strict is true + autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` + registers an offense for a predicate method with argument + autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` + autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` + 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.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` + autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` + accepts strict checking boolean matcher + autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` + autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` + accepts a predicate method that is not ckeced true/false + autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` + autocorrects `expect(foo.empty?).not_to be_truthy` 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.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` + registers an offense for a predicate method with built-in equiv + 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? 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?).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")` + 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.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + registers an offense for a predicate method in actual + accepts non-predicate method -RuboCop::Cop::RSpec::ExampleWording - finds interpolated description with `should` at the beginning - finds description with `should` at the beginning - skips interpolated description without literal `should` at the start - flags \-separated multiline strings - skips descriptions without `should` at the beginning - skips descriptions starting with words that begin with `should` - ignores non-example blocks - flags a lone should - finds description with `shouldn't` at the beginning - finds description with `SHOULDN'T` at the beginning - skips words beginning with 'it' - flags a lone should not - finds leading its - flags \-separated multiline interpolated strings - finds leading it in interpolated description - finds description with `Should` at the beginning +RuboCop::Cop::RSpec::Pending + flags xfeature + ignores describe + ignores example + flags xscenario + flags blocks with pending symbol metadata + flags blocks with skip: true metadata + flags xexample + ignores context + flags xcontext + flags xit + flags xspecify + ignores feature + ignores scenario + flags skip blocks + flags skip inside of an it + flags pending examples when receiver is explicit + flags blocks with skip: string metadata + ignores specify + flags pending blocks + ignores example_group + ignores method called pending + flags xdescribe + ignores it + ignores it with skip: false metadata + flags describe with skip symbol metadata + flags blocks with skip symbol metadata 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 -RuboCop::Cop::RSpec::ScatteredSetup - ignores hooks with different metadata - flags multiple hooks in the same example group - flags hooks with similar metadata - ignores similar method names inside of examples - flags multiple before(:all) hooks in the same example group - ignores hooks in different example groups - flags multiple hooks of the same scope with different symbols - ignores hooks in different shared contexts - ignores different hook types - ignores different hooks +RuboCop::RSpec::Example + returns nil for examples without doc strings + extracts doc string + returns node + extracts doc string for unimplemented examples + extracts keywords + extracts method doc string + extracts symbol doc string + extracts interpolated doc string + extracts implementation + value object semantics + can be used as a key in a hash + compares by value + computes #hash based on class and node + +RuboCop::Cop::RSpec::AroundBlock + when the yielded value is referenced but not used + registers an offense + when used as a block arg + does not register an offense + when the yielded value is unused + registers an offense + when passed to another method + does not register an offense + when no value is yielded + registers an offense + when the hook is scoped with a symbol + registers 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/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/weird_rspec_spec.rb + 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 + when yielded to another block + does not register an offense + when #run is called + does not register an offense + when #call is called + does not register an offense -RuboCop::Cop::RSpec::LetBeforeExamples - flags `let` with proc argument - does not flag `let` in a nested context - flags `let` after `it` - flags `let` after `context` - autocorrects ` RSpec.describe User do - include_examples('should be after let') - let(:foo) { (<<-SOURCE) } - some long text here - SOURCE - end -` to ` RSpec.describe User do - let(:foo) { (<<-SOURCE) } - some long text here - SOURCE - include_examples('should be after let') + is insane - end -` - flags `let` after `include_examples` - does not flag `let` before the examples - allows inclusion of context before `let` - ignores single-line example blocks +RuboCop::Cop::RSpec::SubjectStub + flags chain stubs + flags nested subject stubs + flags one-line expectcation syntax + flags multiple-method stubs + flags an expectation made on an unnamed subject + ignores nested stubs when nested subject is anonymous + flags when an implicit subject is mocked + flags nested subject stubs when example group does not define subject + flags deeply nested subject stubs + flags negated runners + flags nested subject stubs when adjacent context redefines + flags nested subject stubs when nested subject uses same name + flags when subject is mocked + flags spy subject stubs + flags when an unnamed subject is mocked + flags stub inside all matcher + ignores stub within context where subject name changed + flags when there are several top level example groups + flags when subject is stubbed and there are several named subjects in the same example group + flags when subject is stubbed 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/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 + top level example groups + flags in top level shared_examples + flags in top level feature + flags in top level ffeature + flags in top level xfeature + flags in top level shared_context + flags in top level example_group + flags in top level describe + flags in top level fdescribe + flags in top level context + flags in top level xcontext + flags in top level xdescribe + flags in top level fcontext + flags in top level shared_examples_for -RuboCop::Cop::RSpec::LetSetup - complains when let! used in shared example including - ignores let! when used in `before` - complains when let! is used and not referenced within nested 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 only one nested node into example group - ignores let! when used in example - complains when there is a custom nesting level +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 + still flags doubles whose name is a string + ignores doubles whose name is a symbol + when configured not to ignore nameless doubles + flags doubles that have no name specified 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/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 configuration does not specify IgnoreSymbolicNames + find doubles whose name is a symbol + finds a `spy` instead of an `instance_spy` -RubocopBug - has a single example - has an expectation - -RuboCop::Cop::RSpec::ItBehavesLike - 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 - 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 +RuboCop::Cop::RSpec::FactoryBot::CreateList + when EnforcedStyle is :n_times + autocorrects `create_list :user, 5` to `5.times { create :user }` + autocorrects `create_list(:user, 5, :trait)` to `5.times { create(:user, :trait) }` + flags usage of create_list + flags usage of FactoryGirl.create_list + autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` + flags usage of FactoryGirl.create_list with a block + ignores create method of other object + autocorrects `create_list :user, 5, :trait, key: val` to `5.times { create :user, :trait, key: val }` + when EnforcedStyle is :create_list + autocorrects `5.times { create :user }` to `create_list :user, 5` + ignores n.times when there is no create call inside + ignores n.times with argument + flags usage of n.times when FactoryBot.create is used + flags usage of n.times with no arguments + autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` + autocorrects ` 3.times do + create(:user, :trait) do |user| + create :account, user: user + create :profile, user: user + end + end +` to ` create_list(:user, 3, :trait) do |user| + create :account, user: user + create :profile, user: user + end +` + flags usage of n.times when FactoryGirl.create is used + 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` + ignores create method of other object + ignores n.times when there is other calls but create + flags FactoryGirl.create calls with a block + autocorrects `5.times { create(:user, :trait) }` to `create_list(:user, 5, :trait)` + ignores create in other block 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/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::HookArgument - when EnforcedStyle is :example - autocorrects `before { }` to `before(:example) { }` - detects :each for hooks - generates a todo based on the detected style - does not flag hooks without default scopes - ignores hooks with more than one argument - generates a todo based on the detected style - detects :example for hooks - ignores non-rspec hooks - ignores :context and :suite - autocorrects `before(:each) { }` to `before(:example) { }` - autocorrects `config.before(:example) { }` to `config.before(:example) { }` - autocorrects `config.before { }` to `config.before(:example) { }` - autocorrects `config.before(:each) { }` to `config.before(:example) { }` - autocorrects `before(:example) { }` to `before(:example) { }` - generates a todo based on the detected style +RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup + checks for empty line after describe + highlights single line formulations correctly + checks for empty line after context + handles describes in an if block + approves empty line after context + approves empty line after 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 + +RuboCop::Cop::RSpec::ExampleWording + flags a lone should + finds interpolated description with `should` at the beginning + skips interpolated description without literal `should` at the start + flags a lone should not + finds description with `SHOULDN'T` at the beginning + flags \-separated multiline strings + finds description with `Should` at the beginning + skips words beginning with 'it' + flags \-separated multiline interpolated strings + finds leading it in interpolated description + finds leading its + skips descriptions without `should` at the beginning + ignores non-example blocks + finds description with `should` at the beginning + skips descriptions starting with words that begin with `should` + finds description with `shouldn't` 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/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 EnforcedStyle is :each - detects :example for hooks - generates a todo based on the detected style - ignores hooks with more than one argument - detects :each for hooks - autocorrects `before { }` to `before(:each) { }` - generates a todo based on the detected style - autocorrects `config.before { }` to `config.before(:each) { }` - generates a todo based on the detected style - ignores :context and :suite - autocorrects `config.before(:each) { }` to `config.before(:each) { }` - autocorrects `config.before(:example) { }` to `config.before(:each) { }` - detects hooks without default scopes - autocorrects `before(:example) { }` to `before(:each) { }` - autocorrects `before(:each) { }` to `before(:each) { }` - ignores non-rspec hooks - when EnforcedStyle is :implicit - ignores :context and :suite - generates a todo based on the detected style - autocorrects `config.before(:each) { }` to `config.before { }` - ignores hooks with more than one argument - autocorrects `before(:each) { }` to `before { }` - does not flag hooks without default scopes - detects :each for hooks - autocorrects `before { }` to `before { }` - detects :example for hooks - autocorrects `before(:example) { }` to `before { }` - ignores non-rspec hooks - generates a todo based on the detected style - autocorrects `config.before { }` to `config.before { }` - generates a todo based on the detected style - autocorrects `config.before(:example) { }` to `config.before { }` -RuboCop::Cop::RSpec::Dialect - registers an offense for context blocks - allows describe blocks - registers an offense for RSpec.context blocks - allows calling methods named context in examples - without preferred methods - allows all methods blocks +RuboCop::Cop::RSpec::EmptyLineAfterHook + checks for empty line after `after` hook + handles multiline `after` block + handles multiline `before` block + approves empty line after `before` hook + handles `before` being the latest node + checks for empty line after `before` hook + checks for empty line after `around` hook + approves empty line after `around` hook + handles multiline `around` block + approves empty line after `after` 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/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::DescribedClassModuleWrapping + registers an offense when RSpec.describe is nested within two modules + allows a describe block in the outermost scope + registers an offense when RSpec.describe is nested within a module + allows a module that does not contain RSpec.describe + 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/empty_spec.rb -RuboCop::Cop::RSpec::RepeatedExampleGroupBody - does not register offense if metadata is different - registers an offense for repeated context body - registers an offense for several repeated context body - does not register offense for different block body implementation - registers an offense for repeated describe body - does not register offense for example groups in different groups - does not register offense with several docstring - registers offense for different groups - registers offense only for RSPEC namespace example groups in any order - registers offense no descriptions and similar body - does not register offense if no descriptions, but different body - registers offense only for example group - registers offense only for RSPEC namespace example groups - registers an offense for when module arg and namespace are identical - does not register offense when module arg namespace is different - registers offense correctly if example groups are separated - does not register offense for same examples with different data - does not register offense if module arg is different - skips `skip` and `pending` statements +RuboCop::Cop::RSpec::ExpectOutput + does not register an offense for interacting with $stdout + does not flag assigns to $stdout when in the root scope + does not flag assignments to $stdout outside of example scope + does not flag assignments to $stdout in example_group scope + registers an offense for overwriting $stdout within an example + registers an offense for overwriting $stderr within an example scoped hook + does not flag assignments to other global variables 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 + +RuboCop::Cop::RSpec::DescribeSymbol + flags violations for a nested `describe` + flags violations for `describe :symbol` with multiple arguments + flags violations for `describe :symbol` + does not flag non-Symbol arguments + does not flag `context :symbol` + flags violations for `RSpec.describe :symbol` + 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/no_tests_spec.rb RuboCop::Cop::RSpec::Capybara::VisibilityMatcher + does not register an offense when no options are given` recognizes multiple matchers + does not register an offense when using `visible: :hidden` registers an offense when using a selector` + does not register an offense when using other options does not register an offense when using `visible: :visible` - registers an offense when using `visible: true` - does not register an offense when using multiple options registers an offense when using `visible: false` - does not register an offense when using `visible: :hidden` - registers an offense when using a using multiple options` - does not register an offense when no options are given` does not register an offense when using `visible: :all` - does not register an offense when using other options + does not register an offense when using multiple options + registers an offense when using `visible: true` + registers an offense when using a using multiple options` 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/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::ContextWording - skips describe blocks - finds context without separate `when` at the beginning - skips descriptions beginning with 'when' - finds shared_context without `when` at the beginning - finds context without `when` at the beginning - with mixed metadata - finds context without separate `when` at the beginning - when configured - skips descriptions with allowed prefixes at the beginning - finds context without allowed prefixes at the beginning - with symbol metadata - finds context without separate `when` at the beginning +RuboCop::Cop::RSpec::NamedSubject + 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 + ignores subject when not wrapped inside a test + checks before and after for explicit subject usage + checks `it` and `specify` for explicit subject usage 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 - with metadata hash - finds context without separate `when` at the beginning + 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 + checks `it` and `specify` for explicit subject usage + ignores subject when not wrapped inside a test -RuboCop::Cop::RSpec::AlignRightLetBrace - works with empty file - does not register offense for let with proc argument - registers offense for unaligned braces +RuboCop::Cop::RSpec::SharedExamples + does not register an offense when using string title + registers an offense when using symbolic title + does not register an offense when using Module/Class title 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 + +RuboCop::Cop::RSpec::ExpectActual + flags literal nil value within expect(...) + flags but does not autocorrect violations for other matchers + flags `be` with an argument + flags with `equal` matcher + does not flag complex values with dynamic parts within expect(...) + flags `be ==` + flags ranges containing only literal values within expect(...) + flags boolean literal values within expect(...) + flags arrays containing only literal values within expect(...) + ignores `be` with no argument + flags hashes containing only literal values within expect(...) + flags string and symbol literal values within expect(...) + does not flag dynamic values within expect(...) + flags with `eql` matcher + flags regexps containing only literal values within expect(...) + flags numeric 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/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 -RuboCop::Cop::RSpec::AlignLeftLetBrace - does not register offense for let with proc argument - registers offense for unaligned braces - works with empty file +RuboCop::Cop::RSpec::VariableName + when configured for `snake_case` + when `let` with symbol names + does not register an offense for snake_case + registers an offense for camelCase + registers offense with multiple lets + does not register offense for interpolated symbol + registers an offense for PascalCase + when `let` with proc + registers offense + when `let!` + registers an offense for camelCase + does not register offense for snake_case + when `subject!` + registers an offense for camelCase + does not register offense for snake_case + when `let` with string names + does not register an offense for snake_case + registers an offense for camelCase + registers an offense for kebab-case + does not register offense for interpolated string + when `subject` + does not register offense for snake_case + registers an offense for camelCase 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 configured for `camelCase` + when `subject!` + 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 `let` + registers an offense for snake_case + does not register offense for camelCase + when `subject` + registers an offense for snake_case + does not register offense for camelCase + +RuboCop::Cop::RSpec::ScatteredLet + flags `let` at different nesting levels + flags scattered `let!`s + works with heredocs + flags `let` after the first different node + doesnt flag `let!` in the middle of multiple `let`s + flags `let` with proc argument + 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 +RuboCop::Cop::RSpec::FactoryBot::FactoryClassName + when passing block + flags passing a subclass + ignores passing class name + flags passing a class from global namespace + ignores passing OpenStruct + ignores passing Hash + flags passing a class + 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 not passing block + ignores passing class name + flags passing a class + 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 hook scope change - autocorrects corresponding - ignores described_class as string flags the use of the described_class ignores describe that do not reference to a class + ignores violations within a hook scope change ignores violations within a class scope change + ignores described_class as string + autocorrects corresponding + 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 when EnforcedStyle is :described_class - ignores class if the scope is changing + flags for the use of the described class + flags the use of described class with namespace + flags with metadata + ignores non-matching namespace + ignores non-matching namespace in usages + flags the use of described class with nested namespace + ignores violations within a class scope change + ignores non-matching namespace defined on `describe` level ignores violations within a hook scope change ignores if `described_class` is a part of the constant ignores if a local variable is part of the namespace + ignores class if the scope is changing ignores described class as string - ignores non-matching namespace defined on `describe` level - flags the use of described class with nested namespace - ignores non-matching namespace in usages - flags the use of described class with namespace - ignores violations within a class scope change flags the use of described class with module + takes class from innermost describe ignores subclasses ignores describe that do not reference to a class - ignores non-matching namespace - flags with metadata accepts an empty block - flags for the use of the described class - takes class from innermost describe - when SkipBlocks is `false` - flags violations within all blocks + +RubocopBug + has a single example + has an expectation + +RuboCop::Cop::RSpec::InstanceSpy + when used with `have_received` + ignores instance_double when it is not used with as_null_object + adds an offense for an instance_double with single argument + adds an offense for an instance_double with multiple arguments + when not used with `have_received` + does not add an offence 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/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::Cop - when the source path contains `/spec/` - registers an offense - when custom patterns are specified - registers offenses when the path matches a custom specified pattern +RuboCop::Cop::RSpec::VariableDefinition 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/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - 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 - when the source path ends with `_spec.rb` - ignores the file if it is ignored - registers an offense - when the source path starts with `spec/` - registers an offense + when EnforcedStyle is `strings` + registers an offense for symbol name + does not register offense for string names + registers an offense for interpolated symbol + when EnforcedStyle is `symbols` + registers an offense for interpolated string + does not register offense for symbol names + registers an offense for multiline string + registers an offense for string name -RuboCop::Cop::RSpec::Pending - flags xfeature - flags xexample - ignores method called pending - ignores describe - ignores it - ignores scenario - flags pending blocks - flags blocks with skip symbol metadata - flags blocks with skip: string metadata - ignores it with skip: false metadata - flags skip inside of an it - ignores example - flags pending examples when receiver is explicit - flags xdescribe - flags skip blocks - flags xit - ignores example_group - flags xcontext - ignores feature - ignores specify - flags blocks with pending symbol metadata - flags xscenario - flags blocks with skip: true metadata - flags xspecify - flags describe with skip symbol metadata - ignores context +RuboCop::Cop::RSpec::EmptyLineAfterFinalLet + flags missing empty line after the comment that comes after last let + handles multiline let block + handles let being the latest node + check for empty line after the last `let!` + handles silly HEREDOC offense + approves empty line after let + flags missing empty line after a multiline comment after last let + handles HEREDOC for let + allows comment followed by an empty line after let + checks for empty line after let with proc argument + ignores empty lines between the lets + checks for empty line after last let + handles let in tests + handles silly HEREDOC syntax for let 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 -RuboCop::Cop::RSpec::ImplicitExpect +Weirdness + is expecting you + isnt a simple string + it does a thing + example at ./spec/smoke_tests/weird_rspec_spec.rb:51 + example at ./spec/smoke_tests/weird_rspec_spec.rb:176 + example at ./spec/smoke_tests/weird_rspec_spec.rb:37 + works + has chained expectations + example at ./spec/smoke_tests/weird_rspec_spec.rb:130 + example at ./spec/smoke_tests/weird_rspec_spec.rb:36 + is expecting you not to raise an error + has a description too + quotes a string weird + It does a thing + isnt a simple string + is empty + uses a matcher + should not do the thing + dynamic + dynamic + lets the word 'dynamic' be 'dynamic' + likes + likes + lets the word 'likes' be 'likes' + who + who + lets the word 'who' be 'who' + examples + examples + lets the word 'examples' be 'examples' + +RuboCop::Cop::RSpec::HookArgument + when EnforcedStyle is :implicit + autocorrects `before(:example) { }` to `before { }` + detects :each for hooks + autocorrects `before { }` to `before { }` + autocorrects `config.before(:each) { }` to `config.before { }` + ignores :context and :suite + ignores hooks with more than one argument + autocorrects `before(:each) { }` to `before { }` + does not flag hooks without default scopes + detects :example for hooks + ignores non-rspec hooks + generates a todo based on the detected style + autocorrects `config.before { }` to `config.before { }` + autocorrects `config.before(:example) { }` to `config.before { }` + generates a todo based on the detected style + generates a todo based on the detected style + when EnforcedStyle is :example + ignores non-rspec hooks + autocorrects `config.before(:example) { }` to `config.before(:example) { }` + generates a todo based on the detected style + does not flag hooks without default scopes + generates a todo based on the detected style + detects :each for hooks + autocorrects `config.before { }` to `config.before(:example) { }` + detects :example for hooks + ignores :context and :suite + generates a todo based on the detected style + autocorrects `before(:example) { }` to `before(:example) { }` + ignores hooks with more than one argument + autocorrects `before { }` to `before(:example) { }` + autocorrects `before(:each) { }` to `before(:example) { }` + autocorrects `config.before(:each) { }` to `config.before(:example) { }` 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 is_expected + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when EnforcedStyle is :each + autocorrects `config.before(:example) { }` to `config.before(:each) { }` + detects hooks without default scopes + autocorrects `config.before { }` to `config.before(:each) { }` + autocorrects `before { }` to `before(:each) { }` + ignores hooks with more than one argument + autocorrects `before(:each) { }` to `before(:each) { }` + detects :example for hooks + autocorrects `before(:example) { }` to `before(:each) { }` generates a todo based on the detected style - approves of is_expected.to_not - flags it { should_not } - approves of is_expected.to - flags it { should } - approves of is_expected.not_to - when EnforcedStyle is should - approves of should_not generates a todo based on the detected style - flags it { is_expected.to_not } - flags it { is_expected.not_to } + ignores :context and :suite generates a todo based on the detected style - approves of should - flags it { is_expected.to } + ignores non-rspec hooks + autocorrects `config.before(:each) { }` to `config.before(:each) { }` + detects :each for hooks -RuboCop::Cop::RSpec::EmptyLineAfterExample - flags a missing empty line after `it` - ignores consecutive one-liners - flags a missing empty line after `specify` - ignores when an empty line is present - flags one-line examples - flags mixed one-line and multi-line examples - when AllowConsecutiveOneLiners is false - ignores consecutive one-liners +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/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::RSpec::DescriptionExtractor + builds a hash of descriptions + +RuboCop::Cop::RSpec::Rails::HttpStatus + when EnforcedStyle is `numeric` + 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 }` + does not register an offense when using allowed symbols + registers an offense when using symbolic 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) }` + 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 `symbolic` + registers an offense when using numeric value + autocorrects `it { is_expected.to have_http_status 200 }` to `it { is_expected.to have_http_status :ok }` + 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 + does not register an offense when using custom HTTP code + 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::BeEql - 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 an integer - does not register an offense for `eql` when argument is a string - does not register an offense for `eql` when expectation is negated - registers an offense for `eql` when argument is nil - registers an offense for `eql` when argument is a float +config/default.yml + does not have newlines in cop descriptions + has configuration for all cops + ends every description with a period + has descriptions for all cops + includes Enabled: true for every cop + sorts configuration keys alphabetically + +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/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/factory_bot_spec.rb + +RuboCop::Cop::RSpec::ExpectChange + with EnforcedStyle `block` + flags change matcher when receiver is a variable + ignores methods called change + flags change matcher without block + flags implicit block expectation syntax + 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/empty_spec.rb + with EnforcedStyle `method_call` + flags blocks that contain simple message sending + ignores change method of object that happens to receive a block + ignores blocks that cannot be converted to obj/attribute pair + flags implicit block expectation syntax -RuboCop::Cop::RSpec::RepeatedExampleGroupDescription - considers interpolated docstrings as different descriptions - considers different classes as different descriptions - registers offense only for RSPEC namespace example groups - registers an offense for repeated context descriptions - registers offense correctly for interpolated docstrings - does not register offense for different block descriptions - registers offense only for RSPEC namespace example groups in any order - does not register offense for example group without descriptions - register offense for different example group with similar descriptions - does not register offense for describe block with additional docstring - does not register offense for describe block with several docstring - registers an offense for repeated describe descriptions - registers an offense with right pointing to lines of code - registers offense correctly if example groups are separated - register offense if same method used in docstring - registers offense only for example group +RuboCop::Cop::RSpec::EmptyExampleGroup + does not flag include_examples + flags an empty top level describe + flags an empty context + does not flag methods matching example group names + does not recognize custom include methods by default + when a custom include method is specified + does not flag an otherwise empty example group 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/no_tests_spec.rb -RuboCop::Cop::RSpec::LeadingSubject - checks subject below let - checks subject below let! - handles subjects in tests - approves of subject above let - checks subject below hook - checks subject below let with proc argument - checks subject below example - handles subjects in contexts +RuboCop::Cop::RSpec::ScatteredSetup + ignores hooks in different shared contexts + flags multiple before(:all) hooks in the same example group + ignores hooks in different example groups + ignores different hook types + flags hooks with similar metadata + flags multiple hooks in the same example group + ignores similar method names inside of examples + ignores hooks with different metadata + flags multiple hooks of the same scope with different symbols + ignores different hooks 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 + +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))` + flags violations for `expect(page.current_path)` + doesn't flag a violation for other expectations + doesn't flag a violation for other references to `current_path` + autocorrects `expect(page.current_path).to match(variable)` to `expect(page.current_path).to match(variable)` + autocorrects `expect(page.current_path)` to `expect(page.current_path)` + autocorrects `expect(page.current_path).to match(/regexp/i)` to `expect(page).to have_current_path(/regexp/i)` + autocorrects `expect(page.current_path).to match("string/")` to `expect(page).to have_current_path(/string\//)` + 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 eq(foo(bar).path)` to `expect(page).to have_current_path(foo(bar).path, ignore_query: true)` + 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` + autocorrects `expect(current_path).not_to eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` + flags violations for `expect(current_path)` + autocorrects `expect(current_path).to eq(expected_path(f: :b))` to `expect(page).to have_current_path(expected_path(f: :b), ignore_query: true)` + 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/no_tests_spec.rb + +RuboCop::Cop::RSpec::MultipleSubjects + registers an offense for every overwritten subject + does not flag shared example groups + does not try to autocorrect subject! + autocorrects + 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/no_tests_spec.rb -RuboCop::Cop::RSpec::MissingExampleGroupArgument - checks first argument of nested describe - accepts methods with a name like an example block - checks first argument of context - checks first argument of describe - accepts describe with an argument +RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically + registers an offense in a transient block + accepts valid association definitions + accepts valid traits_for_enum definition + registers an offense for offending code + accepts valid factory definitions + does not add offense if method called on a local variable + does not add offense if method called on another object + registers an offense in a trait + registers an offense for an attribute defined on `self` + 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 +` + registers an offense for attributes defined on explicit receiver + does not add offense if out of factory bot block + accepts valid sequence definition 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 @@ -2002,702 +2465,705 @@ flags usage of `never` with `is_expected` flags usage of `never` with `expect_any_instance_of` 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::Cop::RSpec::ExpectOutput - registers an offense for overwriting $stderr within an example scoped hook - does not flag assignments to other global variables - does not flag assignments to $stdout in example_group scope - does not flag assigns to $stdout when in the root scope - does not flag assignments to $stdout outside of example scope - does not register an offense for interacting with $stdout - registers an offense for overwriting $stdout within an example - 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/empty_spec.rb -RuboCop::Cop::RSpec::EmptyLineAfterSubject - handles subjects in tests - approves empty line after subject - approves empty line after subject! - checks for empty line after subject - handles multiline subject block - checks for empty line after subject! - handles subject being the latest node +RuboCop::Cop::RSpec::NotToNot + when AcceptedMethod is `to_not` + detects the `not_to` offense + detects no offense when using `to_not` + detects the `not_to` offense on an expect block 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 - -RuboCop::Cop::RSpec::ExpectChange - with EnforcedStyle `block` - flags change matcher without block - flags implicit block expectation syntax - flags change matcher when receiver is a variable - ignores methods called change - 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 - with EnforcedStyle `method_call` - ignores change method of object that happens to receive a block - ignores blocks that cannot be converted to obj/attribute pair - flags blocks that contain simple message sending - flags implicit block expectation syntax - -RuboCop::Cop::RSpec::NotToNot when EnforcedStyle is `not_to` - detects no offense when using `not_to` detects the `to_not` offense on an expect block detects the `to_not` offense + detects no offense when using `not_to` + +RuboCop::Cop::RSpec::Cop + when the source path starts with `spec/` + registers an offense + when custom patterns are specified + registers offenses when the path matches a custom specified pattern + when the source path contains `/spec/` + registers an offense 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 AcceptedMethod is `to_not` - detects the `not_to` offense - detects the `not_to` offense on an expect block - detects no offense when using `to_not` + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when the source path ends with `_spec.rb` + registers an offense + ignores the file if it is ignored + 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 -RuboCop::Cop::RSpec::ReturnFromStub - with EnforcedStyle `block` - finds nil returned from method - ignores multiple values being returned from method - ignores string with interpolation returned from method - finds static values returned from method - finds concatenated strings with no variables - finds hash with only static values returned from method - finds static values returned from chained method - ignores dynamic values returned from method - with EnforcedStyle `and_return` - ignores hash with dynamic values returned from block - finds nested constants returned from block - ignores stubs without return value - handles stubs in a method - ignores block returning string with interpolation - finds empty values returned from block - finds concatenated strings with no variables - finds static values in a block when there are chained methods - ignores variables return from block - finds hash with only static values returned from block - ignores dynamic values returned from block - finds static values returned from block - finds constants returned from block - finds array with only static values returned from block - ignores array with dynamic values returned from block +RuboCop::RSpec::ExampleGroup + exposes examples in scope + +RuboCop::Cop::RSpec::InstanceVariable + flags several instance variables inside a describe + flags an instance variable inside a shared example + flags an instance variable inside a describe + ignores an instance variable without describe + ignores an instance variable inside a dynamic class + ignores non-spec blocks + ignores instance variables outside of specs 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/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when configured with AssignmentOnly + flags an instance variable when it is also assigned in a sibling example group + flags an instance variable when it is also assigned + ignores an instance variable when it is not assigned + when used in a custom matcher + flags instance variables outside `matcher` + ignores instance variables inside `matcher` + ignores instance variables inside `RSpec::Matchers.define` RuboCop::Cop::RSpec::DescribeClass - ignores view specs + ignores an empty describe + flags normal metadata in describe + checks highlights the first argument of a describe + ignores feature specs + ignores feature specs - also with complex options + supports RSpec.describe + ignores feature specs when RSpec.describe is used doesn't flag top level describe in an unnamed shared context doesn't flag top level describe in a shared example doesn't flag top level describe in a shared context - ignores routing specs - doesn't blow up on single-line describes - ignores request specs - checks first-line describe statements ignores system specs - supports ::RSpec.describe - flags normal metadata in describe - supports RSpec.describe checks describe statements after a require - ignores feature specs when RSpec.describe is used - checks highlights the first argument of a describe - flags specs with non :type metadata - ignores an empty describe - ignores feature specs - also with complex options ignores nested describe statements - ignores feature specs + ignores view specs + ignores request specs + flags specs with non :type metadata + supports ::RSpec.describe + doesn't blow up on single-line describes + ignores routing specs + checks first-line describe statements when argument is a String literal - ignores value constants - checks `camelCase` + ignores value constants with namespace + ignores top-level constants with `::` at start ignores class without namespace - ignores class with namespace checks empty strings - ignores value constants with namespace + ignores class with namespace + ignores value constants + checks `camelCase` checks numbers at start - ignores top-level constants with `::` at start 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 - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -RuboCop::Cop::RSpec::MultipleDescribes - skips single top level describe - finds multiple top level describes with class and method - finds multiple top level describes only with class +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 + body + does not start with a lower case + ends with a punctuation + link to related issue on github + has an issue number prefixed with # + has a valid URL + has a colon and a whitespace at the end + +RuboCop::Cop::RSpec::HooksBeforeExamples + allows inclusion of context before hooks + flags scoped hook after an example + ignores single-line example blocks + does not flag hooks before the examples + flags `before` after `context` + flags `before` after `it` + does not flag `before` in a nested context + flags `after` after an example + flags `before` after `include_examples` 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 -RuboCop::Cop::RSpec::ScatteredLet - works with heredocs - flags scattered `let!`s - doesnt flag `let!` in the middle of multiple `let`s - flags `let` at different nesting levels - flags `let` after the first different node - flags `let` with proc argument +RuboCop::Cop::RSpec::EmptyHook 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/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 `before` hook + detects offense for empty `before` with :context scope + detects offense for empty `before` with :each scope + detects offense for empty `before` with :all scope + detects offense for empty `before` with :suite scope + detects offense for empty `before` + accepts multiline `before` hook + detects offense for empty `before` with :example scope + autocorrects `before` with semicolon + accepts non-empty `before` hook + with `prepend_after` hook + accepts non-empty `prepend_after` hook + accepts multiline `prepend_after` hook + detects offense for empty `prepend_after` + with `after` hook + detects offense for empty `after` + accepts multiline `after` hook + accepts non-empty `after` hook + with `append_after` hook + accepts non-empty `append_after` hook + detects offense for empty `append_after` + accepts multiline `append_after` hook + with `prepend_before` hook + accepts multiline `prepend_before` hook + detects offense for empty `prepend_before` + accepts non-empty `prepend_before` hook + with `append_before` hook + detects offense for empty `append_before` + accepts non-empty `append_before` hook + accepts multiline `append_before` hook + with `around` hook + accepts non-empty `around` hook + detects offense for empty `around` + accepts multiline `around` hook -RuboCop::Cop::RSpec::MessageSpies - when EnforcedStyle is receive - flags expect(...).to have_received with - generates a todo based on the detected style - flags expect(ivar).to have_received - flags expect(...).to_not have_received - generates a todo based on the detected style - flags expect(lvar).to have_received - flags expect(...).to have_received at_most - flags expect(...).not_to have_received - flags expect(const).to have_received - flags expect(send).to have_received - approves of expect(...).to receive - when EnforcedStyle is have_received - flags expect(...).to receive at_most - flags expect(send).to receive - generates a todo based on the detected style - flags expect(...).not_to receive - flags expect(ivar).to receive - approves of expect(...).to have_received - flags expect(lvar).to receive - flags expect(const).to receive - flags expect(...).to receive with - generates a todo based on the detected style - flags expect(...).to_not receive +RuboCop::Cop::RSpec::RepeatedExampleGroupBody + registers offense only for RSPEC namespace example groups in any order + does not register offense for example groups in different groups + registers an offense for when module arg and namespace are identical + does not register offense if module arg is different + registers offense only for example group + does not register offense when module arg namespace is different + registers an offense for repeated context body + does not register offense with several docstring + registers offense for different groups + registers an offense for several repeated context body + skips `skip` and `pending` statements + registers offense no descriptions and similar body + does not register offense for different block body implementation + does not register offense for same examples with different data + registers offense only for RSPEC namespace example groups + does not register offense if metadata is different + registers offense correctly if example groups are separated + does not register offense if no descriptions, but different body + registers an offense for repeated describe body 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 -RuboCop::Cop::RSpec::HooksBeforeExamples - flags `before` after `it` - flags `before` after `include_examples` - flags scoped hook after an example - allows inclusion of context before hooks - ignores single-line example blocks - does not flag hooks before the examples - does not flag `before` in a nested context - flags `after` after an example - flags `before` after `context` +RuboCop::Cop::RSpec::IteratedExpectation + ignores `each` without expectation + flags `each` with multiple expectations + ignores `each` when there is a negative expectation + ignores assignments in the iteration + flags `each` with an expectation + ignore `each` when the body does not contain only expectations + flags `each` when expectation calls method with arguments + ignores `each` with expectation on property + 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/empty_spec.rb + +RuboCop::Cop::RSpec::ContextWording + finds shared_context without `when` at the beginning + skips describe blocks + finds context without `when` at the beginning + skips descriptions beginning with 'when' + 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 metadata hash + finds context without separate `when` at the beginning + with mixed metadata + finds context without separate `when` 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/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::VerifiedDoubles - ignores doubles that have no name specified - finds a `double` instead of an `instance_double` - ignores instance_doubles - when configured not to ignore nameless doubles - flags doubles that have no name specified - when configured to ignore symbolic names - still flags doubles whose name is a string - ignores doubles whose name is a symbol - when configuration does not specify IgnoreSymbolicNames - find doubles whose name is a symbol - finds a `spy` instead of an `instance_spy` +RuboCop::Cop::RSpec::ReturnFromStub + with EnforcedStyle `and_return` + finds static values in a block when there are chained methods + ignores hash with dynamic values returned from block + ignores variables return from block + finds constants returned from block + handles stubs in a method + finds nested constants returned from block + ignores dynamic values returned from block + ignores block returning string with interpolation + finds array with only static values returned from block + finds hash with only static values returned from block + ignores stubs without return value + finds empty values returned from block + ignores array with dynamic values returned from block + finds static values returned from block + finds concatenated strings with no variables 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 + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + with EnforcedStyle `block` + ignores string with interpolation returned from method + finds static values returned from method + ignores dynamic values returned from method + finds concatenated strings with no variables + finds static values returned from chained method + finds nil returned from method + finds hash with only static values returned from method + ignores multiple values being returned from method -RuboCop::Cop::RSpec::EmptyLineAfterFinalLet - handles multiline let block - allows comment followed by an empty line after let - approves empty line after let - handles silly HEREDOC syntax for let - checks for empty line after let with proc argument - check for empty line after the last `let!` - handles silly HEREDOC offense - checks for empty line after last let - handles HEREDOC for let - handles let being the latest node - handles let in tests - flags missing empty line after a multiline comment after last let - flags missing empty line after the comment that comes after last let - ignores empty lines between the lets +RuboCop::Cop::RSpec::RepeatedExampleGroupDescription + does not register offense for describe block with additional docstring + considers interpolated docstrings as different descriptions + registers an offense for repeated context descriptions + registers an offense with right pointing to lines of code + does not register offense for different block descriptions + registers offense only for RSPEC namespace example groups in any order + registers an offense for repeated describe descriptions + registers offense correctly for interpolated docstrings + registers offense only for RSPEC namespace example groups + does not register offense for example group without descriptions + registers offense only for example group + considers different classes as different descriptions + registers offense correctly if example groups are separated + register offense if same method used in docstring + register offense for different example group with similar descriptions + 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/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/weird_rspec_spec.rb -RuboCop::Cop::RSpec::FactoryBot::CreateList - when EnforcedStyle is :n_times - flags usage of FactoryGirl.create_list - autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` - autocorrects `create_list :user, 5` to `5.times { create :user }` - flags usage of FactoryGirl.create_list with a block - flags usage of create_list - 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 }` - ignores create method of other object - when EnforcedStyle is :create_list - flags usage of n.times when FactoryGirl.create is used - ignores n.times when there is other calls but create - ignores n.times with argument - autocorrects `5.times { create :user, :trait, key: val }` to `create_list :user, 5, :trait, key: val` - autocorrects `5.times { create :user }` to `create_list :user, 5` - autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` - ignores n.times when there is no create call inside - ignores create in other block - 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 } -` - flags FactoryGirl.create calls with a block - autocorrects ` 3.times do - create(:user, :trait) do |user| - create :account, user: user - create :profile, user: user - end - end -` to ` create_list(:user, 3, :trait) do |user| - create :account, user: user - create :profile, user: user - end -` - flags usage of n.times when FactoryBot.create is used - ignores create method of other object - flags usage of n.times with no arguments +RuboCop::Cop::RSpec::ImplicitBlockExpectation + flags named subject + flags proc + ignores normal local subject + flags lambda in subject! + ignores non-lambda subject + flags Proc.new + flags literal lambda + ignores named subject with deeply nested lambda + flags lambda in subject + flags when subject is defined in the outer example group + flags with `should_not` as implicit subject + ignores when there is no subject defined + flags with `should` as implicit 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/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::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` - 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 -` - autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).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` - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be_truthy` - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be_truthy` - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be_truthy` - accepts non-predicate matcher - 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 do; end` to `expect(foo.all? do; end).to be_truthy` - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be_truthy` - autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` - registers an offense for a predicate mather with argument - autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be_truthy` - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be_truthy` - registers an offense for a predicate mather - registers an offense for a predicate matcher with a block - accepts built in matchers - when custom matchers are allowed - accepts custom allowed explicit matchers - when strict is true - autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be(true)` - registers an offense for a predicate mather - registers an offense for a predicate matcher with a block - accepts non-predicate matcher - autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be(true)` - autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be(true)` - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).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) +RuboCop::RSpec::Wording + rewrites "should search the internet" as "searches the internet" + rewrites "shouldn't" as "does not" + rewrites "shouldn't be true" as "is not true" + rewrites "should really only return one item" as "really only returns one item" + rewrites "should" as "" + rewrites "should WORRY" as "WORRIES" + rewrites "should not" as "does not" + rewrites "should buy the product" as "buys the product" + rewrites "should worry about the future" as "worries about the future" + rewrites "should WISH me luck" as "WISHES me luck" + rewrites "should miss me" as "misses me" + rewrites "should obey my orders" as "obeys my orders" + rewrites "should fax the document" as "faxes the document" + rewrites "should pay for pizza" as "pays for pizza" + rewrites "should deploy the app" as "deploys the app" + rewrites "should wish me luck" as "wishes me luck" + rewrites "SHOULDN'T BE true" as "IS NOT true" + rewrites "should echo the input" as "echoes the input" + rewrites "shouldn't return something" as "does not return something" + rewrites "should alias the method" as "aliases the method" + rewrites "should amass debt" as "amasses debt" + rewrites "should fizz" as "fizzes" + rewrites "should not return something" as "does not return something" + rewrites "should return something" as "returns something" + rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" + rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" + rewrites "should do nothing" as "does nothing" + rewrites "should have sweets" as "has sweets" + rewrites "" as "" + +RuboCop::RSpec::Hook + extracts name + #scope + defaults to example hook with hash metadata + ignores other arguments to hooks + interprets around(:example) { } as having scope each + interprets before(:all) { } as having scope context + interprets after(:suite) { } as having scope suite + interprets before(:each) { } as having scope each + interprets after { } as having scope each + interprets around(:context) { } as having scope context + classifies :each as an example hook + #knowable_scope? + knows the scope of a hook with a symbol literal + knows the scope of a hook with hash metadata + knows the scope of a hook with no argument + does not break if a hook is not given a symbol literal + #metadata + extracts hash metadata with no scope given + withstands no arguments + extracts hash metadata + combines symbol and hash metadata + extracts symbol metadata + +RuboCop::Cop::RSpec::LetBeforeExamples + flags `let` with proc argument + flags `let` after `include_examples` + does not flag `let` before the examples + allows inclusion of context before `let` + flags `let` after `context` + does not flag `let` in a nested context + autocorrects ` RSpec.describe User do + include_examples('should be after let') + + let(:foo) { (<<-SOURCE) } + some long text here + SOURCE + end +` to ` RSpec.describe User do + let(:foo) { (<<-SOURCE) } + some long text here + SOURCE + include_examples('should be after let') + + end ` - 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 { }` to `expect(foo.all? { }).to be(true)` - registers an offense for a predicate mather with argument - autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` - accepts built in matchers - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(true)` - autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` - autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be(true)` - when custom matchers are allowed - accepts custom allowed explicit matchers + ignores single-line example blocks + flags `let` after `it` 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/no_tests_spec.rb - when enforced style is `inflected` - when strict is false - 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.empty?).not_to be(false)` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` - 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.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 - registers an offense for a predicate method with built-in equiv - accepts non-predicate method - accepts a predicate method that is not ckeced true/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.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` - autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` - 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` - registers an offense for a predicate method with argument - autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` - autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` - autocorrects `expect(foo.empty?).not_to be(true)` to `expect(foo).not_to be_empty` - registers an offense for a predicate method with a block - autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).to eq(true)` to `expect(foo).to be_empty` - 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.empty?).not_to be_falsey` to `expect(foo).to be_empty` - 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.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)` - when strict is true - accepts a predicate method that is not ckeced true/false - autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` - autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` - autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` - 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.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - 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.empty?).not_to be_falsey` to `expect(foo).to be_empty` - registers an offense for a predicate method with built-in equiv - 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.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` - 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 be_falsey` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` - autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` - registers an offense for a predicate method with a block - registers an offense for a predicate method in actual - autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` - autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` - autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` - autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - registers an offense for a predicate method with argument - autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` - autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` - accepts strict checking boolean matcher + does not crash on smoke test: spec/smoke_tests/empty_spec.rb RuboCop::Cop::RSpec::Focus - does not flag a method that is focused twice - does not flag unfocused specs flags focused block types + does not flag unfocused specs flags rspec example blocks that include `:focus` preceding a hash - flags all rspec example blocks that include `:focus` flags all rspec example blocks with that include `focus: true` + flags all rspec example blocks that include `:focus` + does not flag a method that is focused twice ignores non-rspec code with :focus blocks 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/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb -Project requires - alphabetizes cop requires +RuboCop::Cop::RSpec::OverwritingSetup + works with `subject!` and `let!` + handles string arguments + ignores overwriting in different context + handles dynamic names for `let` + finds overwriten `subject` + handles unnamed subjects + finds `let!` overwriting `let` + finds overwriten `let` + 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 -RuboCop::Cop::RSpec::EmptyLineAfterHook - approves empty line after `around` hook - checks for empty line after `around` hook - checks for empty line after `after` hook - checks for empty line after `before` hook - handles multiline `before` block - approves empty line after `before` hook - handles multiline `around` block - handles multiline `after` block - approves empty line after `after` hook - handles `before` being the latest node +RuboCop::Cop::RSpec::ExpectInHook + accepts `allow` in `before` hook + adds an offense for `expect` in `before` hook + accepts an empty `before` hook + accepts `expect` in `it` + adds an offense for `expect` in `around` hook + adds an offense for `expect` in `after` hook + adds an offense for `expect` with block in `before` 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/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::FilePath + registers an offense for a file missing _spec + registers an offense for a wrong class name + checks class specs + allows flexibility with predicates + uses relative path for sibling directory project + allows different parent directories + allows flat hierarchies for instance methods + registers an offense for a repeated .rb + registers an offense for a bad path + checks instance methods + handles ACRONYMClassNames + uses relative path + skips specs that do have multiple top level describes + registers an offense for a file missing a .rb + allows flexibility with operators + allows bang method + registers an offense for a wrong class name with a symbol argument + allows subdirs for class methods + allows flat hierarchies for class methods + uses relative path for different path project + registers an offense for a wrong class but a correct method + registers an offense for a wrong class and highlights metadata + handles CamelCaps class names + handles ALLCAPS class names + handles alphanumeric class names + allows subdirs for instance methods + checks class methods + ignores non-alphanumeric characters + skips specs that do not describe a class / method + when configured with SpecSuffixOnly + registers an offense when _spec.rb suffix is missing + does not care about the described class + 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 + when configured with CustomTransform + ignores routing specs + respects custom module name transformation + when configured with IgnoreMethods + does not care about the described method -RuboCop::Cop::RSpec::NestedGroups - support --auto-gen-config - counts nesting correctly when non-spec nesting - flags nested contexts - ignores non-spec context methods - when configured with MaxNesting - emits a deprecation warning - when Max is configured as 2 - flags two levels of nesting +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/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 + 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 + 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 -RuboCop::RSpec::DescriptionExtractor - builds a hash of descriptions - -RuboCop::Cop::RSpec::EmptyHook - with `prepend_before` hook - accepts multiline `prepend_before` hook - accepts non-empty `prepend_before` hook - detects offense for empty `prepend_before` +RuboCop::Cop::RSpec::ImplicitSubject 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 `after` hook - accepts non-empty `after` hook - accepts multiline `after` hook - detects offense for empty `after` - with `around` hook - accepts non-empty `around` hook - accepts multiline `around` hook - detects offense for empty `around` - with `append_after` hook - accepts non-empty `append_after` hook - accepts multiline `append_after` hook - detects offense for empty `append_after` - with `prepend_after` hook - accepts non-empty `prepend_after` hook - detects offense for empty `prepend_after` - accepts multiline `prepend_after` hook - with `append_before` hook - accepts multiline `append_before` hook - detects offense for empty `append_before` - accepts non-empty `append_before` hook - with `before` hook - detects offense for empty `before` with :example scope - detects offense for empty `before` with :suite scope - detects offense for empty `before` - detects offense for empty `before` with :all scope - detects offense for empty `before` with :each scope - detects offense for empty `before` with :context scope - accepts non-empty `before` hook - autocorrects `before` with semicolon - accepts multiline `before` hook + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + with EnforcedStyle `disallow` + allows `is_expected` inside `its` block + flags `is_expected` in multi-line examples + flags `should` in multi-line examples + flags `is_expected` in single-line examples + flags `should` in single-line examples + with EnforcedStyle `single_statement_only` + allows `is_expected` in multi-line example with single statement + flags `is_expected` in multi-statement examples + with EnforcedStyle `single_line_only` + allows `is_expected` in single-line examples + flags `should` in multi-line examples + does not flag methods called is_expected and should + allows `is_expected` inside `its` block, in multi-line examples + allows `should` in single-line examples + flags `is_expected` in multi-line examples + detects usage of `is_expected` inside helper methods RuboCop::Cop::RSpec::ExampleLength ignores comments - allows an empty example allows a short example ignores non-spec blocks - when inspecting large examples - flags the example + allows an empty example 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/factory_bot_spec.rb + when inspecting large examples + flags the example with CountComments enabled flags the example -RuboCop::Cop::RSpec::NamedSubject - 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 around(:each) for explicit subject usage - checks before and after for explicit subject usage +RuboCop::Cop::RSpec::MessageSpies + when EnforcedStyle is receive + flags expect(...).not_to have_received + flags expect(send).to have_received + flags expect(ivar).to have_received + flags expect(...).to_not have_received + generates a todo based on the detected style + flags expect(...).to have_received at_most + approves of expect(...).to receive + flags expect(...).to have_received with + generates a todo based on the detected style + flags expect(lvar).to have_received + flags expect(const).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/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 IgnoreSharedExamples is true - ignores explicit subject in shared_examples - behaves like checking subject outside of shared examples - ignores subject when not wrapped inside a test - checks around(:each) for explicit subject usage - checks `it` and `specify` for explicit subject usage - checks before and after for explicit subject usage - -RuboCop::Cop::RSpec::OverwritingSetup - works with `subject!` and `let!` - finds `let!` overwriting `let` - finds overwriten `subject` - ignores overwriting in different context - handles unnamed subjects - finds overwriten `let` - handles string arguments - handles dynamic names for `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 + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when EnforcedStyle is have_received + flags expect(...).to receive at_most + flags expect(...).to_not receive + approves of expect(...).to have_received + flags expect(...).to receive with + flags expect(...).not_to receive + generates a todo based on the detected style + flags expect(const).to receive + flags expect(ivar).to receive + generates a todo based on the detected style + flags expect(send).to receive + flags expect(lvar).to receive -RuboCop::Cop::RSpec::SharedContext - shared_examples - registers an offense for shared_examples with only let - does not register an offense for `shared_examples` with it - registers an offense for shared_examples with only hooks - registers an offense for shared_examples with only subject - does not register an offense for empty examples - shared_context - does not register an offense for `shared_context` with subject - does not register an offense for `shared_context` with let - registers an offense for shared_context with only examples - does not register an offense for empty contexts - does not register an offense for `shared_context` with before +RuboCop::Cop::RSpec::UnspecifiedException 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/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb + with raise_error matcher + allows classes with blocks with braces + detects the `unspecified_exception` offense + allows empty exception specification when not expecting an error + allows classes with blocks with do/end + allows exception types with messages + allows exception messages + allows exception types with matching regular expressions + allows exception matching regular expressions + allows exception classes + allows parameterized exceptions + with raise_exception matcher + allows parameterized exceptions + allows exception messages + allows empty exception specification when not expecting an error + allows exception matching regular expressions + detects the `unspecified_exception` offense + allows exception types with matching regular expressions + allows classes with blocks with do/end + allows exception types with messages + allows exception classes + allows classes with blocks with braces -RuboCop::Cop::RSpec::ReceiveCounts - allows exactly(1).times when not called on `receive` - flags usage of `at_least(1).times` - flags usage of `exactly(2).times` - flags usage of `at_most(2).times` - flags usage of `exactly(1).times` with a block - flags usage of `exactly(1).times` with return value - flags usage of `at_least(2).times` with a block - allows `exactly(3).times` - flags usage of `at_least(2).times` - flags usage of `exactly(1).times` after `with` - flags usage of `exactly(1).times` - flags usage of `at_most(1).times` - allows `exactly(n).times` - autocorrects `expect(foo).to have_published_event(:bar).exactly(2).times` to `expect(foo).to have_published_event(:bar).exactly(2).times` +RuboCop::Cop::RSpec::DescribeMethod + ignores describes with only a class + skips methods starting with a . or # + skips specs not having a string second argument + enforces non-method names 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 + 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::RepeatedExample - does not flag repeated examples in different scopes - registers an offense for repeated example - 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 +RuboCop::Cop::RSpec::MessageExpectation + when EnforcedStyle is expect + generates a todo based on the detected style + generates a todo based on the detected style + approves of expect(...).to receive + flags allow(...).to receive + when EnforcedStyle is allow + flags expect(...).to receive + generates a todo based on the detected style + approves of allow(...).to receive + generates a todo based on the detected style 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/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::ContextMethod - flags context with `#` at the beginning - ignores describe blocks - flags context with `.` at the beginning +RuboCop::Cop::RSpec::EmptyLineAfterExample + flags one-line examples + flags mixed one-line and multi-line examples + ignores when an empty line is present + flags a missing empty line after `it` + ignores consecutive one-liners + flags a missing empty line after `specify` 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/no_tests_spec.rb + when AllowConsecutiveOneLiners is false + ignores consecutive one-liners -RuboCop::Cop::RSpec::InstanceVariable - flags an instance variable inside a describe - ignores non-spec blocks - flags an instance variable inside a shared example - ignores an instance variable inside a dynamic class - ignores instance variables outside of specs - flags several instance variables inside a describe - ignores an instance variable without describe - when configured with AssignmentOnly - flags an instance variable when it is also assigned in a sibling example group - flags an instance variable when it is also assigned - ignores an instance variable when it is not assigned +RuboCop::Cop::RSpec::MultipleExpectations + generates a todo based on the worst violation + without configuration + approves of one expectation per example + 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 + flags multiple expects with blocks + with metadata + ignores example groups with `aggregate_failures: true` + prefers example metadata over example group metadata + checks examples with `aggregate_failures: false` + checks examples with siblings with `aggregate_failures: true` + ignores examples with `aggregate_failures: true` + ignores example groups with `:aggregate_failures` + ignores examples with `:aggregate_failures` + ignores examples with `aggregate_failures: true` defined deeply + checks example groups with `aggregate_failures: false` + with Max configuration + flags three expectations + permits two expectations 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/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when used in a custom matcher - ignores instance variables inside `matcher` - ignores instance variables inside `RSpec::Matchers.define` - flags instance variables outside `matcher` + does not crash on smoke test: spec/smoke_tests/factory_bot_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::BeEql + registers an offense for `eql` when argument is a float + registers an offense for `eql` when argument is a boolean + registers an offense for `eql` when argument is an integer + registers an offense for `eql` when argument is a symbol + does not register an offense for `eql` when argument is a string + registers an offense for `eql` when argument is nil + does not register an offense for `eql` when expectation is negated 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/no_tests_spec.rb - - - is insane + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb RuboCop::Cop::RSpec::Capybara::FeatureMethods + flags violations for `xscenario` + ignores feature calls outside spec + allows includes before the spec + flags violations for `given` + autocorrects ` describe Foo do + scenario { } + end +` to ` describe Foo do + it { } + end +` + flags violations for `given!` flags violations for `background` + ignores variables inside examples autocorrects ` describe Foo do - RSpec.feature { } + xscenario { } end ` to ` describe Foo do - RSpec.describe { } + xit { } end ` - flags violations for `given` - ignores feature calls outside spec - allows includes before the spec flags violations for `feature` autocorrects ` describe Foo do background { } @@ -2706,16 +3172,14 @@ before { } end ` - flags violations for `given!` + flags violations for `scenario` autocorrects ` describe Foo do - scenario { } + given!(:foo) { } end ` to ` describe Foo do - it { } + let!(:foo) { } end ` - flags violations for `xscenario` - ignores variables inside examples autocorrects ` describe Foo do given(:foo) { } end @@ -2724,511 +3188,117 @@ end ` autocorrects ` describe Foo do - given!(:foo) { } - end -` to ` describe Foo do - let!(:foo) { } - end -` - autocorrects ` describe Foo do - xscenario { } + RSpec.feature { } end ` to ` describe Foo do - xit { } + RSpec.describe { } end ` - flags violations for `scenario` - 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 with configured `EnabledMethods` flags other methods ignores usage of the enabled method - -RuboCop::Cop::RSpec::RepeatedDescription - does not flag descriptions with different interpolated variables - does not flag examples with same metadata and different description - does not flag tests which do not contain description strings - ignores descriptions repeated in a shared context - does not flag different methods used as docstring - registers offense for repeated descriptions separated by a context - does not flag different descriptions in different iterators - registers offense for repeated description and metadata - does not flag examples if metadata is different - registers an offense for repeated descriptions - registers offense for repeated description in different iterators - ignores repeated descriptions in a nested context - registers offense if same method used in docstring - registers offense for repeated description in same iterator 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 - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::FactoryBot::FactoryClassName +RuboCop::Cop::RSpec::Dialect + registers an offense for context blocks + allows describe blocks + registers an offense for RSpec.context blocks + allows calling methods named context in examples + without preferred methods + allows all methods blocks 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 not passing block - ignores passing class name - flags passing a class - when passing block - flags passing a class from global namespace - flags passing a class - flags passing a subclass - ignores passing class name - ignores passing OpenStruct - ignores passing Hash - -RuboCop::Cop::RSpec::SubjectStub - flags nested subject stubs when example group does not define subject - ignores stub within context where subject name changed - flags negated runners - flags when an implicit subject is mocked - flags spy subject stubs - flags one-line expectcation syntax - flags stub inside all matcher - flags nested subject stubs when adjacent context redefines - flags nested subject stubs when nested subject uses same name - flags deeply nested subject stubs - flags when an unnamed subject is mocked - flags when there are several top level example groups - flags an expectation made on an unnamed subject - flags nested subject stubs - flags when subject is stubbed - flags when subject is stubbed and there are several named subjects in the same example group - flags chain stubs - flags multiple-method stubs - ignores nested stubs when nested subject is anonymous - flags when subject is mocked - top level example groups - flags in top level example_group - flags in top level shared_context - flags in top level context - flags in top level xfeature - flags in top level xcontext - flags in top level fdescribe - flags in top level fcontext - flags in top level xdescribe - flags in top level ffeature - flags in top level describe - flags in top level shared_examples_for - flags in top level shared_examples - flags in top level feature - 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::SharedExamples - does not register an offense when using string title - does not register an offense when using Module/Class title - registers an offense when using symbolic title +RuboCop::Cop::RSpec::InvalidPredicateMatcher + registers an offense for double question with `have_something?` + registers an offense for double question with `not_to` + registers an offense for double question + registers an offense for double question with `to_not` + accepts valid predicate matcher 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/factory_bot_spec.rb - -RuboCop::RSpec::Hook - extracts name - #metadata - withstands no arguments - extracts hash metadata with no scope given - extracts symbol metadata - extracts hash metadata - 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 - ignores other arguments to hooks - defaults to example hook with hash metadata - classifies :each as an example hook - interprets after { } as having scope each - interprets before(:each) { } as having scope each - interprets around(:context) { } as having scope context - interprets around(:example) { } as having scope each - interprets after(:suite) { } as having scope suite - interprets before(:all) { } as having scope context + does not crash on smoke test: spec/smoke_tests/empty_spec.rb RuboCop::RSpec::Language::SelectorSet compares by value composes sets + #node_pattern + builds a node pattern + #include? + returns false for selectors not in the set + returns true for selectors in the set #node_pattern_union builds a node pattern union #send_pattern builds a send matching pattern #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 - -RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation - autocorrects `expect(current_path).to eq(expected_path(f: :b))` to `expect(page).to have_current_path(expected_path(f: :b), ignore_query: true)` - autocorrects `expect(page.current_path).to match("string/")` to `expect(page).to have_current_path(/string\//)` - 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)` - autocorrects `expect(page.current_path).to match(variable)` to `expect(page.current_path).to match(variable)` - flags violations for `expect(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` 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(current_path).to_not eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` - doesn't flag a violation for other expectations - autocorrects `expect(page.current_path).to match(/regexp/i)` to `expect(page).to have_current_path(/regexp/i)` - autocorrects `expect(page.current_path)` to `expect(page.current_path)` - autocorrects `expect(current_path).not_to eq expected_path` to `expect(page).to have_no_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/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 - -RuboCop::RSpec::Wording - rewrites "should WORRY" as "WORRIES" - rewrites "should really only return one item" as "really only returns one item" - rewrites "should wish me luck" as "wishes me luck" - rewrites "should have sweets" as "has sweets" - rewrites "should buy the product" as "buys the product" - rewrites "should miss me" as "misses me" - rewrites "should deploy the app" as "deploys the app" - rewrites "should not" as "does not" - rewrites "should obey my orders" as "obeys my orders" - rewrites "should alias the method" as "aliases the method" - rewrites "should do nothing" as "does nothing" - rewrites "SHOULDN'T BE true" as "IS NOT true" - rewrites "should WISH me luck" as "WISHES me luck" - rewrites "should fax the document" as "faxes the document" - rewrites "should" as "" - rewrites "shouldn't return something" as "does not return something" - rewrites "should search the internet" as "searches the internet" - rewrites "shouldn't" as "does not" - rewrites "should not return something" as "does not return something" - rewrites "shouldn't be true" as "is not true" - rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" - rewrites "should return something" as "returns something" - rewrites "should echo the input" as "echoes the input" - rewrites "should pay for pizza" as "pays for pizza" - rewrites "should worry about the future" as "worries about the future" - rewrites "" as "" - rewrites "should amass debt" as "amasses debt" - rewrites "should fizz" as "fizzes" - rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" -RuboCop::Cop::RSpec::ImplicitBlockExpectation - flags when subject is defined in the outer example group - ignores when there is no subject defined - flags with `should_not` as implicit subject - flags literal lambda - flags lambda in subject! - flags with `should` as implicit subject - flags proc - flags Proc.new - ignores named subject with deeply nested lambda - ignores normal local subject - flags named subject - ignores non-lambda subject - flags lambda in subject - 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::MessageExpectation - when EnforcedStyle is expect - flags allow(...).to receive - generates a todo based on the detected style - generates a todo based on the detected style - approves of expect(...).to receive - when EnforcedStyle is allow - flags expect(...).to receive - generates a todo based on the detected style - generates a todo based on the detected style - approves of allow(...).to receive - 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 - -RuboCop::Cop::RSpec::UnspecifiedException - with raise_error matcher - allows exception types with matching regular expressions - detects the `unspecified_exception` offense - allows classes with blocks with do/end - allows parameterized exceptions - allows exception types with messages - allows exception classes - allows exception messages - allows empty exception specification when not expecting an error - allows classes with blocks with braces - allows exception matching regular expressions - with raise_exception matcher - allows parameterized exceptions - detects the `unspecified_exception` offense - allows exception messages - allows exception types with messages - allows classes with blocks with do/end - allows exception types with matching regular expressions - allows exception matching regular expressions - allows empty exception specification when not expecting an error - allows exception classes - allows classes with blocks with 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/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::InvalidPredicateMatcher - registers an offense for double question with `to_not` - registers an offense for double question - registers an offense for double question with `not_to` - accepts valid predicate matcher - registers an offense for double question with `have_something?` - 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::MultipleExpectations - generates a todo based on the worst violation - with metadata - ignores examples with `aggregate_failures: true` - ignores example groups with `:aggregate_failures` - checks examples with siblings with `aggregate_failures: true` - checks example groups with `aggregate_failures: false` - ignores examples with `aggregate_failures: true` defined deeply - checks examples with `aggregate_failures: false` - prefers example metadata over example group metadata - ignores examples with `:aggregate_failures` - ignores example groups with `aggregate_failures: true` - with Max configuration - flags three expectations - permits two expectations - 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 - without configuration - flags multiple is_expected - flags multiple expectations - flags multiple expects with blocks - counts aggregate_failures as one expectation - approves of one expectation per example - counts every aggregate_failures as an expectation - flags multiple expect_any_instance_of - -RuboCop::Cop::RSpec::VariableDefinition - when EnforcedStyle is `strings` - registers an offense for interpolated symbol - does not register offense for string names - registers an offense for symbol name +RuboCop::Cop::RSpec::RepeatedDescription + ignores repeated descriptions in a nested context + does not flag examples if metadata is different + does not flag examples with same metadata and different description + registers offense for repeated description in different iterators + registers offense for repeated description and metadata + ignores descriptions repeated in a shared context + does not flag tests which do not contain description strings + does not flag different descriptions in different iterators + does not flag different methods used as docstring + does not flag descriptions with different interpolated variables + registers offense if same method used in docstring + registers an offense for repeated descriptions + registers offense for repeated description in same iterator + registers offense for repeated descriptions separated by a 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/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 EnforcedStyle is `symbols` - registers an offense for string name - does not register offense for symbol names - registers an offense for multiline string - registers an offense for interpolated string - -RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup - approves empty line after describe - checks for empty line after context - handles describes in an if block - approves empty line after context - highlights single line formulations correctly - checks for empty line after describe - 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::VoidExpect - accepts non-void `expect` with block - registers offenses to void `expect` with block - registers offenses to void `expect` when block has one expression - registers offenses to void `expect` - accepts non-void `expect` +RuboCop::Cop::RSpec::RepeatedExample + does not flag examples when different its arguments are used + does not flag repeated examples in different scopes + registers an offense for repeated example + does not flag examples with different implementations + does not register a violation if rspec tag magic is involved 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 -RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically - does not add offense if method called on a local variable - does not add offense if method called on another object - registers an offense for attributes defined on explicit receiver - registers an offense in a transient block - does not add offense if out of factory bot block - accepts valid factory definitions - registers an offense for offending code - registers an offense in a trait - accepts valid sequence definition - accepts valid association definitions - accepts valid traits_for_enum definition - registers an offense for an attribute defined on `self` - 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 -` - 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 - RuboCop::Cop::RSpec::ExampleWithoutDescription - with EnforcedStyle `disallow` - flags missing description in single-line examples + with EnforcedStyle `single_line_only` flags missing description in multi-line examples - ignores `it` with a description + ignores missing description in single-line examples + flags example with an empty string for description with EnforcedStyle `always_allow` - ignores `it` without an argument flags empty strings for description ignores `it` with a description + ignores `it` without an argument 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 - 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::Cop::RSpec::SingleArgumentMessageChain - stub_chain - reports single-argument string calls - accepts multi-argument calls - accepts multi-argument string calls - reports single-argument calls - 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 - receive_message_chain - accepts multi-argument calls - accepts single-argument calls with send node - reports single-argument calls - accepts multi-argument string calls - reports single-argument string calls - accepts single-argument calls with variable - with single-key hash argument - reports an offense - with multiple-element array argument - doesn't report an offense - with single-element array argument - reports an offense - with multiple keys hash argument - doesn't report an offense - -RuboCop::Cop::RSpec::Be - registers an offense for not_to be - allows `be` with an argument - registers an offense for `be` without an argument - 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/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::ExpectInHook - adds an offense for `expect` in `after` hook - adds an offense for `expect` in `around` hook - accepts `expect` in `it` - adds an offense for `expect` in `before` hook - accepts `allow` in `before` hook - adds an offense for `expect` with block in `before` hook - accepts an empty `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/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 EnforcedStyle `disallow` + ignores `it` with a description + flags missing description in multi-line examples + flags missing description in single-line examples -RuboCop::Cop::RSpec::EmptyExampleGroup - does not flag include_examples - flags an empty top level describe - flags an empty context - does not flag methods matching example group names - does not recognize custom include methods by default - when a custom include method is specified - does not flag an otherwise empty example group - 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 - -Finished in 6.7 seconds (files took 1.33 seconds to load) +Finished in 13.07 seconds (files took 3.58 seconds to load) 1499 examples, 0 failures -Randomized with seed 47623 +Randomized with seed 13903 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -3259,12 +3329,14 @@ dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) I: copying local configuration +I: user script /srv/workspace/pbuilder/9462/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/9462/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/15580 and its subdirectories -I: Current time: Tue Jul 26 11:24:29 -12 2022 -I: pbuilder-time-stamp: 1658877869 +I: removing directory /srv/workspace/pbuilder/9462 and its subdirectories +I: Current time: Thu Jun 24 07:07:18 +14 2021 +I: pbuilder-time-stamp: 1624468038