Diff of the two buildlogs: -- --- b1/build.log 2024-07-28 11:17:37.393550348 +0000 +++ b2/build.log 2024-07-28 11:19:50.827884311 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sat Aug 30 05:39:06 -12 2025 -I: pbuilder-time-stamp: 1756575546 +I: Current time: Mon Jul 29 01:17:40 +14 2024 +I: pbuilder-time-stamp: 1722165460 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.JcjsIhLf/trustedkeys.kbx': General error -gpgv: Signature made Fri Jul 24 06:26:59 2020 -12 +gpgv: keyblock resource '/tmp/dpkg-verify-sig.RzHgjRNY/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,135 +30,166 @@ 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/639867/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/D01_modify_environment starting +debug: Running on ionos11-amd64. +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 +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Jul 29 01:17 /bin/sh -> /bin/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/3794305/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=42 ' - DISTRIBUTION='bullseye' - HOME='/root' - HOST_ARCH='amd64' + 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]="x86_64-pc-linux-gnu") + BASH_VERSION='5.1.4(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=20 ' + DIRSTACK=() + DISTRIBUTION=bullseye + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='a660c439a8f34472aaca8705fe1634d3' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='639867' - PS1='# ' - PS2='> ' + INVOCATION_ID=586a615c2e9e4cc9a327b6ab0e159ab7 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-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=3794305 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/r-b-build.58FJlHLF/pbuilderrc_pPLZ --distribution bullseye --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.58FJlHLF/b1 --logfile b1/build.log ruby-rubocop-rspec_1.42.0-1.dsc' - SUDO_GID='111' - SUDO_UID='106' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://213.165.73.152: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/r-b-build.58FJlHLF/pbuilderrc_VX3M --distribution bullseye --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.58FJlHLF/b2 --logfile b2/build.log ruby-rubocop-rspec_1.42.0-1.dsc' + SUDO_GID=111 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://46.16.76.132:3128 I: uname -a - Linux ionos15-amd64 6.9.7+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.7-1~bpo12+1 (2024-07-03) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux I: ls -l /bin total 5476 - -rwxr-xr-x 1 root root 1234376 Mar 27 2022 bash - -rwxr-xr-x 3 root root 38984 Jul 20 2020 bunzip2 - -rwxr-xr-x 3 root root 38984 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 38984 Jul 20 2020 bzip2 - -rwxr-xr-x 1 root root 18424 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 43936 Sep 23 2020 cat - -rwxr-xr-x 1 root root 72672 Sep 23 2020 chgrp - -rwxr-xr-x 1 root root 64448 Sep 23 2020 chmod - -rwxr-xr-x 1 root root 72672 Sep 23 2020 chown - -rwxr-xr-x 1 root root 151168 Sep 23 2020 cp - -rwxr-xr-x 1 root root 125560 Dec 10 2020 dash - -rwxr-xr-x 1 root root 113664 Sep 23 2020 date - -rwxr-xr-x 1 root root 80968 Sep 23 2020 dd - -rwxr-xr-x 1 root root 93936 Sep 23 2020 df - -rwxr-xr-x 1 root root 147176 Sep 23 2020 dir - -rwxr-xr-x 1 root root 84440 Mar 27 2024 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 39712 Sep 23 2020 echo - -rwxr-xr-x 1 root root 28 Jan 24 2023 egrep - -rwxr-xr-x 1 root root 39680 Sep 23 2020 false - -rwxr-xr-x 1 root root 28 Jan 24 2023 fgrep - -rwxr-xr-x 1 root root 69032 Mar 27 2024 findmnt - -rwsr-xr-x 1 root root 34896 Feb 26 2021 fusermount - -rwxr-xr-x 1 root root 203072 Jan 24 2023 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 98048 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 22600 Nov 6 2019 hostname - -rwxr-xr-x 1 root root 72840 Sep 23 2020 ln - -rwxr-xr-x 1 root root 56952 Feb 7 2020 login - -rwxr-xr-x 1 root root 147176 Sep 23 2020 ls - -rwxr-xr-x 1 root root 149736 Mar 27 2024 lsblk - -rwxr-xr-x 1 root root 85184 Sep 23 2020 mkdir - -rwxr-xr-x 1 root root 76896 Sep 23 2020 mknod - -rwxr-xr-x 1 root root 48064 Sep 23 2020 mktemp - -rwxr-xr-x 1 root root 59632 Mar 27 2024 more - -rwsr-xr-x 1 root root 55528 Mar 27 2024 mount - -rwxr-xr-x 1 root root 18664 Mar 27 2024 mountpoint - -rwxr-xr-x 1 root root 147080 Sep 23 2020 mv - lrwxrwxrwx 1 root root 8 Nov 6 2019 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Dec 16 2021 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 43872 Sep 23 2020 pwd - lrwxrwxrwx 1 root root 4 Mar 27 2022 rbash -> bash - -rwxr-xr-x 1 root root 52032 Sep 23 2020 readlink - -rwxr-xr-x 1 root root 72704 Sep 23 2020 rm - -rwxr-xr-x 1 root root 52032 Sep 23 2020 rmdir - -rwxr-xr-x 1 root root 27472 Sep 27 2020 run-parts - -rwxr-xr-x 1 root root 122224 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Aug 9 03:46 sh -> dash - -rwxr-xr-x 1 root root 43808 Sep 23 2020 sleep - -rwxr-xr-x 1 root root 84928 Sep 23 2020 stty - -rwsr-xr-x 1 root root 71912 Mar 27 2024 su - -rwxr-xr-x 1 root root 39744 Sep 23 2020 sync - -rwxr-xr-x 1 root root 531928 Jan 19 2024 tar - -rwxr-xr-x 1 root root 14456 Sep 27 2020 tempfile - -rwxr-xr-x 1 root root 101408 Sep 23 2020 touch - -rwxr-xr-x 1 root root 39680 Sep 23 2020 true - -rwxr-xr-x 1 root root 14328 Feb 26 2021 ulockmgr_server - -rwsr-xr-x 1 root root 35040 Mar 27 2024 umount - -rwxr-xr-x 1 root root 39744 Sep 23 2020 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 147176 Sep 23 2020 vdir - -rwxr-xr-x 1 root root 63744 Mar 27 2024 wdctl - lrwxrwxrwx 1 root root 8 Nov 6 2019 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 5898 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8049 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/639867/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1234376 Mar 28 2022 bash + -rwxr-xr-x 3 root root 38984 Jul 21 2020 bunzip2 + -rwxr-xr-x 3 root root 38984 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 38984 Jul 21 2020 bzip2 + -rwxr-xr-x 1 root root 18424 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 43936 Sep 24 2020 cat + -rwxr-xr-x 1 root root 72672 Sep 24 2020 chgrp + -rwxr-xr-x 1 root root 64448 Sep 24 2020 chmod + -rwxr-xr-x 1 root root 72672 Sep 24 2020 chown + -rwxr-xr-x 1 root root 151168 Sep 24 2020 cp + -rwxr-xr-x 1 root root 125560 Dec 11 2020 dash + -rwxr-xr-x 1 root root 113664 Sep 24 2020 date + -rwxr-xr-x 1 root root 80968 Sep 24 2020 dd + -rwxr-xr-x 1 root root 93936 Sep 24 2020 df + -rwxr-xr-x 1 root root 147176 Sep 24 2020 dir + -rwxr-xr-x 1 root root 84440 Mar 29 00:09 dmesg + lrwxrwxrwx 1 root root 8 Nov 8 2019 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Nov 8 2019 domainname -> hostname + -rwxr-xr-x 1 root root 39712 Sep 24 2020 echo + -rwxr-xr-x 1 root root 28 Jan 25 2023 egrep + -rwxr-xr-x 1 root root 39680 Sep 24 2020 false + -rwxr-xr-x 1 root root 28 Jan 25 2023 fgrep + -rwxr-xr-x 1 root root 69032 Mar 29 00:09 findmnt + -rwsr-xr-x 1 root root 34896 Feb 27 2021 fusermount + -rwxr-xr-x 1 root root 203072 Jan 25 2023 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 98048 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 22600 Nov 8 2019 hostname + -rwxr-xr-x 1 root root 72840 Sep 24 2020 ln + -rwxr-xr-x 1 root root 56952 Feb 8 2020 login + -rwxr-xr-x 1 root root 147176 Sep 24 2020 ls + -rwxr-xr-x 1 root root 149736 Mar 29 00:09 lsblk + -rwxr-xr-x 1 root root 85184 Sep 24 2020 mkdir + -rwxr-xr-x 1 root root 76896 Sep 24 2020 mknod + -rwxr-xr-x 1 root root 48064 Sep 24 2020 mktemp + -rwxr-xr-x 1 root root 59632 Mar 29 00:09 more + -rwsr-xr-x 1 root root 55528 Mar 29 00:09 mount + -rwxr-xr-x 1 root root 18664 Mar 29 00:09 mountpoint + -rwxr-xr-x 1 root root 147080 Sep 24 2020 mv + lrwxrwxrwx 1 root root 8 Nov 8 2019 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Dec 17 2021 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 43872 Sep 24 2020 pwd + lrwxrwxrwx 1 root root 4 Mar 28 2022 rbash -> bash + -rwxr-xr-x 1 root root 52032 Sep 24 2020 readlink + -rwxr-xr-x 1 root root 72704 Sep 24 2020 rm + -rwxr-xr-x 1 root root 52032 Sep 24 2020 rmdir + -rwxr-xr-x 1 root root 27472 Sep 28 2020 run-parts + -rwxr-xr-x 1 root root 122224 Dec 23 2018 sed + lrwxrwxrwx 1 root root 9 Jul 29 01:17 sh -> /bin/bash + -rwxr-xr-x 1 root root 43808 Sep 24 2020 sleep + -rwxr-xr-x 1 root root 84928 Sep 24 2020 stty + -rwsr-xr-x 1 root root 71912 Mar 29 00:09 su + -rwxr-xr-x 1 root root 39744 Sep 24 2020 sync + -rwxr-xr-x 1 root root 531928 Jan 20 2024 tar + -rwxr-xr-x 1 root root 14456 Sep 28 2020 tempfile + -rwxr-xr-x 1 root root 101408 Sep 24 2020 touch + -rwxr-xr-x 1 root root 39680 Sep 24 2020 true + -rwxr-xr-x 1 root root 14328 Feb 27 2021 ulockmgr_server + -rwsr-xr-x 1 root root 35040 Mar 29 00:09 umount + -rwxr-xr-x 1 root root 39744 Sep 24 2020 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 147176 Sep 24 2020 vdir + -rwxr-xr-x 1 root root 63744 Mar 29 00:09 wdctl + lrwxrwxrwx 1 root root 8 Nov 8 2019 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 5898 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8049 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -352,7 +383,7 @@ Get: 144 http://deb.debian.org/debian bullseye/main amd64 ruby-rspec-mocks all 3.9.0c2e2m1s3-2 [81.4 kB] Get: 145 http://deb.debian.org/debian bullseye/main amd64 ruby-rspec all 3.9.0c2e2m1s3-2 [8348 B] Get: 146 http://deb.debian.org/debian bullseye/main amd64 yard all 0.9.24-1+deb11u1 [387 kB] -Fetched 46.2 MB in 14s (3420 kB/s) +Fetched 46.2 MB in 2s (24.6 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package bsdextrautils. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19711 files and directories currently installed.) @@ -961,7 +992,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/ruby-rubocop-rspec-1.42.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-rubocop-rspec_1.42.0-1_source.changes +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for bullseye +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/ruby-rubocop-rspec-1.42.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-rubocop-rspec_1.42.0-1_source.changes dpkg-buildpackage: info: source package ruby-rubocop-rspec dpkg-buildpackage: info: source version 1.42.0-1 dpkg-buildpackage: info: source distribution unstable @@ -992,7 +1027,7 @@ dh_auto_install -O--buildsystem=ruby dh_ruby --install /build/reproducible-path/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/d20250830-659708-1f8wb97/gemspec +/usr/bin/ruby2.7 -S gem build --config-file /dev/null --verbose /tmp/d20240729-3821146-y7xogm/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: @@ -1011,7 +1046,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/d20250830-659708-1f8wb97/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/d20240729-3821146-y7xogm/rubocop-rspec-1.42.0.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/reproducible-path/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/reproducible-path/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 @@ -1132,7 +1167,7 @@ rm -rf extensions cd gems/rubocop-rspec-1.42.0 rm -f -chmod 644 lib/rubocop-rspec.rb lib/rubocop/cop/rspec_cops.rb lib/rubocop/cop/rspec/implicit_expect.rb lib/rubocop/cop/rspec/context_method.rb lib/rubocop/cop/rspec/named_subject.rb lib/rubocop/cop/rspec/message_spies.rb lib/rubocop/cop/rspec/hook_argument.rb lib/rubocop/cop/rspec/leaky_constant_declaration.rb lib/rubocop/cop/rspec/let_setup.rb lib/rubocop/cop/rspec/before_after_all.rb lib/rubocop/cop/rspec/described_class.rb lib/rubocop/cop/rspec/single_argument_message_chain.rb lib/rubocop/cop/rspec/implicit_block_expectation.rb lib/rubocop/cop/rspec/empty_hook.rb lib/rubocop/cop/rspec/pending.rb lib/rubocop/cop/rspec/return_from_stub.rb lib/rubocop/cop/rspec/empty_line_after_subject.rb lib/rubocop/cop/rspec/instance_variable.rb lib/rubocop/cop/rspec/example_without_description.rb lib/rubocop/cop/rspec/repeated_example_group_description.rb lib/rubocop/cop/rspec/cop.rb lib/rubocop/cop/rspec/verified_doubles.rb lib/rubocop/cop/rspec/file_path.rb lib/rubocop/cop/rspec/scattered_setup.rb lib/rubocop/cop/rspec/expect_output.rb lib/rubocop/cop/rspec/repeated_example.rb lib/rubocop/cop/rspec/capybara/visibility_matcher.rb lib/rubocop/cop/rspec/capybara/feature_methods.rb lib/rubocop/cop/rspec/capybara/current_path_expectation.rb lib/rubocop/cop/rspec/overwriting_setup.rb lib/rubocop/cop/rspec/predicate_matcher.rb lib/rubocop/cop/rspec/around_block.rb lib/rubocop/cop/rspec/any_instance.rb lib/rubocop/cop/rspec/nested_groups.rb lib/rubocop/cop/rspec/invalid_predicate_matcher.rb lib/rubocop/cop/rspec/expect_in_hook.rb lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb lib/rubocop/cop/rspec/factory_bot/create_list.rb lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb lib/rubocop/cop/rspec/shared_examples.rb lib/rubocop/cop/rspec/context_wording.rb lib/rubocop/cop/rspec/message_chain.rb lib/rubocop/cop/rspec/described_class_module_wrapping.rb lib/rubocop/cop/rspec/empty_example_group.rb lib/rubocop/cop/rspec/subject_stub.rb lib/rubocop/cop/rspec/it_behaves_like.rb lib/rubocop/cop/rspec/repeated_description.rb lib/rubocop/cop/rspec/describe_symbol.rb lib/rubocop/cop/rspec/align_left_let_brace.rb lib/rubocop/cop/rspec/missing_example_group_argument.rb lib/rubocop/cop/rspec/empty_line_after_example_group.rb lib/rubocop/cop/rspec/hooks_before_examples.rb lib/rubocop/cop/rspec/receive_counts.rb lib/rubocop/cop/rspec/iterated_expectation.rb lib/rubocop/cop/rspec/void_expect.rb lib/rubocop/cop/rspec/focus.rb lib/rubocop/cop/rspec/implicit_subject.rb lib/rubocop/cop/rspec/repeated_example_group_body.rb lib/rubocop/cop/rspec/align_right_let_brace.rb lib/rubocop/cop/rspec/variable_definition.rb lib/rubocop/cop/rspec/describe_method.rb lib/rubocop/cop/rspec/be.rb lib/rubocop/cop/rspec/multiple_expectations.rb lib/rubocop/cop/rspec/multiple_describes.rb lib/rubocop/cop/rspec/empty_line_after_example.rb lib/rubocop/cop/rspec/unspecified_exception.rb lib/rubocop/cop/rspec/expect_actual.rb lib/rubocop/cop/rspec/receive_never.rb lib/rubocop/cop/rspec/not_to_not.rb lib/rubocop/cop/rspec/be_eql.rb lib/rubocop/cop/rspec/let_before_examples.rb lib/rubocop/cop/rspec/empty_line_after_hook.rb lib/rubocop/cop/rspec/expect_change.rb lib/rubocop/cop/rspec/shared_context.rb lib/rubocop/cop/rspec/example_length.rb lib/rubocop/cop/rspec/example_wording.rb lib/rubocop/cop/rspec/instance_spy.rb lib/rubocop/cop/rspec/variable_name.rb lib/rubocop/cop/rspec/dialect.rb lib/rubocop/cop/rspec/rails/http_status.rb lib/rubocop/cop/rspec/leading_subject.rb lib/rubocop/cop/rspec/scattered_let.rb lib/rubocop/cop/rspec/describe_class.rb lib/rubocop/cop/rspec/empty_line_after_final_let.rb lib/rubocop/cop/rspec/message_expectation.rb lib/rubocop/cop/rspec/yield.rb lib/rubocop/cop/rspec/multiple_subjects.rb lib/rubocop/rspec.rb lib/rubocop/rspec/align_let_brace.rb lib/rubocop/rspec/description_extractor.rb lib/rubocop/rspec/blank_line_separation.rb lib/rubocop/rspec/wording.rb lib/rubocop/rspec/config_formatter.rb lib/rubocop/rspec/corrector/move_node.rb lib/rubocop/rspec/language/node_pattern.rb lib/rubocop/rspec/top_level_describe.rb lib/rubocop/rspec/example_group.rb lib/rubocop/rspec/version.rb lib/rubocop/rspec/example.rb lib/rubocop/rspec/final_end_location.rb lib/rubocop/rspec/factory_bot.rb lib/rubocop/rspec/inject.rb lib/rubocop/rspec/top_level_group.rb lib/rubocop/rspec/concept.rb lib/rubocop/rspec/variable.rb lib/rubocop/rspec/node.rb lib/rubocop/rspec/language.rb lib/rubocop/rspec/hook.rb +chmod 644 lib/rubocop-rspec.rb lib/rubocop/rspec/align_let_brace.rb lib/rubocop/rspec/variable.rb lib/rubocop/rspec/concept.rb lib/rubocop/rspec/hook.rb lib/rubocop/rspec/config_formatter.rb lib/rubocop/rspec/corrector/move_node.rb lib/rubocop/rspec/example.rb lib/rubocop/rspec/wording.rb lib/rubocop/rspec/top_level_group.rb lib/rubocop/rspec/example_group.rb lib/rubocop/rspec/node.rb lib/rubocop/rspec/language/node_pattern.rb lib/rubocop/rspec/version.rb lib/rubocop/rspec/description_extractor.rb lib/rubocop/rspec/inject.rb lib/rubocop/rspec/blank_line_separation.rb lib/rubocop/rspec/language.rb lib/rubocop/rspec/top_level_describe.rb lib/rubocop/rspec/final_end_location.rb lib/rubocop/rspec/factory_bot.rb lib/rubocop/cop/rspec/expect_actual.rb lib/rubocop/cop/rspec/leading_subject.rb lib/rubocop/cop/rspec/scattered_let.rb lib/rubocop/cop/rspec/empty_line_after_subject.rb lib/rubocop/cop/rspec/let_setup.rb lib/rubocop/cop/rspec/align_left_let_brace.rb lib/rubocop/cop/rspec/align_right_let_brace.rb lib/rubocop/cop/rspec/be_eql.rb lib/rubocop/cop/rspec/multiple_describes.rb lib/rubocop/cop/rspec/be.rb lib/rubocop/cop/rspec/any_instance.rb lib/rubocop/cop/rspec/describe_class.rb lib/rubocop/cop/rspec/expect_in_hook.rb lib/rubocop/cop/rspec/hook_argument.rb lib/rubocop/cop/rspec/message_chain.rb lib/rubocop/cop/rspec/instance_spy.rb lib/rubocop/cop/rspec/verified_doubles.rb lib/rubocop/cop/rspec/example_wording.rb lib/rubocop/cop/rspec/around_block.rb lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb lib/rubocop/cop/rspec/factory_bot/create_list.rb lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb lib/rubocop/cop/rspec/variable_definition.rb lib/rubocop/cop/rspec/repeated_example_group_description.rb lib/rubocop/cop/rspec/empty_line_after_hook.rb lib/rubocop/cop/rspec/example_length.rb lib/rubocop/cop/rspec/predicate_matcher.rb lib/rubocop/cop/rspec/message_spies.rb lib/rubocop/cop/rspec/shared_context.rb lib/rubocop/cop/rspec/implicit_block_expectation.rb lib/rubocop/cop/rspec/invalid_predicate_matcher.rb lib/rubocop/cop/rspec/cop.rb lib/rubocop/cop/rspec/scattered_setup.rb lib/rubocop/cop/rspec/not_to_not.rb lib/rubocop/cop/rspec/dialect.rb lib/rubocop/cop/rspec/subject_stub.rb lib/rubocop/cop/rspec/example_without_description.rb lib/rubocop/cop/rspec/empty_line_after_final_let.rb lib/rubocop/cop/rspec/described_class_module_wrapping.rb lib/rubocop/cop/rspec/empty_example_group.rb lib/rubocop/cop/rspec/multiple_subjects.rb lib/rubocop/cop/rspec/return_from_stub.rb lib/rubocop/cop/rspec/iterated_expectation.rb lib/rubocop/cop/rspec/receive_counts.rb lib/rubocop/cop/rspec/leaky_constant_declaration.rb lib/rubocop/cop/rspec/single_argument_message_chain.rb lib/rubocop/cop/rspec/context_wording.rb lib/rubocop/cop/rspec/void_expect.rb lib/rubocop/cop/rspec/instance_variable.rb lib/rubocop/cop/rspec/shared_examples.rb lib/rubocop/cop/rspec/capybara/visibility_matcher.rb lib/rubocop/cop/rspec/capybara/feature_methods.rb lib/rubocop/cop/rspec/capybara/current_path_expectation.rb lib/rubocop/cop/rspec/message_expectation.rb lib/rubocop/cop/rspec/focus.rb lib/rubocop/cop/rspec/repeated_example.rb lib/rubocop/cop/rspec/pending.rb lib/rubocop/cop/rspec/file_path.rb lib/rubocop/cop/rspec/unspecified_exception.rb lib/rubocop/cop/rspec/yield.rb lib/rubocop/cop/rspec/expect_change.rb lib/rubocop/cop/rspec/hooks_before_examples.rb lib/rubocop/cop/rspec/missing_example_group_argument.rb lib/rubocop/cop/rspec/let_before_examples.rb lib/rubocop/cop/rspec/repeated_description.rb lib/rubocop/cop/rspec/named_subject.rb lib/rubocop/cop/rspec/empty_line_after_example.rb lib/rubocop/cop/rspec/empty_line_after_example_group.rb lib/rubocop/cop/rspec/rails/http_status.rb lib/rubocop/cop/rspec/implicit_subject.rb lib/rubocop/cop/rspec/variable_name.rb lib/rubocop/cop/rspec/describe_symbol.rb lib/rubocop/cop/rspec/nested_groups.rb lib/rubocop/cop/rspec/repeated_example_group_body.rb lib/rubocop/cop/rspec/overwriting_setup.rb lib/rubocop/cop/rspec/describe_method.rb lib/rubocop/cop/rspec/receive_never.rb lib/rubocop/cop/rspec/implicit_expect.rb lib/rubocop/cop/rspec/context_method.rb lib/rubocop/cop/rspec/expect_output.rb lib/rubocop/cop/rspec/it_behaves_like.rb lib/rubocop/cop/rspec/empty_hook.rb lib/rubocop/cop/rspec/before_after_all.rb lib/rubocop/cop/rspec/described_class.rb lib/rubocop/cop/rspec/multiple_expectations.rb lib/rubocop/cop/rspec_cops.rb lib/rubocop/rspec.rb find lib/ -type d -empty -delete cd - cd - @@ -1152,1122 +1187,643 @@ RUBYLIB=. GEM_PATH=/build/reproducible-path/ruby-rubocop-rspec-1.42.0/debian/ruby-rubocop-rspec/usr/share/rubygems-integration/all:/build/reproducible-path/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/x86_64-linux-gnu/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-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 37812 +Randomized with seed 33158 -RuboCop::Cop::RSpec::SharedExamples - registers an offense when using symbolic title - does not register an offense when using Module/Class title - does not register an offense when using string title - with default configuration - does not crash on smoke test: spec/smoke_tests/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::RepeatedExampleGroupDescription - register offense for different example group with similar descriptions - does not register offense for different block descriptions - registers offense only for RSPEC namespace example groups in any order - registers offense correctly if example groups are separated - registers an offense for repeated context descriptions - does not register offense for example group without descriptions - registers offense only for example group - register offense if same method used in docstring - considers different classes as different descriptions - registers an offense for repeated describe descriptions - does not register offense for describe block with several docstring - registers offense correctly for interpolated docstrings - considers interpolated docstrings as different descriptions - registers an offense with right pointing to lines of code - does not register offense for describe block with additional docstring - registers offense only for RSPEC namespace example groups +RuboCop::Cop::RSpec::LeadingSubject + handles subjects in tests + checks subject below example + checks subject below let + checks subject below hook + handles subjects in contexts + checks subject below let with proc argument + approves of subject above let + checks subject below 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/factory_bot_spec.rb - -RuboCop::Cop::RSpec::SingleArgumentMessageChain - receive_message_chain - accepts multi-argument calls - accepts multi-argument string calls - accepts single-argument calls with variable - reports single-argument string calls - accepts single-argument calls with send node - reports single-argument calls - with single-element array argument - reports an offense - with single-key hash argument - reports an offense - with multiple-element array argument - doesn't report an offense - with multiple keys hash argument - doesn't report an offense - stub_chain - reports single-argument string calls - accepts multi-argument calls - reports single-argument calls - accepts multi-argument string calls - 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::AnyInstance - finds `allow_any_instance_of` instead of an instance double - finds old `any_instance` syntax instead of an instance double - finds `expect_any_instance_of` instead of an instance double - 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::DescribedClassModuleWrapping - 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 two modules - registers an offense when RSpec.describe is nested within a module - 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::RSpec::DescriptionExtractor + builds a hash of descriptions RuboCop::Cop::RSpec::ExpectActual - ignores `be` with no argument + does not flag dynamic values within expect(...) flags hashes containing only literal values within expect(...) + flags with `equal` matcher + flags `be ==` + flags boolean literal values within expect(...) + does not flag complex values with dynamic parts within expect(...) flags but does not autocorrect violations for other matchers - flags literal nil value within expect(...) + flags arrays containing only literal values within expect(...) flags with `eql` matcher + flags ranges containing only literal values within expect(...) flags `be` with an argument - flags `be ==` - flags numeric literal values within expect(...) - does not flag complex values with dynamic parts within expect(...) flags string and symbol literal values within expect(...) - flags boolean literal values within expect(...) - flags with `equal` matcher + ignores `be` with no argument + flags literal nil value within expect(...) flags regexps containing only literal values within expect(...) - flags arrays containing only literal values within expect(...) - does not flag dynamic values within expect(...) - flags ranges containing only literal values within expect(...) + flags numeric literal values within 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/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb when inspecting rspec-rails routing specs ignores rspec-rails routing specs + +RuboCop::Cop::RSpec::NestedGroups + counts nesting correctly when non-spec nesting + ignores non-spec context methods + flags nested contexts + support --auto-gen-config + when configured with MaxNesting + emits a deprecation warning + when Max is configured as 2 + flags two levels of nesting 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 + +RuboCop::Cop::RSpec::ReturnFromStub + with EnforcedStyle `block` + finds hash with only static values returned from method + finds static values returned from method + finds static values returned from chained method + finds nil returned from method + ignores dynamic values returned from method + finds concatenated strings with no variables + ignores multiple values being returned from method + ignores string with interpolation returned from method + with default configuration + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + with EnforcedStyle `and_return` + finds static values returned from block + ignores array with dynamic values returned from block + finds empty values returned from block + finds concatenated strings with no variables + finds array with only static values returned from block + finds static values in a block when there are chained methods + ignores stubs without return value + ignores block returning string with interpolation + ignores hash with dynamic values returned from block + ignores variables return from block + ignores dynamic values returned from block + finds hash with only static values returned from block + finds nested constants returned from block + handles stubs in a method + finds constants returned from block RuboCop::Cop::RSpec::EmptyHook + with `around` hook + accepts multiline `around` hook + detects offense for empty `around` + accepts non-empty `around` hook + with `append_after` hook + accepts non-empty `append_after` hook + detects offense for empty `append_after` + accepts multiline `append_after` hook + with `after` hook + accepts multiline `after` hook + accepts non-empty `after` hook + detects offense for empty `after` + with `append_before` hook + detects offense for empty `append_before` + accepts multiline `append_before` hook + accepts non-empty `append_before` hook with `before` hook + detects offense for empty `before` with :context scope + detects offense for empty `before` with :example scope detects offense for empty `before` with :all scope + autocorrects `before` with semicolon accepts multiline `before` hook detects offense for empty `before` with :suite scope + detects offense for empty `before` with :each scope accepts non-empty `before` hook detects offense for empty `before` - detects offense for empty `before` with :each scope - autocorrects `before` with semicolon - detects offense for empty `before` with :example scope - detects offense for empty `before` with :context scope + with `prepend_before` hook + detects offense for empty `prepend_before` + accepts multiline `prepend_before` hook + accepts non-empty `prepend_before` hook with `prepend_after` hook + accepts non-empty `prepend_after` hook detects offense for empty `prepend_after` accepts multiline `prepend_after` hook - accepts non-empty `prepend_after` hook - with `append_after` hook - detects offense for empty `append_after` - accepts multiline `append_after` hook - accepts non-empty `append_after` hook - with `around` hook - accepts non-empty `around` hook - accepts multiline `around` hook - detects offense for empty `around` - with `prepend_before` hook - accepts non-empty `prepend_before` hook - accepts multiline `prepend_before` hook - detects offense for empty `prepend_before` - with `append_before` hook - accepts non-empty `append_before` hook - detects offense for empty `append_before` - accepts multiline `append_before` hook - with `after` hook - accepts non-empty `after` hook - detects offense for empty `after` - accepts multiline `after` hook - with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/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::MissingExampleGroupArgument - accepts methods with a name like an example block - accepts describe with an argument - checks first argument of describe - checks first argument of nested describe - checks first argument of context - 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::ImplicitBlockExpectation - flags with `should_not` as implicit subject - flags proc - flags with `should` as implicit subject - ignores normal local subject - flags lambda in subject! - flags literal lambda - flags named subject - ignores named subject with deeply nested lambda - flags Proc.new - flags when subject is defined in the outer example group - flags lambda in subject - ignores when there is no subject defined - ignores non-lambda subject - 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::VariableName - with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - when configured for `camelCase` - 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 - when `let!` - does not register offense for camelCase - registers an offense for snake_case - when `subject!` - does not register offense for camelCase - registers an offense for snake_case - when configured for `snake_case` - 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 an offense for PascalCase - registers offense with multiple lets - when `let` with string names - does not register an offense for snake_case - registers an offense for kebab-case - registers an offense for camelCase - does not register offense for interpolated string - when `subject` - registers an offense for camelCase - does not register offense for snake_case - when `let!` - does not register offense for snake_case - registers an offense for camelCase - when `let` with proc - registers offense - when `subject!` - does not register offense for snake_case - registers an offense for camelCase - -RuboCop::Cop::RSpec::BeEql - registers an offense for `eql` when argument is a float - registers an offense for `eql` when argument is an integer - does not register an offense for `eql` when expectation is negated - registers an offense for `eql` when argument is a symbol - registers an offense for `eql` when argument is a boolean - registers an offense for `eql` when argument is nil - does not register an offense for `eql` when argument is a string - 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::Yield - flags `block.call` with arguments - flags `block.call` when `receive` is chained - ignores `receive` with no block arguments - flags `block.call` - flags multiple `block.call` with arguments - flags multiple `block.call` - ignores stub when `block.call` is not the only statement - 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::ScatteredSetup - ignores different hook types - ignores similar method names inside of examples - ignores hooks in different example groups - flags multiple hooks in the same example group - flags hooks with similar metadata - flags multiple before(:all) hooks in the same example group - flags multiple hooks of the same scope with different symbols - ignores hooks with different metadata - ignores different hooks - ignores hooks in different shared contexts 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::ContextWording - finds shared_context without `when` at the beginning - finds context without `when` at the beginning - skips describe blocks - skips descriptions beginning with 'when' - finds context without separate `when` at the beginning - with symbol metadata - finds context without separate `when` at the beginning - with mixed metadata - finds context without separate `when` at the beginning - with metadata hash - finds context without separate `when` at the beginning - when configured - finds context without allowed prefixes at the beginning - skips descriptions with allowed prefixes at the beginning - with 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::VerifiedDoubles - ignores instance_doubles - ignores doubles that have no name specified - finds a `double` instead of an `instance_double` +RuboCop::Cop::RSpec::VoidExpect + registers offenses to void `expect` when block has one expression + registers offenses to void `expect` with block + accepts non-void `expect` with block + registers offenses to void `expect` + accepts non-void `expect` with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when 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 - when configuration does not specify IgnoreSymbolicNames - finds a `spy` instead of an `instance_spy` - find doubles whose name is a symbol - -RuboCop::Cop::RSpec::Rails::HttpStatus - when EnforcedStyle is `numeric` - does not register an offense when using allowed symbols - registers an offense when using symbolic value - autocorrects `it { is_expected.to have_http_status :ok }` to `it { is_expected.to have_http_status 200 }` - autocorrects `it { is_expected.to have_http_status :not_found }` to `it { is_expected.to have_http_status 404 }` - does not register an offense when using numeric value - with parenthesis - autocorrects `it { is_expected.to have_http_status(:ok) }` to `it { is_expected.to have_http_status(200) }` - autocorrects `it { is_expected.to have_http_status(:not_found) }` to `it { is_expected.to have_http_status(404) }` - 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 - when EnforcedStyle is `symbolic` - 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 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 }` - registers an offense when using numeric value - with parenthesis - autocorrects `it { is_expected.to have_http_status(404) }` to `it { is_expected.to have_http_status(:not_found) }` - autocorrects `it { is_expected.to have_http_status(200) }` to `it { is_expected.to have_http_status(:ok) }` -RuboCop::Cop::RSpec::LeakyConstantDeclaration - 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 - module defined - flags inside an example group - constant assignment - flags inside an example group - flags inside shared example group - ignores outside of example/shared group - flags inside an example - class defined - ignores anonymous classes - flags namespaced class - flags inside an example group - -RuboCop::Cop::RSpec::Dialect - allows calling methods named context in examples - allows describe blocks - registers an offense for RSpec.context blocks - registers an offense for context blocks +RuboCop::Cop::RSpec::EmptyLineAfterFinalLet + checks for empty line after let with proc argument + handles HEREDOC for let + check for empty line after the last `let!` + handles multiline let block + flags missing empty line after the comment that comes after last let + ignores empty lines between the lets + allows comment followed by an empty line after let + handles let in tests + handles silly HEREDOC offense + flags missing empty line after a multiline comment after last let + checks for empty line after last let + approves empty line after let + handles let being the latest node + 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/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 - without preferred methods - allows all methods blocks - -RuboCop::Cop::RSpec::AlignLeftLetBrace - registers offense for unaligned braces - works with empty file - does not register offense for let with proc argument - with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - -RuboCop::Cop::RSpec::FactoryBot::CreateList - 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 :create_list - autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` - flags usage of n.times when FactoryBot.create is used - 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 -` - ignores n.times when there is other calls but create - ignores create method of other object - ignores n.times with argument - autocorrects `5.times { create :user }` to `create_list :user, 5` - flags FactoryGirl.create calls with a block - flags usage of n.times with no arguments - autocorrects `5.times { create(:user, :trait) }` to `create_list(:user, 5, :trait)` - ignores create in other block - flags usage of n.times when FactoryGirl.create is used - autocorrects `5.times { create :user, :trait, key: val }` to `create_list :user, 5, :trait, key: val` - ignores n.times when there is no create call inside - autocorrects ` 3.times do - create(:user, :trait) { |user| create :account, user: user } - end -` to ` create_list(:user, 3, :trait) { |user| create :account, user: user } -` - when EnforcedStyle is :n_times - autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` - ignores create method of other object - autocorrects `create_list :user, 5, :trait, key: val` to `5.times { create :user, :trait, key: val }` - autocorrects `create_list :user, 5` to `5.times { create :user }` - flags usage of create_list - autocorrects `create_list(:user, 5, :trait)` to `5.times { create(:user, :trait) }` - flags usage of FactoryGirl.create_list with a block - flags usage of FactoryGirl.create_list -RuboCop::Cop::RSpec::EmptyLineAfterSubject - checks for empty line after subject - approves empty line after subject! - checks for empty line after subject! - approves empty line after subject - handles subject being the latest node - handles multiline subject block - handles subjects in tests +RuboCop::Cop::RSpec::SubjectStub + ignores nested stubs when nested subject is anonymous + flags nested subject stubs when example group does not define subject + flags spy subject stubs + flags multiple-method stubs + flags nested subject stubs + flags when an unnamed subject is mocked + flags chain stubs + flags when subject is mocked + flags deeply nested subject stubs + flags an expectation made on an unnamed subject + flags nested subject stubs when adjacent context redefines + flags nested subject stubs when nested subject uses same name + flags when there are several top level example groups + ignores stub within context where subject name changed + flags stub inside all matcher + flags when an implicit subject is mocked + flags when subject is stubbed + flags one-line expectcation syntax + flags negated runners + flags when subject is stubbed and there are several named subjects in the same 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/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - -RuboCop::Cop::RSpec::RepeatedDescription - does not flag descriptions with different interpolated variables - does not flag different descriptions in different iterators - does not flag examples if metadata is different - does not flag tests which do not contain description strings - ignores repeated descriptions in a nested context - registers offense for repeated description in different iterators - ignores descriptions repeated in a shared context - registers offense if same method used in docstring - registers an offense for repeated descriptions - does not flag different methods used as docstring - does not flag examples with same metadata and different description - registers offense for repeated description and metadata - 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/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - -RuboCop::Cop::RSpec::AlignRightLetBrace - registers offense for unaligned braces - works with empty file - does not register offense for 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::AttributeDefinedStatically - registers an offense in a transient block - accepts valid traits_for_enum definition - accepts valid sequence definition - 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 } + top level example groups + flags in top level xfeature + flags in top level xcontext + flags in top level fcontext + flags in top level ffeature + flags in top level shared_examples_for + flags in top level example_group + flags in top level shared_context + flags in top level fdescribe + flags in top level feature + flags in top level shared_examples + flags in top level context + flags in top level describe + flags in top level xdescribe - trait :old do - published_at { 1.week.ago } - end - end - end -` - accepts valid association definitions - registers an offense in a trait - registers an offense for offending code - accepts valid factory definitions - registers an offense for attributes defined on explicit receiver - does not add offense if out of factory bot block - registers an offense for an attribute defined on `self` - does not add offense if method called on another object - does not add offense if method called on a local variable +RuboCop::Cop::RSpec::SharedContext + shared_context + does not register an offense for empty contexts + does not register an offense for `shared_context` with subject + registers an offense for shared_context with only examples + does not register an offense for `shared_context` with let + does not register an offense for `shared_context` with before 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::HookArgument - when EnforcedStyle is :each - generates a todo based on the detected style - generates a todo based on the detected style - generates a todo based on the detected style - ignores non-rspec hooks - autocorrects `config.before(:each) { }` to `config.before(:each) { }` - detects :each for hooks - ignores hooks with more than one argument - autocorrects `before(:example) { }` to `before(:each) { }` - autocorrects `config.before(:example) { }` to `config.before(:each) { }` - detects :example for hooks - autocorrects `before { }` to `before(:each) { }` - autocorrects `before(:each) { }` to `before(:each) { }` - detects hooks without default scopes - autocorrects `config.before { }` to `config.before(:each) { }` - ignores :context and :suite - when EnforcedStyle is :example - autocorrects `config.before(:example) { }` to `config.before(:example) { }` - generates a todo based on the detected style - autocorrects `config.before { }` to `config.before(:example) { }` - does not flag hooks without default scopes - ignores hooks with more than one argument - generates a todo based on the detected style - ignores :context and :suite - detects :example for hooks - ignores non-rspec hooks - generates a todo based on the detected style - autocorrects `config.before(:each) { }` to `config.before(:example) { }` - autocorrects `before(:each) { }` to `before(:example) { }` - autocorrects `before(:example) { }` to `before(:example) { }` - autocorrects `before { }` to `before(:example) { }` - detects :each for hooks - with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - when EnforcedStyle is :implicit - detects :each for hooks - ignores hooks with more than one argument - autocorrects `config.before(:each) { }` to `config.before { }` - autocorrects `before(:each) { }` to `before { }` - generates a todo based on the detected style - generates a todo based on the detected style - generates a todo based on the detected style - ignores :context and :suite - autocorrects `config.before(:example) { }` to `config.before { }` - autocorrects `config.before { }` to `config.before { }` - does not flag hooks without default scopes - detects :example for hooks - ignores non-rspec hooks - autocorrects `before { }` to `before { }` - autocorrects `before(:example) { }` to `before { }` - -RuboCop::Cop::RSpec::ReceiveCounts - allows `exactly(n).times` - flags usage of `at_most(1).times` - allows `exactly(3).times` - flags usage of `exactly(1).times` - flags usage of `at_least(2).times` - 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` with return value - flags usage of `exactly(1).times` with a block - flags usage of `exactly(2).times` - flags usage of `at_least(1).times` - flags usage of `at_least(2).times` with a block - allows exactly(1).times when not called on `receive` - flags usage of `exactly(1).times` after `with` - flags usage of `at_most(2).times` - 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 + shared_examples + registers an offense for shared_examples with only hooks + does not register an offense for `shared_examples` with it + does not register an offense for empty examples + registers an offense for shared_examples with only subject + registers an offense for shared_examples with only let RuboCop::Cop::RSpec::ScatteredLet flags `let` at different nesting levels + works with heredocs + flags `let` after the first different node flags `let` with proc argument - doesnt flag `let!` in the middle of multiple `let`s flags scattered `let!`s - flags `let` after the first different node - works with heredocs + doesnt flag `let!` in the middle of multiple `let`s 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/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::InstanceVariable - flags several instance variables inside a describe - ignores an instance variable inside a dynamic class - ignores an instance variable without describe - flags an instance variable inside a describe - ignores instance variables outside of specs - flags an instance variable inside a shared example - ignores non-spec blocks - when configured with AssignmentOnly - flags an instance variable when it is also assigned in a sibling example group - ignores an instance variable when it is not assigned - flags an instance variable when it is also assigned - when used in a custom matcher - ignores instance variables inside `RSpec::Matchers.define` - flags instance variables outside `matcher` - ignores instance variables inside `matcher` +RuboCop::Cop::RSpec::ContextWording + finds context without `when` at the beginning + skips describe blocks + finds shared_context without `when` at the beginning + finds context without separate `when` at the beginning + skips descriptions beginning with 'when' + with mixed metadata + finds context without separate `when` at the beginning with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/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::SharedContext - shared_context - 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 subject - does not register an offense for `shared_context` with let - 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 - shared_examples - registers an offense for shared_examples with only subject - registers an offense for shared_examples with only let - does not register an offense for empty examples - registers an offense for shared_examples with only hooks - does not register an offense for `shared_examples` with it + with metadata hash + finds context without separate `when` at the beginning + with symbol metadata + 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 RuboCop::Cop::RSpec::FilePath - allows bang method registers an offense for a wrong class and highlights metadata - checks class methods - checks class specs - allows flat hierarchies for class methods - ignores non-alphanumeric characters + allows bang method + registers an offense for a file missing a .rb allows subdirs for instance methods - allows flexibility with predicates - uses relative path for sibling directory project - registers an offense for a file missing _spec - skips specs that do have multiple top level describes - uses relative path for different path project - handles alphanumeric class names - allows subdirs for class methods + registers an offense for a wrong class but a correct method + uses relative path + ignores non-alphanumeric characters + checks class methods handles ACRONYMClassNames checks instance methods - registers an offense for a wrong class name with a symbol argument - handles CamelCaps class names - registers an offense for a file missing a .rb + uses relative path for sibling directory project + allows flat hierarchies for instance methods + registers an offense for a bad path + allows subdirs for class methods + allows flexibility with operators + registers an offense for a repeated .rb registers an offense for a wrong class name - registers an offense for a wrong class but a correct method + allows flexibility with predicates allows different parent directories - skips specs that do not describe a class / method - uses relative path - allows flexibility with operators - allows flat hierarchies for instance methods + checks class specs + registers an offense for a wrong class name with a symbol argument + handles CamelCaps class names handles ALLCAPS class names - registers an offense for a repeated .rb - registers an offense for a bad path - when configured with IgnoreMethods - does not care about the described method + skips specs that do have multiple top level describes + allows flat hierarchies for class methods + uses relative path for different path project + handles alphanumeric class names + skips specs that do not describe a class / method + registers an offense for a file missing _spec when configured with CustomTransform - respects custom module name transformation ignores routing specs + respects custom module name transformation when configured with SpecSuffixOnly registers an offense when _spec.rb suffix is missing does not care about the described class + when configured with IgnoreMethods + does not care about the described method 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::EmptyLineAfterExampleGroup - checks for empty line after context - approves empty line after describe - approves empty line after context - checks for empty line after describe - highlights single line formulations correctly - handles describes in an if block +RuboCop::Cop::RSpec::MessageExpectation + when EnforcedStyle is expect + flags allow(...).to receive + generates a todo based on the detected style + approves of expect(...).to receive + generates a todo based on the detected style + 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/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb RuboCop::Cop::RSpec::InvalidPredicateMatcher accepts valid predicate matcher - registers an offense for double question registers an offense for double question with `have_something?` + registers an offense for double question registers an offense for double question with `to_not` registers an offense for double question with `not_to` 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::LetSetup - complains when let! is used and not referenced within nested group - complains when let! used in shared example including - complains when there is only one nested node into example group - ignores let! when used in example - ignores let! when used in `before` - complains when there is a custom nesting level - complains when let! is used and not referenced - complains when let! is used and not referenced in shared example group +RuboCop::Cop::RSpec::FactoryBot::FactoryClassName + when passing block + ignores passing class name + flags passing a class + ignores passing Hash + flags passing a subclass + flags passing a class from global namespace + ignores passing OpenStruct + when not passing block + flags passing a class + ignores passing class name with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ImplicitExpect - when EnforcedStyle is is_expected - flags it { should_not } - approves of is_expected.to_not - approves of is_expected.to - approves of is_expected.not_to - generates a todo based on the detected style - flags it { should } - when EnforcedStyle is should - generates a todo based on the detected style - generates a todo based on the detected style - flags it { is_expected.to } - approves of should_not - flags it { is_expected.not_to } - approves of should - flags it { is_expected.to_not } +RuboCop::Cop::RSpec::IteratedExpectation + ignore `each` when the body does not contain only expectations + ignores assignments in the iteration + flags `each` when expectation calls method with arguments + ignores `each` without expectation + flags `each` with an expectation + flags `each` with multiple expectations + ignores `each` when there is a negative expectation + ignores `each` with expectation on property 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::Hook - extracts name - #scope - interprets before(:all) { } as having scope context - ignores other arguments to hooks - defaults to example hook with hash metadata - interprets after(:suite) { } as having scope suite - interprets before(:each) { } as having scope each - interprets around(:example) { } as having scope each - classifies :each as an example hook - interprets after { } as having scope each - interprets around(:context) { } as having scope context - #knowable_scope? - does not break if a hook is not given a symbol literal - knows the scope of a hook with a symbol literal - knows the scope of a hook with no argument - knows the scope of a hook with hash metadata - #metadata - combines symbol and hash metadata - extracts symbol metadata - extracts hash metadata - withstands no arguments - extracts hash metadata with no scope given - -RuboCop::RSpec::ExampleGroup - exposes examples in scope - -RuboCop::Cop::RSpec::ReturnFromStub - with EnforcedStyle `block` - ignores multiple values being returned from method - ignores string with interpolation returned from method - finds hash with only 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 static values returned from method +RuboCop::Cop::RSpec::AlignRightLetBrace + works with empty file + registers offense for unaligned braces + does not register offense for let with proc argument with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/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 EnforcedStyle `and_return` - finds array with only static values returned from block - ignores array with dynamic values returned from block - finds hash with only static values returned from block - ignores variables return from block - finds static values in a block when there are chained methods - ignores dynamic values returned from block - finds nested constants returned from block - finds static values returned from block - ignores hash with dynamic values returned from block - ignores block returning string with interpolation - finds empty values returned from block - ignores stubs without return value - handles stubs in a method - finds concatenated strings with no variables - finds constants returned from block -RuboCop::Cop::RSpec::EmptyLineAfterExample - flags a missing empty line after `specify` - flags mixed one-line and multi-line examples - flags a missing empty line after `it` - flags one-line examples - ignores when an empty line is present - ignores consecutive one-liners - when AllowConsecutiveOneLiners is false - ignores consecutive one-liners +RuboCop::Cop::RSpec::UnspecifiedException + with raise_exception matcher + allows classes with blocks with braces + allows exception types with messages + allows empty exception specification when not expecting an error + allows classes with blocks with do/end + allows exception matching regular expressions + allows exception types with matching regular expressions + allows exception messages + allows parameterized exceptions + detects the `unspecified_exception` offense + allows exception classes 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 raise_error matcher + allows exception messages + allows classes with blocks with braces + allows exception classes + detects the `unspecified_exception` offense + allows exception types with matching regular expressions + allows exception matching regular expressions + allows classes with blocks with do/end + allows parameterized exceptions + allows exception types with messages + allows empty exception specification when not expecting an error + +RuboCop::Cop::RSpec::ReceiveCounts + flags usage of `exactly(1).times` after `with` + allows `exactly(3).times` + allows `exactly(n).times` + flags usage of `at_least(2).times` with a block + flags usage of `exactly(1).times` with return value + flags usage of `at_most(1).times` + flags usage of `exactly(1).times` with a block + autocorrects `expect(foo).to have_published_event(:bar).exactly(2).times` to `expect(foo).to have_published_event(:bar).exactly(2).times` + allows exactly(1).times when not called on `receive` + flags usage of `exactly(1).times` + flags usage of `at_least(1).times` + flags usage of `at_least(2).times` + flags usage of `exactly(2).times` + flags usage of `at_most(2).times` + 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::MultipleExpectations - generates a todo based on the worst violation - with Max configuration - flags three expectations - permits two expectations - with metadata - ignores examples with `:aggregate_failures` - prefers example metadata over example group metadata - ignores examples with `aggregate_failures: true` - ignores example groups with `:aggregate_failures` - ignores example groups with `aggregate_failures: true` - checks examples with `aggregate_failures: false` - ignores examples with `aggregate_failures: true` defined deeply - checks examples with siblings with `aggregate_failures: true` - checks example groups with `aggregate_failures: false` +RuboCop::Cop::RSpec::MultipleSubjects + autocorrects + does not try to autocorrect subject! + does not flag shared example groups + registers an offense for every overwritten subject 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 - without configuration - counts aggregate_failures as one expectation - flags multiple is_expected - flags multiple expects with blocks - approves of one expectation per example - flags multiple expectations - flags multiple expect_any_instance_of - counts every aggregate_failures as an expectation + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::ItBehavesLike - 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::Cop::RSpec::ScatteredSetup + flags multiple before(:all) hooks in the same example group + ignores different hook types + flags hooks with similar metadata + flags multiple hooks of the same scope with different symbols + ignores hooks in different example groups + ignores hooks in different shared contexts + flags multiple hooks in the same example group + ignores different hooks + ignores hooks with different metadata + ignores similar method names inside of examples with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - when the enforced style is `it_behaves_like` - does not flag a violation for it_behaves_like - flags a violation for it_should_behave_like -RuboCop::Cop::RSpec::MultipleDescribes - finds multiple top level describes only with class - skips single top level describe - finds multiple top level describes with class and method +RuboCop::Cop::RSpec::VariableDefinition + when EnforcedStyle is `symbols` + registers an offense for interpolated string + registers an offense for multiline string + registers an offense for string name + does not register offense for symbol names + when EnforcedStyle is `strings` + registers an offense for symbol name + does not register offense for string names + registers an offense for interpolated symbol 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/weird_rspec_spec.rb -RuboCop::Cop::RSpec::HooksBeforeExamples - flags `before` after `context` - flags `before` after `include_examples` - flags scoped hook after an example - does not flag `before` in a nested context - flags `after` after an example - allows inclusion of context before hooks - does not flag hooks before the examples - ignores single-line example blocks - flags `before` after `it` +RuboCop::Cop::RSpec::EmptyExampleGroup + does not flag methods matching example group names + flags an empty context + does not recognize custom include methods by default + does not flag include_examples + flags an empty top level describe + 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/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::ExpectChange - with EnforcedStyle `method_call` - flags implicit block expectation syntax - 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 - 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 - with EnforcedStyle `block` - flags change matcher when receiver is a variable - flags implicit block expectation syntax - flags change matcher without block - ignores methods called change -config/default.yml - does not have newlines in cop descriptions - ends every description with a period - has configuration for all cops - includes Enabled: true for every cop - sorts configuration keys alphabetically - has descriptions for all cops -CHANGELOG.md - has link definitions for all implicit links - entry - has a link to the contributors at the end - has a whitespace between the * and the body - link to related issue on github - has an issue number prefixed with # - has a valid URL - has a colon and a whitespace at the end - body - does not start with a lower case - ends with a punctuation + is insane -RuboCop::Cop::RSpec::FactoryBot::FactoryClassName +RuboCop::Cop::RSpec::Rails::HttpStatus + when EnforcedStyle is `symbolic` + registers an offense when using numeric value + does not register an offense when using symbolic value + 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 custom HTTP code + 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) }` + when EnforcedStyle is `numeric` + registers an offense when using symbolic value + does not register an offense when using numeric value + 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 + autocorrects `it { is_expected.to have_http_status :ok }` to `it { is_expected.to have_http_status 200 }` + with parenthesis + autocorrects `it { is_expected.to have_http_status(: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) }` with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when not passing block - ignores passing class name - flags passing a class - when passing block - flags passing a class - flags passing a class from global namespace - ignores passing OpenStruct - ignores passing Hash - ignores passing class name - flags passing a subclass - -RuboCop::Cop::RSpec::Focus - flags all rspec example blocks that include `:focus` - does not flag unfocused specs - flags all rspec example blocks with that include `focus: true` - ignores non-rspec code with :focus blocks - flags rspec example blocks that include `:focus` preceding a hash - does not flag a method that is focused twice - flags focused block types - 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::OverwritingSetup - ignores overwriting in different context - handles unnamed subjects - works with `subject!` and `let!` - handles string arguments - finds `let!` overwriting `let` - handles dynamic names for `let` - finds overwriten `subject` - finds overwriten `let` +RuboCop::Cop::RSpec::MessageSpies + when EnforcedStyle is receive + flags expect(lvar).to have_received + flags expect(...).to have_received at_most + flags expect(...).to have_received with + flags expect(send).to have_received + flags expect(const).to have_received + approves of expect(...).to receive + flags expect(...).to_not have_received + flags expect(...).not_to have_received + generates a todo based on the detected style + flags expect(ivar).to have_received + generates a todo based on the detected style + when EnforcedStyle is have_received + approves of expect(...).to have_received + flags expect(const).to receive + generates a todo based on the detected style + flags expect(...).not_to receive + flags expect(...).to_not receive + flags expect(...).to receive with + flags expect(lvar).to receive + flags expect(send).to receive + flags expect(ivar).to receive + generates a todo based on the detected style + flags expect(...).to receive at_most 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 -RuboCop::Cop::RSpec::MultipleSubjects - registers an offense for every overwritten subject - autocorrects - does not flag shared example groups - does not try to autocorrect subject! +RuboCop::Cop::RSpec::AlignLeftLetBrace + registers offense for unaligned braces + works with empty file + does not register offense for 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/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 -RuboCop::Cop::RSpec::ExpectOutput - registers an offense for overwriting $stderr within an example scoped hook - does not flag assignments to $stdout outside of example scope - registers an offense for overwriting $stdout within an example - does not register an offense for interacting with $stdout - does not flag assignments to $stdout in example_group scope - does not flag assignments to other global variables - does not flag assigns to $stdout when in the root scope +RuboCop::Cop::RSpec::NotToNot + 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` with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - -RuboCop::Cop::RSpec::Be - registers an offense for `be` without an argument - allows specific `be_` matchers - registers an offense for not_to be - allows `be` with 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/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::MessageExpectation - when EnforcedStyle is expect - approves of expect(...).to receive - flags allow(...).to receive - generates a todo based on the detected style - generates a todo based on the detected style - when EnforcedStyle is allow - generates a todo based on the detected style - approves of allow(...).to receive - flags expect(...).to receive - generates a todo based on the detected style - 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 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 -RuboCop::Cop::RSpec::EmptyLineAfterHook - approves empty line after `after` hook - handles multiline `around` block - handles multiline `before` block - checks for empty line after `before` hook - approves empty line after `before` hook - checks for empty line after `around` hook - checks for empty line after `after` hook - approves empty line after `around` hook - handles multiline `after` block - handles `before` being the latest node +RuboCop::Cop::RSpec::MultipleExpectations + generates a todo based on the worst violation + without configuration + flags multiple expectations + approves of one expectation per example + counts aggregate_failures as one expectation + flags multiple expect_any_instance_of + flags multiple is_expected + counts every aggregate_failures as an expectation + flags multiple expects with blocks with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/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 + with metadata + prefers example metadata over example group metadata + ignores examples with `aggregate_failures: true` defined deeply + checks example groups with `aggregate_failures: false` + ignores example groups with `:aggregate_failures` + checks examples with `aggregate_failures: false` + checks examples with siblings with `aggregate_failures: true` + ignores example groups with `aggregate_failures: true` + ignores examples with `:aggregate_failures` + ignores examples with `aggregate_failures: true` + with Max configuration + permits two expectations + flags three expectations -RuboCop::Cop::RSpec::ExampleLength - allows an empty example - ignores non-spec blocks - ignores comments - allows a short example - with CountComments enabled - flags the example +RuboCop::Cop::RSpec::SharedExamples + does not register an offense when using Module/Class title + does not register an offense when using string title + registers an offense when using symbolic title with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - when inspecting large examples - flags the example - -RuboCop::Cop::RSpec::Pending - ignores method called pending - ignores it - flags blocks with pending symbol metadata - flags xfeature - flags xexample - ignores specify - flags pending examples when receiver is explicit - flags describe with skip symbol metadata - ignores it with skip: false metadata - flags blocks with skip: string metadata - ignores example_group - flags xdescribe - ignores scenario - flags xcontext - ignores describe - flags xscenario - ignores example - flags blocks with skip: true metadata - flags skip inside of an it - flags blocks with skip symbol metadata - ignores context - flags pending blocks - flags xspecify - flags xit - ignores feature - flags skip blocks - with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/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::RSpec::Hook + extracts name + #knowable_scope? + knows the scope of a hook with a symbol literal + knows the scope of a hook with no argument + does not break if a hook is not given a symbol literal + knows the scope of a hook with hash metadata + #metadata + withstands no arguments + extracts symbol metadata + extracts hash metadata with no scope given + extracts hash metadata + combines symbol and hash metadata + #scope + interprets before(:all) { } as having scope context + defaults to example hook with hash metadata + ignores other arguments to hooks + interprets after { } as having scope each + interprets around(:context) { } as having scope context + classifies :each as an example hook + interprets around(:example) { } as having scope each + interprets before(:each) { } as having scope each + interprets after(:suite) { } as having scope suite 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 + ignores subject when not wrapped inside a test checks `it` and `specify` for explicit subject usage when IgnoreSharedExamples is false checks shared_examples for explicit subject usage @@ -2277,149 +1833,249 @@ ignores subject when not wrapped inside a test checks before and after for explicit subject usage with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + +RuboCop::Cop::RSpec::ExpectChange + with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + with EnforcedStyle `method_call` + flags implicit block expectation syntax + ignores blocks that cannot be converted to obj/attribute pair + ignores change method of object that happens to receive a block + flags blocks that contain simple message sending + with EnforcedStyle `block` + flags change matcher without block + flags change matcher when receiver is a variable + ignores methods called change + flags implicit block expectation syntax -RuboCop::Cop::RSpec::DescribeSymbol - flags violations for `RSpec.describe :symbol` - 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` +RuboCop::Cop::RSpec::Dialect + registers an offense for context blocks + registers an offense for RSpec.context blocks + allows calling methods named context in examples + allows describe blocks + without preferred methods + allows all methods blocks + with default configuration + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + +RuboCop::Cop::RSpec::BeEql + registers an offense for `eql` when argument is nil + registers an offense for `eql` when argument is a boolean + does not register an offense for `eql` when expectation is negated + registers an offense for `eql` when argument is a symbol + registers an offense for `eql` when argument is an integer + does not register an offense for `eql` when argument is a string + registers an offense for `eql` when argument is a float 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::MessageSpies +RuboCop::Cop::RSpec::RepeatedExampleGroupDescription + registers an offense for repeated context descriptions + registers offense only for RSPEC namespace example groups + registers offense only for RSPEC namespace example groups in any order + registers offense correctly for interpolated docstrings + considers interpolated docstrings as different descriptions + register offense for different example group with similar descriptions + registers offense only for example group + does not register offense for describe block with additional docstring + registers an offense for repeated describe descriptions + does not register offense for describe block with several docstring + register offense if same method used in docstring + considers different classes as different descriptions + does not register offense for different block descriptions + does not register offense for example group without descriptions + registers offense correctly if example groups are separated + registers an offense with right pointing to lines of code 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 - when EnforcedStyle is receive - generates a todo based on the detected style - generates a todo based on the detected style - flags expect(ivar).to have_received - flags expect(const).to have_received - flags expect(...).to_not have_received - flags expect(...).not_to have_received - flags expect(lvar).to have_received - flags expect(...).to have_received at_most - flags expect(...).to have_received with - approves of expect(...).to receive - flags expect(send).to have_received - when EnforcedStyle is have_received - generates a todo based on the detected style - flags expect(...).not_to receive - flags expect(...).to receive at_most - flags expect(lvar).to receive - flags expect(send).to receive - flags expect(...).to receive with - flags expect(ivar).to receive - approves of expect(...).to have_received - generates a todo based on the detected style - flags expect(...).to_not receive - flags expect(const).to receive + 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::RepeatedExample - does not register a violation if rspec tag magic is involved - registers an offense for repeated example - does not flag examples with different implementations - does not flag repeated examples in different scopes - does not flag examples when different its arguments are used +RuboCop::Cop::RSpec::InstanceSpy + when not used with `have_received` + does not add an offence + 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 multiple arguments + adds an offense for an instance_double with single argument with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/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 -RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation - doesn't flag a violation for other references to `current_path` - flags violations for `expect(page.current_path)` - autocorrects `expect(current_path).to(eq(expected_path))` to `expect(page).to(have_current_path(expected_path, ignore_query: true))` - autocorrects `expect(current_path).not_to 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(current_path).to eq expected_path` to `expect(page).to have_current_path expected_path, ignore_query: true` - autocorrects `expect(page.current_path)` to `expect(page.current_path)` - 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(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)` - autocorrects `expect(page.current_path).to match(/regexp/i)` to `expect(page).to have_current_path(/regexp/i)` - autocorrects `expect(current_path).to eq(expected_path(f: :b))` to `expect(page).to have_current_path(expected_path(f: :b), 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` +RuboCop::Cop::RSpec::DescribedClass + when SkipBlocks is `true` + ignores violations within non-rspec blocks + when EnforcedStyle is :described_class + ignores class if the scope is changing + flags the use of described class with namespace + accepts an empty block + ignores violations within a hook scope change + flags the use of described class with nested namespace + ignores non-matching namespace + ignores if `described_class` is a part of the constant + flags for the use of the described class + ignores if a local variable is part of the namespace + ignores described class as string + ignores non-matching namespace in usages + ignores non-matching namespace defined on `describe` level + flags the use of described class with module + takes class from innermost describe + ignores violations within a class scope change + ignores subclasses + flags with metadata + ignores describe that do not reference to a class + when SkipBlocks is `false` + flags violations within all blocks + when EnforcedStyle is :explicit + ignores describe that do not reference to a class + flags the use of the described_class + ignores violations within a class scope change + autocorrects corresponding + ignores described_class as string + ignores violations within a hook scope change 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 + +CHANGELOG.md + has link definitions for all implicit links + entry + has a whitespace between the * and the body + has a link to the contributors at the end + body + ends with a punctuation + does not start with a lower case + link to related issue on github + has a valid URL + has a colon and a whitespace at the end + has an issue number prefixed with # + +config/default.yml + ends every description with a period + includes Enabled: true for every cop + has descriptions for all cops + does not have newlines in cop descriptions + has configuration for all cops + sorts configuration keys alphabetically + +RuboCop::RSpec::Language::SelectorSet + compares by value + composes sets + #send_pattern + builds a send matching pattern + #node_pattern + builds a node pattern + #block_pattern + builds a block matching pattern + #node_pattern_union + builds a node pattern union + #include? + returns true for selectors in the set + returns false for selectors not in the set + +RuboCop::RSpec::ConfigFormatter + builds a YAML dump with spacing between cops RuboCop::Cop::RSpec::PredicateMatcher 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/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 true - autocorrects `expect(foo.empty?).to_not be_truthy` 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.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` - registers an offense for a predicate method with a block - autocorrects ` expect(foo.all? do |x| + when enforced style is `explicit` + when strict is false + 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 -` to ` expect(foo).to be_all do |x| +` + 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` + registers an offense for a predicate mather with argument + accepts built in matchers + autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be_truthy` + autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be_truthy` + autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).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_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` + autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be_truthy` + registers an offense for a predicate matcher with a block + registers an offense for a predicate mather + autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be_truthy` + autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be_truthy` + accepts non-predicate matcher + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be_truthy` + autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be_truthy` + autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` + when custom matchers are allowed + accepts custom allowed explicit matchers + when strict is true + autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` + autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be(true)` + autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be(true)` + autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be(true)` + autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be(true)` + autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).to be(true)` + autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` + autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` + autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` + registers an offense for a predicate matcher with a block + accepts non-predicate matcher + autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).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) ` - registers an offense for a predicate method with argument - autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` - autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` - autocorrects `expect(foo.empty?).not_to a_truthy_value` 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?).not_to be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` - autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` + autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).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_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(true)` + registers an offense for a predicate mather + accepts built in matchers + autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` + when custom matchers are allowed + accepts custom allowed explicit matchers + when enforced style is `inflected` + when strict is true autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` - accepts a predicate method that is not ckeced true/false + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` + registers an offense for a predicate method with argument registers an offense for a predicate method with built-in equiv - registers an offense for a predicate method in actual - accepts non-predicate method - autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - accepts strict checking boolean matcher - autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` - autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` - autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` - autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` - when strict is false - registers an offense for a predicate method in actual - autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` accepts non-predicate method - autocorrects `expect(foo.empty?).to be(true)` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).to be(false)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` - autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` - registers an offense for a predicate method with argument - autocorrects `expect(foo.empty?).not_to be(false)` to `expect(foo).to be_empty` - autocorrects `expect(foo.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).not_to be_falsey` to `expect(foo).to be_empty` + 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)` autocorrects ` expect(foo.all? do |x| x + 1 x >= 2 @@ -2429,213 +2085,115 @@ x >= 2 end ` - autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` - autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` - autocorrects `expect(foo.empty?).not_to be(true)` to `expect(foo).not_to be_empty` - registers an offense for a predicate method with built-in equiv - 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)` + accepts strict checking boolean matcher + registers an offense for a predicate method in actual autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` + autocorrects `expect(foo.empty?).to_not be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` + registers an offense for a predicate method with a block + autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` + autocorrects `expect(foo.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` - autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + accepts a predicate method that is not ckeced true/false + autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` + autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` + autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` autocorrects `expect(foo.all? { }).to be_truthy` to `expect(foo).to be_all { }` - autocorrects `expect(foo.all?(n) { |x| x.present? }).to be_truthy` to `expect(foo).to be_all(n) { |x| x.present? }` + autocorrects `expect(foo.empty?).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.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` + when strict is false registers an offense for a predicate method in actual - autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` + autocorrects `expect(foo.empty?).to be(true)` to `expect(foo).to be_empty` + autocorrects `expect(foo.empty?).to be(false)` to `expect(foo).not_to be_empty` + registers an offense for a predicate method in actual + autocorrects `expect(foo.empty?).to eq(true)` to `expect(foo).to be_empty` + autocorrects `expect(foo.all? do; end).to be_truthy` to `expect(foo).to be_all do; end` autocorrects `expect(foo.has_something?).not_to be_truthy` to `expect(foo).not_to have_something` autocorrects `expect(foo.all? { present }).to be_truthy` to `expect(foo).to be_all { present }` - registers an offense for a predicate method with a block - 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` - 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.empty?).not_to a_truthy_value` to `expect(foo).not_to be_empty` accepts a predicate method that is not ckeced true/false + autocorrects `expect(foo.empty?).not_to be_truthy` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.empty?).to eq(false)` to `expect(foo).not_to be_empty` + autocorrects `expect(foo.exists?).to be_truthy` to `expect(foo).to exist` + registers an offense for a predicate method with argument + autocorrects `expect(foo.something?()).to be_truthy` to `expect(foo).to be_something()` + autocorrects `expect(foo.is_a?(Array)).to be_truthy` to `expect(foo).to be_a(Array)` + autocorrects `expect(foo.empty?).to be_falsey` to `expect(foo).not_to be_empty` + 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.has_key?("foo")).to be_truthy` to `expect(foo).to have_key("foo")` + autocorrects `expect(foo.include?(something)).to be_truthy` to `expect(foo).to include(something)` + autocorrects `expect(foo.empty?).to be_truthy` to `expect(foo).to be_empty` + registers an offense for a predicate method with a block + autocorrects `expect(foo.instance_of?(Array)).to be_truthy` to `expect(foo).to be_an_instance_of(Array)` + autocorrects `expect(foo.something? 1, 2).to be_truthy` to `expect(foo).to be_something 1, 2` autocorrects `expect(foo.all? { |x| x.present? }).to be_truthy` to `expect(foo).to be_all { |x| x.present? }` - autocorrects `expect(foo.empty?).to eq(true)` to `expect(foo).to be_empty` - when enforced style is `explicit` - when strict is 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)` - accepts non-predicate matcher - autocorrects `expect(foo).to be_all { }` to `expect(foo.all? { }).to be(true)` - autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be(false)` - registers an offense for a predicate mather with argument - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be(true)` - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be(true)` - registers an offense for a predicate matcher with a block - autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be(true)` - autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be(true)` - 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| + autocorrects `expect(foo.something?(1, 2)).to be_truthy` to `expect(foo).to be_something(1, 2)` + autocorrects `expect(foo.respond_to?(:bar)).to be_truthy` to `expect(foo).to respond_to(:bar)` + autocorrects ` expect(foo.all? do |x| x + 1 x >= 2 - end).to be(true) -` - autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be(true)` - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be(true)` - autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be(true)` - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be(true)` - accepts built in matchers - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be(true)` - registers an offense for a predicate mather - when custom matchers are allowed - accepts custom allowed explicit matchers - when strict is false - autocorrects `expect(foo).to be_something(1)` to `expect(foo.something?(1)).to be_truthy` - autocorrects `expect(foo).to be_something()` to `expect(foo.something?()).to be_truthy` - autocorrects `expect(foo).to be_all { |x| x.present? }` to `expect(foo.all? { |x| x.present? }).to be_truthy` - accepts built in matchers - autocorrects `expect(foo).to be_a(Array)` to `expect(foo.is_a?(Array)).to be_truthy` - autocorrects `expect(foo).to be_something` to `expect(foo.something?).to be_truthy` - autocorrects `expect(foo).to be_all do; end` to `expect(foo.all? do; end).to be_truthy` - autocorrects `expect(foo).not_to be_something` to `expect(foo.something?).to be_falsey` - autocorrects `expect(foo).to be_all { present }` to `expect(foo.all? { present }).to be_truthy` - autocorrects `expect(foo).to be_something 1, 2` to `expect(foo.something? 1, 2).to be_truthy` - autocorrects `expect(foo).to be_instance_of(Array)` to `expect(foo.instance_of?(Array)).to be_truthy` - accepts non-predicate matcher - autocorrects `expect(foo).to be_all(n) { |x| x.ok? }` to `expect(foo.all?(n) { |x| x.ok? }).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 do |x| + end).to be_truthy +` to ` expect(foo).to be_all do |x| x + 1 x >= 2 end -` to ` expect(foo.all? do |x| - x + 1 - x >= 2 - end).to be_truthy ` - registers an offense for a predicate mather with argument - autocorrects `expect(foo).to have_something` to `expect(foo.has_something?).to be_truthy` - autocorrects `expect(foo).to be_something(1, 2)` to `expect(foo.something?(1, 2)).to be_truthy` - registers an offense for a predicate matcher with a block - when custom matchers are allowed - accepts custom allowed explicit matchers + autocorrects `expect(foo.has_something?).to be_truthy` to `expect(foo).to have_something` + autocorrects `expect(foo.empty?).not_to be(false)` to `expect(foo).to be_empty` + accepts non-predicate method + 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? }` -RuboCop::Cop::RSpec::VoidExpect - 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` - accepts non-void `expect` with block +RuboCop::Cop::RSpec::OverwritingSetup + works with `subject!` and `let!` + handles string arguments + handles dynamic names for `let` + finds overwriten `subject` + handles unnamed subjects + finds overwriten `let` + ignores overwriting in different context + finds `let!` overwriting `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/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 - - is insane - -Weirdness - It does a thing - it does a thing - example at ./spec/smoke_tests/weird_rspec_spec.rb:176 - example at ./spec/smoke_tests/weird_rspec_spec.rb:51 - is empty - uses a matcher - has a description too - isnt a simple string - should not do the thing - quotes a string weird - isnt a simple string - is expecting you - works - example at ./spec/smoke_tests/weird_rspec_spec.rb:36 - example at ./spec/smoke_tests/weird_rspec_spec.rb:37 - is expecting you not to raise an error - has chained expectations - example at ./spec/smoke_tests/weird_rspec_spec.rb:130 - who - who - lets the word 'who' be 'who' - dynamic - dynamic - lets the word 'dynamic' be 'dynamic' - likes - likes - lets the word 'likes' be 'likes' - examples - examples - lets the word 'examples' be 'examples' - -RuboCop::RSpec::Example - extracts keywords - extracts doc string for unimplemented examples - extracts method doc string - extracts interpolated doc string - returns node - extracts symbol doc string - extracts implementation - extracts doc string - returns nil for examples without doc strings - value object semantics - computes #hash based on class and node - compares by value - can be used as a key in a hash - -RuboCop::Cop::RSpec::LeadingSubject - checks subject below hook - checks subject below let! - approves of subject above let - handles subjects in contexts - checks subject below let - handles subjects in tests - checks subject below example - checks subject below let with proc argument +RuboCop::Cop::RSpec::Cop + when the source path starts with `spec/` + registers an offense + when the file is a source file without "spec" in the name + ignores the source when the path is not a spec file + ignores the source when the path is not a specified pattern + when the source path ends with `_spec.rb` + ignores the file if it is ignored + 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 + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + 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::EmptyExampleGroup - does not recognize custom include methods by default - flags an empty top level describe - does not flag include_examples - does not flag methods matching example group names - flags an empty context - when a custom include method is specified - does not flag an otherwise empty example group +RuboCop::Cop::RSpec::ReceiveNever + flags usage of `never` + flags usage of `never` with `expect_any_instance_of` + flags usage of `never` with `is_expected` + allows method called `never` + flags usage of `never` after `with` 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 - -RuboCop::RSpec::Wording - rewrites "should worry about the future" as "worries about the future" - rewrites "should amass debt" as "amasses debt" - rewrites "shouldn't return something" as "does not return something" - rewrites "should obey my orders" as "obeys my orders" - rewrites "should fax the document" as "faxes the document" - rewrites "should WORRY" as "WORRIES" - rewrites "should return something" as "returns something" - rewrites "should pay for pizza" as "pays for pizza" - rewrites "" as "" - rewrites "shouldn't" as "does not" - rewrites "should have sweets" as "has sweets" - rewrites "should WISH me luck" as "WISHES me luck" - rewrites "should" as "" - rewrites "shouldn't be true" as "is not true" - rewrites "should buy the product" as "buys the product" - rewrites "should miss me" as "misses me" - rewrites "should not return something" as "does not return something" - rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" - rewrites "should alias the method" as "aliases the method" - rewrites "should do nothing" as "does nothing" - rewrites "should wish me luck" as "wishes me luck" - rewrites "should echo the input" as "echoes the input" - rewrites "should fizz" as "fizzes" - rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" - rewrites "should search the internet" as "searches the internet" - rewrites "should deploy the app" as "deploys the app" - rewrites "SHOULDN'T BE true" as "IS NOT true" - rewrites "should not" as "does not" - rewrites "should really only return one item" as "really only returns one item" + 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::BeforeAfterAll when using before each @@ -2643,253 +2201,483 @@ when using before all 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/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb when using after all registers an offense when using after each does not register an offense -RuboCop::Cop::RSpec::InstanceSpy - when used with `have_received` - adds an offense for an instance_double with multiple arguments - ignores instance_double when it is not used with as_null_object - adds an offense for an instance_double with single argument +RuboCop::Cop::RSpec::DescribedClassModuleWrapping + allows a module that does not contain RSpec.describe + registers an offense when RSpec.describe is nested within a module + allows a describe block in the outermost scope + registers an offense when RSpec.describe is nested within two modules with default configuration - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + +RuboCop::Cop::RSpec::AroundBlock + when the hook is scoped with a symbol + 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 - when not used with `have_received` - does not add an offence + 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 two values are yielded and the first is unused + registers an offense for the first argument + when the yielded value is unused + registers an offense + when used as a block arg + does not register an offense + when passed to another method + does not register an offense + when no value is yielded + registers an offense + when the yielded value is referenced but not used + registers an offense + when #call is called + does not register an offense + when yielded to another block + does not register an offense + when a method other than #run or #call is called + registers an offense + when #run is called + does not register an offense -RuboCop::RSpec::DescriptionExtractor - builds a hash of descriptions +RuboCop::Cop::RSpec::InstanceVariable + flags several instance variables inside a describe + ignores an instance variable without describe + ignores non-spec blocks + flags an instance variable inside a describe + ignores instance variables outside of specs + flags an instance variable inside a shared example + ignores an instance variable inside a dynamic class + when configured with AssignmentOnly + ignores an instance variable when it is not assigned + flags an instance variable when it is also assigned + flags an instance variable when it is also assigned in a sibling example group + with default configuration + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + when used in a custom matcher + ignores instance variables inside `matcher` + flags instance variables outside `matcher` + ignores instance variables inside `RSpec::Matchers.define` -RuboCop::Cop::RSpec::NestedGroups - counts nesting correctly when non-spec nesting - ignores non-spec context methods - support --auto-gen-config - flags nested contexts - when Max is configured as 2 - flags two levels of nesting +RuboCop::Cop::RSpec::DescribeMethod + enforces non-method names + skips specs not having a string second argument + ignores describes with only a class + skips methods starting with a . or # with default configuration does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - when configured with MaxNesting - emits a deprecation warning -RuboCop::Cop::RSpec::ExpectInHook - adds an offense for `expect` in `around` hook - adds an offense for `expect` with block in `before` hook - adds an offense for `expect` in `before` hook - adds an offense for `expect` in `after` hook - accepts `expect` in `it` - accepts an empty `before` hook - accepts `allow` in `before` hook +RuboCop::Cop::RSpec::VariableName + when configured for `camelCase` + when `subject` + 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 `let` + does not register offense for camelCase + registers an offense for snake_case + when `subject!` + does not register offense for camelCase + registers an offense for snake_case + when configured for `snake_case` + when `let` with string names + does not register an offense for snake_case + registers an offense for kebab-case + registers an offense for camelCase + does not register offense for interpolated string + 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 `subject!` + does not register offense for snake_case + registers an offense for camelCase + when `let` with symbol names + registers an offense for PascalCase + registers an offense for camelCase + does not register an offense for snake_case + registers offense with multiple lets + does not register offense for interpolated symbol + when `let` with proc + registers offense with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/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::RepeatedExampleGroupBody - registers an offense for repeated describe body - does not register offense for example groups in different groups - does not register offense for different block body implementation - registers offense no descriptions and similar body - does not register offense with several docstring - registers offense only for RSPEC namespace example groups in any order - registers an offense for several repeated context body - does not register offense when module arg namespace is different + registers offense correctly if example groups are separated skips `skip` and `pending` statements + registers offense for different groups + registers offense only for RSPEC namespace example groups in any order registers offense only for example group does not register offense for same examples with different data - does not register offense if metadata is different - registers an offense for when module arg and namespace are identical - registers an offense for repeated context body - registers offense correctly if example groups are separated + does not register offense for different block body implementation does not register offense if no descriptions, but different body + does not register offense when module arg namespace is different + does not register offense for example groups in different groups does not register offense if module arg is different + registers an offense for repeated context body registers offense only for RSPEC namespace example groups - registers offense for different groups + registers offense no descriptions and similar body + does not register offense with several docstring + registers an offense for several repeated context body + does not register offense if metadata is different + registers an offense for when module arg and namespace are identical + registers an offense for repeated describe body with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RubocopBug - has a single example - has an expectation +Weirdness + has chained expectations + is empty + is expecting you not to raise an error + uses a matcher + works + it does a thing + example at ./spec/smoke_tests/weird_rspec_spec.rb:36 + quotes a string weird + isnt a simple string + is expecting you + example at ./spec/smoke_tests/weird_rspec_spec.rb:37 + should not do the thing + has a description too + example at ./spec/smoke_tests/weird_rspec_spec.rb:51 + example at ./spec/smoke_tests/weird_rspec_spec.rb:130 + isnt a simple string + example at ./spec/smoke_tests/weird_rspec_spec.rb:176 + It does a thing + who + who + lets the word 'who' be 'who' + likes + likes + lets the word 'likes' be 'likes' + examples + examples + lets the word 'examples' be 'examples' + dynamic + dynamic + lets the word 'dynamic' be 'dynamic' -RuboCop::Cop::RSpec::DescribedClass - when SkipBlocks is `false` - flags violations within all blocks - when EnforcedStyle is :described_class - ignores subclasses - ignores non-matching namespace defined on `describe` level - ignores class if the scope is changing - ignores describe that do not reference to a class - ignores described class as string - flags the use of described class with nested namespace - accepts an empty block - flags for the use of the described class - ignores non-matching namespace - ignores violations within a class scope change - flags the use of described class with namespace - flags the use of described class with module - flags with metadata - ignores non-matching namespace in usages - ignores violations within a hook scope change - takes class from innermost describe - ignores if a local variable is part of the namespace - ignores if `described_class` is a part of the constant - when SkipBlocks is `true` - ignores violations within non-rspec blocks +RuboCop::RSpec::Wording + rewrites "should WORRY" as "WORRIES" + rewrites "should amass debt" as "amasses debt" + rewrites "should echo the input" as "echoes the input" + rewrites "should search the internet" as "searches the internet" + rewrites "" as "" + rewrites "should deploy the app" as "deploys the app" + rewrites "should buy the product" as "buys the product" + rewrites "should return something" as "returns something" + rewrites "should not" as "does not" + rewrites "should wish me luck" as "wishes me luck" + rewrites "should WISH me luck" as "WISHES me luck" + rewrites "SHOULDN'T BE true" as "IS NOT true" + rewrites "SHOULDN'T NOT RETAIN UPPERCASE" as "DOES NOT NOT RETAIN UPPERCASE" + rewrites "should alias the method" as "aliases the method" + rewrites "should fax the document" as "faxes the document" + rewrites "shouldn't" as "does not" + rewrites "should obey my orders" as "obeys my orders" + rewrites "should do nothing" as "does nothing" + rewrites "should pay for pizza" as "pays for pizza" + rewrites "should have sweets" as "has sweets" + rewrites "should" as "" + rewrites "shouldn't be true" as "is not true" + rewrites "SHOULD RETAIN UPPERCASE" as "RETAINS UPPERCASE" + rewrites "should worry about the future" as "worries about the future" + rewrites "should miss me" as "misses me" + rewrites "should really only return one item" as "really only returns one item" + rewrites "shouldn't return something" as "does not return something" + rewrites "should fizz" as "fizzes" + rewrites "should not return something" as "does not return something" + +RuboCop::Cop::RSpec::Pending + flags xscenario + ignores it with skip: false metadata + flags skip inside of an it + ignores context + flags pending examples when receiver is explicit + flags blocks with skip: string metadata + flags xexample + flags xspecify + flags xit + ignores method called pending + flags blocks with skip: true metadata + flags describe with skip symbol metadata + flags xdescribe + ignores example + ignores example_group + flags pending blocks + ignores feature + flags blocks with skip symbol metadata + ignores describe + ignores specify + ignores it + flags skip blocks + flags blocks with pending symbol metadata + flags xfeature + ignores scenario + flags xcontext with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - when EnforcedStyle is :explicit - ignores violations within a hook scope change - ignores violations within a class scope change - ignores described_class as string - ignores describe that do not reference to a class - autocorrects corresponding - flags the use of the described_class -RuboCop::Cop::RSpec::EmptyLineAfterFinalLet - handles HEREDOC for let - handles silly HEREDOC syntax for let - flags missing empty line after a multiline comment after last let - handles silly HEREDOC offense - approves empty line after let - allows comment followed by an empty line after let - flags missing empty line after the comment that comes after last let - check for empty line after the last `let!` - checks for empty line after last let - handles let in tests - ignores empty lines between the lets - handles multiline let block - checks for empty line after let with proc argument - handles let being the latest node +RuboCop::Cop::RSpec::HookArgument + when EnforcedStyle is :each + autocorrects `before(:example) { }` to `before(:each) { }` + autocorrects `before { }` to `before(:each) { }` + ignores :context and :suite + generates a todo based on the detected style + autocorrects `config.before { }` to `config.before(:each) { }` + detects :example for hooks + ignores hooks with more than one argument + detects :each for hooks + generates a todo based on the detected style + autocorrects `before(:each) { }` to `before(:each) { }` + ignores non-rspec hooks + detects hooks without default scopes + autocorrects `config.before(:each) { }` to `config.before(:each) { }` + autocorrects `config.before(:example) { }` to `config.before(:each) { }` + generates a todo based on the detected style 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/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + when EnforcedStyle is :implicit + generates a todo based on the detected style + ignores non-rspec hooks + autocorrects `config.before(:example) { }` to `config.before { }` + autocorrects `config.before { }` to `config.before { }` + detects :example for hooks + does not flag hooks without default scopes + autocorrects `before { }` to `before { }` + detects :each for hooks + generates a todo based on the detected style + autocorrects `before(:example) { }` to `before { }` + autocorrects `before(:each) { }` to `before { }` + ignores :context and :suite + autocorrects `config.before(:each) { }` to `config.before { }` + generates a todo based on the detected style + ignores hooks with more than one argument + when EnforcedStyle is :example + autocorrects `config.before(:example) { }` to `config.before(:example) { }` + generates a todo based on the detected style + autocorrects `before(:each) { }` to `before(:example) { }` + autocorrects `before(:example) { }` to `before(:example) { }` + autocorrects `before { }` to `before(:example) { }` + generates a todo based on the detected style + ignores hooks with more than one argument + ignores non-rspec hooks + detects :example for hooks + detects :each for hooks + does not flag hooks without default scopes + generates a todo based on the detected style + ignores :context and :suite + autocorrects `config.before { }` to `config.before(:example) { }` + autocorrects `config.before(:each) { }` to `config.before(:example) { }` + +RuboCop::Cop::RSpec::LetSetup + complains when let! is used and not referenced + complains when let! is used and not referenced in shared example group + complains when there is a custom nesting level + complains when let! is used and not referenced within nested group + complains when let! used in shared example including + ignores let! when used in `before` + ignores let! when used in example + complains when there is only one nested node into 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/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + +RuboCop::Cop::RSpec::RepeatedDescription + registers offense for repeated description and metadata + registers offense for repeated description in same iterator + ignores descriptions repeated in a shared context + does not flag descriptions with different interpolated variables + does not flag different descriptions in different iterators + does not flag examples if metadata is different + registers offense if same method used in docstring + ignores repeated descriptions in a nested context + does not flag tests which do not contain description strings + does not flag examples with same metadata and different description + does not flag different methods used as docstring + registers an offense for repeated descriptions + registers offense for repeated description in different iterators + registers offense for repeated descriptions separated by a context + 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 + +RubocopBug + has an expectation + has a single example RuboCop::Cop::RSpec::DescribeClass - ignores nested describe statements - flags specs with non :type metadata - supports ::RSpec.describe - flags normal metadata in describe - ignores request specs - ignores view specs - doesn't flag top level describe in a shared context doesn't flag top level describe in a shared example + ignores an empty describe doesn't flag top level describe in an unnamed shared context checks describe statements after a require + supports ::RSpec.describe + doesn't flag top level describe in a shared context ignores routing specs - checks highlights the first argument of a describe - ignores system specs - ignores feature specs when RSpec.describe is used - supports RSpec.describe - doesn't blow up on single-line describes ignores feature specs ignores feature specs - also with complex options + ignores feature specs when RSpec.describe is used checks first-line describe statements - ignores an empty describe + supports RSpec.describe + flags normal metadata in describe + ignores request specs + ignores view specs + ignores nested describe statements + flags specs with non :type metadata + doesn't blow up on single-line describes + checks highlights the first argument of a describe + ignores system specs with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb when argument is a String literal - ignores class with namespace - checks `camelCase` ignores value constants + ignores top-level constants with `::` at start + ignores class with namespace ignores value constants with namespace + checks `camelCase` ignores class without namespace - checks empty strings - ignores top-level constants with `::` at start checks numbers at start + checks empty strings -RuboCop::Cop::RSpec::SubjectStub - flags when an unnamed subject is mocked - flags when subject is stubbed and there are several named subjects in the same example group - flags nested subject stubs - flags nested subject stubs when example group does not define subject - flags negated runners - flags when an implicit subject is mocked - flags when subject is mocked - flags when subject is stubbed - flags multiple-method stubs - flags nested subject stubs when adjacent context redefines - flags spy subject stubs - flags chain stubs - flags an expectation made on an unnamed subject - flags deeply nested subject stubs - ignores nested stubs when nested subject is anonymous - flags nested subject stubs when nested subject uses same name - flags one-line expectcation syntax - flags when there are several top level example groups - ignores stub within context where subject name changed - flags stub inside all matcher - top level example groups - flags in top level fcontext - flags in top level describe - flags in top level ffeature - flags in top level shared_examples_for - flags in top level xdescribe - flags in top level shared_context - flags in top level example_group - flags in top level context - flags in top level feature - flags in top level xfeature - flags in top level xcontext - flags in top level shared_examples - flags in top level fdescribe +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/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::Cop::RSpec::Capybara::VisibilityMatcher - registers an offense when using `visible: false` - does not register an offense when no options are given` - registers an offense when using `visible: true` - registers an offense when using a selector` - registers an offense when using a using multiple options` - does not register an offense when using `visible: :hidden` - does not register an offense when using `visible: :visible` - does not register an offense when using `visible: :all` - recognizes multiple matchers - does not register an offense when using multiple options - does not register an offense when using other options +RuboCop::Cop::RSpec::HooksBeforeExamples + ignores single-line example blocks + flags `before` after `include_examples` + does not flag `before` in a nested context + flags `after` after an example + flags `before` after `it` + flags `before` after `context` + does not flag hooks before the examples + allows inclusion of context before hooks + flags scoped hook after an example + with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/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::SingleArgumentMessageChain 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 + receive_message_chain + accepts multi-argument string calls + accepts single-argument calls with variable + reports single-argument calls + accepts single-argument calls with send node + accepts multi-argument calls + reports single-argument string calls + with multiple-element array argument + doesn't report an offense + with single-key hash argument + reports an offense + with multiple keys hash argument + doesn't report an offense + with single-element array argument + reports an offense + stub_chain + reports single-argument string calls + accepts multi-argument string calls + accepts multi-argument calls + reports single-argument calls + +RuboCop::Cop::RSpec::ImplicitBlockExpectation + flags proc + flags lambda in subject + flags named subject + ignores when there is no subject defined + ignores non-lambda subject + ignores normal local subject + flags lambda in subject! + flags with `should` as implicit subject + flags Proc.new + flags literal lambda + flags when subject is defined in the outer example group + flags with `should_not` as implicit subject + ignores named subject with deeply nested lambda + 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::ExampleWithoutDescription + with EnforcedStyle `disallow` + flags missing description in multi-line examples + flags missing description in single-line examples + ignores `it` with a description + with EnforcedStyle `always_allow` + ignores `it` with a description + flags empty strings for description + ignores `it` without an argument + with EnforcedStyle `single_line_only` + flags missing description in multi-line examples + flags example with an empty string for description + ignores missing description in single-line examples + with default configuration + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb RuboCop::Cop::RSpec::Capybara::FeatureMethods autocorrects ` describe Foo do - scenario { } + given!(:foo) { } end ` to ` describe Foo do - it { } + let!(:foo) { } end ` - flags violations for `feature` - flags violations for `given` autocorrects ` describe Foo do background { } end @@ -2897,336 +2685,583 @@ before { } end ` - ignores feature calls outside spec flags violations for `xscenario` + ignores variables inside examples + flags violations for `background` autocorrects ` describe Foo do - xscenario { } + scenario { } end ` to ` describe Foo do - xit { } + it { } end ` + allows includes before the spec autocorrects ` describe Foo do - given(:foo) { } + RSpec.feature { } end ` to ` describe Foo do - let(:foo) { } + RSpec.describe { } end ` autocorrects ` describe Foo do - RSpec.feature { } + xscenario { } end ` to ` describe Foo do - RSpec.describe { } + xit { } end ` + ignores feature calls outside spec + flags violations for `scenario` + flags violations for `feature` + flags violations for `given!` autocorrects ` describe Foo do - given!(:foo) { } + given(:foo) { } end ` to ` describe Foo do - let!(:foo) { } + let(:foo) { } end ` - allows includes before the spec - flags violations for `given!` - ignores variables inside examples - flags violations for `scenario` - flags violations for `background` + flags violations for `given` with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb - does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb with configured `EnabledMethods` - flags other methods ignores usage of the enabled method + flags other methods -RuboCop::Cop::RSpec::Cop - when custom patterns are specified - registers offenses when the path matches a custom specified pattern - when the source path starts with `spec/` - registers an offense - when the source path ends with `_spec.rb` - ignores the file if it is ignored - registers an offense - when the source path contains `/spec/` - registers an offense +RuboCop::RSpec::Example + extracts doc string + extracts method doc string + extracts interpolated doc string + returns node + extracts doc string for unimplemented examples + extracts keywords + extracts implementation + returns nil for examples without doc strings + extracts symbol doc string + value object semantics + computes #hash based on class and node + can be used as a key in a hash + compares by value + +RuboCop::Cop::RSpec::EmptyLineAfterExample + flags a missing empty line after `it` + flags mixed one-line and multi-line examples + flags a missing empty line after `specify` + flags one-line examples + ignores consecutive one-liners + ignores when an empty line is present + when AllowConsecutiveOneLiners is false + ignores consecutive one-liners 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::MultipleDescribes + finds multiple top level describes with class and method + skips single top level describe + finds multiple top level describes only with 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/factory_bot_spec.rb - 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 + 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::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 - when EnforcedStyle is `not_to` - detects the `to_not` offense on an expect block - detects no offense when using `not_to` - detects the `to_not` offense +RuboCop::Cop::RSpec::Capybara::VisibilityMatcher + does not register an offense when using other options + registers an offense when using a selector` + registers an offense when using `visible: true` + registers an offense when using `visible: false` + recognizes multiple matchers + does not register an offense when using `visible: :all` + does not register an offense when using `visible: :visible` + does not register an offense when using multiple options + registers an offense when using a using multiple options` + does not register an offense when using `visible: :hidden` + does not register an offense when no options are given` with default configuration does not crash on smoke test: spec/smoke_tests/empty_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb -RuboCop::Cop::RSpec::AroundBlock - when no value is yielded - registers an offense - when passed to another method - does not register an offense - when #run is called - does not register an offense - when #call is called - does not register an offense - when a method other than #run or #call is called - registers an offense - when yielded to another block - does not register an offense +RuboCop::Cop::RSpec::Be + allows specific `be_` matchers + registers an offense for `be` without an argument + allows `be` with an argument + registers an offense for not_to be 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 + +RuboCop::Cop::RSpec::ExpectOutput + does not flag assigns to $stdout when in the root scope + registers an offense for overwriting $stdout within an example + does not flag assignments to other global variables + does not register an offense for interacting with $stdout + does not flag assignments to $stdout in example_group scope + does not flag assignments to $stdout outside of example scope + registers an offense for overwriting $stderr within an example scoped 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/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 two values are yielded and the first is unused - registers an offense for the first argument - when the yielded value is unused - registers an offense - 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 hook is scoped with a symbol - registers an offense -RuboCop::RSpec::Language::SelectorSet - compares by value - composes sets - #node_pattern - builds a node pattern - #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 +RuboCop::Cop::RSpec::EmptyLineAfterSubject + approves empty line after subject + handles subjects in tests + approves empty line after subject! + handles subject being the latest node + checks for empty line after subject + 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 -RuboCop::Cop::RSpec::LetBeforeExamples - flags `let` after `include_examples` - autocorrects ` RSpec.describe User do - include_examples('should be after let') +RuboCop::Cop::RSpec::Yield + flags multiple `block.call` + flags `block.call` when `receive` is chained + flags `block.call` with arguments + flags multiple `block.call` with arguments + 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/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 - 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') +RuboCop::Cop::RSpec::LeakyConstantDeclaration + module defined + flags inside an 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/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 + constant assignment + ignores outside of example/shared group + flags inside an example + flags inside shared example group + flags inside an example group + class defined + ignores anonymous classes + flags namespaced class + flags inside an example group - end -` - does not flag `let` in a nested context - flags `let` after `context` - ignores single-line example blocks - flags `let` with proc argument - does not flag `let` before the examples - allows inclusion of context before `let` - flags `let` after `it` +RuboCop::Cop::RSpec::RepeatedExample + does not flag examples when different its arguments are used + does not flag examples with different implementations + does not register a violation if rspec tag magic is involved + does not flag repeated examples in different scopes + registers an offense for repeated 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/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + +RuboCop::Cop::RSpec::ExampleWording + skips interpolated description without literal `should` at the start + finds leading it in interpolated description + finds description with `shouldn't` at the beginning + finds description with `SHOULDN'T` at the beginning + finds leading its + skips words beginning with 'it' + skips descriptions without `should` at the beginning + finds interpolated description with `should` at the beginning + flags \-separated multiline interpolated strings + flags a lone should not + ignores non-example blocks + flags a lone should + skips descriptions starting with words that begin with `should` + finds description with `Should` at the beginning + finds description with `should` at the beginning + flags \-separated multiline strings 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::DescribeSymbol + does not flag non-Symbol arguments + flags violations for `describe :symbol` + flags violations for a nested `describe` + flags violations for `RSpec.describe :symbol` + flags violations for `describe :symbol` with multiple arguments + does not flag `context :symbol` + 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::Capybara::CurrentPathExpectation + flags violations for `expect(page.current_path)` + autocorrects `expect(current_path).to eq expected_path` to `expect(page).to have_current_path expected_path, ignore_query: true` + autocorrects `expect(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` + autocorrects `expect(page.current_path).to eq(foo(bar).path)` to `expect(page).to have_current_path(foo(bar).path, ignore_query: true)` + doesn't flag a violation for other references to `current_path` + autocorrects `expect(current_path).to_not eq expected_path` to `expect(page).to have_no_current_path expected_path, ignore_query: true` + autocorrects `expect(page.current_path).to match(variable)` to `expect(page.current_path).to match(variable)` + doesn't flag a violation for other expectations + autocorrects `expect(current_path).to eq(expected_path)` to `expect(page).to have_current_path(expected_path, ignore_query: true)` + 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\//)` + 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)` + autocorrects `expect(current_path).to(eq(expected_path))` to `expect(page).to(have_current_path(expected_path, ignore_query: true))` + with default configuration + does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb does not crash on smoke test: spec/smoke_tests/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::ContextMethod flags context with `#` at the beginning - ignores describe blocks 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/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/no_tests_spec.rb + +Project requires + alphabetizes cop requires + +RuboCop::Cop::RSpec::ExpectInHook + adds an offense for `expect` with block in `before` 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` in `after` hook + accepts an empty `before` hook + with default configuration does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/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::IteratedExpectation - ignores `each` with expectation on property - ignores `each` when there is a negative expectation - ignore `each` when the body does not contain only expectations - ignores assignments in the iteration - flags `each` with an expectation - ignores `each` without expectation - flags `each` when expectation calls method with arguments - flags `each` with multiple expectations +RuboCop::Cop::RSpec::ExampleLength + allows a short example + allows an empty example + ignores comments + ignores non-spec blocks + when inspecting large examples + flags the example + with CountComments enabled + flags the example 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::VerifiedDoubles + finds a `double` instead of an `instance_double` + ignores instance_doubles + ignores doubles that have no name specified + when configured not to ignore nameless doubles + flags doubles that have no name specified + when configuration does not specify IgnoreSymbolicNames + find doubles whose name is a symbol + finds a `spy` instead of an `instance_spy` + when configured to ignore symbolic names + ignores doubles whose name is a symbol + still flags doubles whose name is a string + with default configuration does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb -RuboCop::Cop::RSpec::ReceiveNever - flags usage of `never` after `with` - flags usage of `never` with `expect_any_instance_of` - allows method called `never` - flags usage of `never` with `is_expected` - flags usage of `never` +RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically + registers an offense for attributes defined on explicit receiver + accepts valid sequence definition + does not add offense if out of factory bot block + accepts valid factory definitions + does not add offense if method called on a local variable + accepts valid traits_for_enum definition + does not add offense if method called on another object + registers an offense for an attribute defined on `self` + registers an offense for offending code + registers an offense in a transient block + autocorrects ` FactoryBot.define do + factory :post do + title "Something" + comments_count 0 + tag Tag::MAGIC + recent_statuses [] + status([:draft, :published].sample) + published_at 1.day.from_now + created_at(1.day.ago) + updated_at Time.current + update_times [Time.current] + meta_tags(foo: Time.current) + other_tags({ foo: Time.current }) + options color: :blue + other_options Tag::MAGIC => :magic + self.end Date.tomorrow + + trait :old do + published_at 1.week.ago + end + end + end +` to ` FactoryBot.define do + factory :post do + title { "Something" } + comments_count { 0 } + tag { Tag::MAGIC } + recent_statuses { [] } + status { [:draft, :published].sample } + published_at { 1.day.from_now } + created_at { 1.day.ago } + updated_at { Time.current } + update_times { [Time.current] } + meta_tags { { foo: Time.current } } + other_tags { { foo: Time.current } } + options { { color: :blue } } + other_options { { Tag::MAGIC => :magic } } + self.end { Date.tomorrow } + + trait :old do + published_at { 1.week.ago } + end + end + end +` + accepts valid association definitions + registers an offense in a trait 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::Focus + flags focused block types + ignores non-rspec code with :focus blocks + does not flag unfocused specs + flags rspec example blocks that include `:focus` preceding a hash + does not flag a method that is focused twice + flags all rspec example blocks that include `:focus` + flags all rspec example blocks with that include `focus: true` + 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::RSpec::ConfigFormatter - builds a YAML dump with spacing between cops +RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup + highlights single line formulations correctly + approves empty line after describe + approves empty line after context + checks for empty line after describe + handles describes in an if block + checks for empty line after context + 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 -Project requires - alphabetizes cop requires +RuboCop::Cop::RSpec::LetBeforeExamples + flags `let` after `context` + flags `let` with proc argument + ignores single-line example blocks + flags `let` after `include_examples` + allows inclusion of context before `let` + does not flag `let` in a nested context + does not flag `let` before the examples + autocorrects ` RSpec.describe User do + include_examples('should be after let') -RuboCop::Cop::RSpec::MessageChain - finds `receive_message_chain` - finds old `stub_chain` syntax + 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 +` + flags `let` after `it` 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::RSpec::ExampleGroup + exposes examples in scope + +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` + flags a violation for it_behaves_like + does not flag a violation for it_behaves_like + 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::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/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::ImplicitSubject - with EnforcedStyle `single_statement_only` - allows `is_expected` in multi-line example with single statement - flags `is_expected` in multi-statement examples - with EnforcedStyle `single_line_only` - allows `is_expected` inside `its` block, in multi-line examples - does not flag methods called is_expected and should - flags `should` in multi-line examples - allows `should` in single-line examples - detects usage of `is_expected` inside helper methods - flags `is_expected` in multi-line examples - allows `is_expected` in single-line examples with default configuration - does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb does not crash on smoke test: spec/smoke_tests/empty_spec.rb + does not crash on smoke test: spec/smoke_tests/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/weird_rspec_spec.rb + with EnforcedStyle `single_line_only` + allows `should` in single-line examples + flags `is_expected` in multi-line examples + flags `should` in multi-line examples + allows `is_expected` in single-line examples + detects usage of `is_expected` inside helper methods + allows `is_expected` inside `its` block, in multi-line examples + does not flag methods called is_expected and should with EnforcedStyle `disallow` flags `is_expected` in multi-line examples flags `should` in multi-line examples + allows `is_expected` inside `its` block flags `is_expected` in single-line examples flags `should` in single-line examples - allows `is_expected` inside `its` block + with EnforcedStyle `single_statement_only` + allows `is_expected` in multi-line example with single statement + flags `is_expected` in multi-statement examples -RuboCop::Cop::RSpec::DescribeMethod - enforces non-method names - skips specs not having a string second argument - ignores describes with only a class - skips methods starting with a . or # +RuboCop::Cop::RSpec::FactoryBot::CreateList with default configuration - does not crash on smoke test: spec/smoke_tests/empty_spec.rb - does not crash on smoke test: spec/smoke_tests/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/weird_rspec_spec.rb + does not crash on smoke test: spec/smoke_tests/empty_spec.rb + when EnforcedStyle is :create_list + autocorrects `5.times { FactoryGirl.create :user }` to `FactoryGirl.create_list :user, 5` + ignores n.times with argument + ignores n.times when there is no create call inside + ignores create method of other object + 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 }` to `create_list :user, 5` + autocorrects `5.times { create :user, :trait, key: val }` to `create_list :user, 5, :trait, key: val` + flags usage of n.times when FactoryGirl.create is used + flags usage of n.times with no arguments + flags usage of n.times when FactoryBot.create is used + flags FactoryGirl.create calls with a block + ignores n.times when there is other calls but create + 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 +` + autocorrects `5.times { create(:user, :trait) }` to `create_list(:user, 5, :trait)` + ignores create in other block + when EnforcedStyle is :n_times + autocorrects `create_list(:user, 5, :trait)` to `5.times { create(:user, :trait) }` + flags usage of FactoryGirl.create_list with a block + autocorrects `create_list :user, 5, :trait, key: val` to `5.times { create :user, :trait, key: val }` + autocorrects `FactoryGirl.create_list :user, 5` to `5.times { FactoryGirl.create :user }` + ignores create method of other object + flags usage of create_list + flags usage of FactoryGirl.create_list + autocorrects `create_list :user, 5` to `5.times { create :user }` -RuboCop::Cop::RSpec::UnspecifiedException - with raise_exception matcher - allows exception matching regular expressions - allows classes with blocks with braces - allows exception types with messages - allows empty exception specification when not expecting an error - allows exception classes - allows exception types with matching regular expressions - allows classes with blocks with do/end - allows parameterized exceptions - detects the `unspecified_exception` offense - allows exception messages - with raise_error matcher - allows parameterized exceptions - allows classes with blocks with braces - allows exception types with messages - allows exception types with matching regular expressions - allows exception matching regular expressions - allows classes with blocks with do/end - detects the `unspecified_exception` offense - allows exception messages - allows exception classes - allows empty exception specification when not expecting an error +RuboCop::Cop::RSpec::EmptyLineAfterHook + checks for empty line after `before` hook + approves empty line after `around` hook + checks for empty line after `around` hook + approves empty line after `after` hook + handles multiline `before` block + handles multiline `after` block + handles multiline `around` block + approves empty line after `before` hook + checks for empty line after `after` hook + handles `before` being the latest node 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/factory_bot_spec.rb does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb -RuboCop::Cop::RSpec::ExampleWording - flags \-separated multiline strings - skips interpolated description without literal `should` at the start - finds interpolated description with `should` at the beginning - flags \-separated multiline interpolated strings - skips words beginning with 'it' - finds leading its - flags a lone should not - skips descriptions without `should` at the beginning - skips descriptions starting with words that begin with `should` - ignores non-example blocks - finds description with `should` at the beginning - finds leading it in interpolated description - finds description with `Should` at the beginning - finds description with `shouldn't` at the beginning - flags a lone should - finds description with `SHOULDN'T` at the beginning +RuboCop::Cop::RSpec::ImplicitExpect + when EnforcedStyle is is_expected + approves of is_expected.to_not + flags it { should } + approves of is_expected.to + approves of is_expected.not_to + flags it { should_not } + generates a todo based on the detected style + when EnforcedStyle is should + flags it { is_expected.not_to } + approves of should + generates a todo based on the detected style + flags it { is_expected.to } + flags it { is_expected.to_not } + approves of should_not + generates a todo based on the detected style with default configuration - does not crash on smoke test: spec/smoke_tests/no_tests_spec.rb + does not crash on smoke test: spec/smoke_tests/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 - -RuboCop::Cop::RSpec::VariableDefinition - when EnforcedStyle is `strings` - registers an offense for interpolated symbol - registers an offense for symbol name - does not register offense for string names - 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 - when EnforcedStyle is `symbols` - does not register offense for symbol names - registers an offense for multiline string - registers an offense for interpolated string - registers an offense for string name -RuboCop::Cop::RSpec::ExampleWithoutDescription - with EnforcedStyle `disallow` - flags missing description in multi-line examples - ignores `it` with a description - flags missing description in single-line examples +RuboCop::Cop::RSpec::MissingExampleGroupArgument + checks first argument of context + accepts methods with a name like an example block + checks first argument of nested describe + checks first argument of describe + accepts describe with an 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/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 - with EnforcedStyle `always_allow` - ignores `it` without an argument - ignores `it` with a description - flags empty strings for description - with EnforcedStyle `single_line_only` - flags missing description in multi-line examples - flags example with an empty string for description - ignores missing description in single-line examples -Finished in 5.64 seconds (files took 1.21 seconds to load) +Finished in 10.22 seconds (files took 2.2 seconds to load) 1499 examples, 0 failures -Randomized with seed 37812 +Randomized with seed 33158 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -3258,12 +3293,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/3794305/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/3794305/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/639867 and its subdirectories -I: Current time: Sat Aug 30 05:40:36 -12 2025 -I: pbuilder-time-stamp: 1756575636 +I: removing directory /srv/workspace/pbuilder/3794305 and its subdirectories +I: Current time: Mon Jul 29 01:19:49 +14 2024 +I: pbuilder-time-stamp: 1722165589