Diff of the two buildlogs: -- --- b1/build.log 2023-05-05 03:30:32.575198558 +0000 +++ b2/build.log 2023-05-05 03:33:33.103272948 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Jun 5 21:52:51 -12 2024 -I: pbuilder-time-stamp: 1717667571 +I: Current time: Fri May 5 17:30:34 +14 2023 +I: pbuilder-time-stamp: 1683257434 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./ruby-factory-bot_6.2.1.orig.tar.gz] I: copying [./ruby-factory-bot_6.2.1-1.debian.tar.xz] I: Extracting source -gpgv: Signature made Sat Oct 22 04:14:52 2022 -12 +gpgv: Signature made Sun Oct 23 06:14:52 2022 +14 gpgv: using EDDSA key C47EBFCC4E57E9FC32CA3400461BEE5D240A9E91 gpgv: Can't check signature: No public key dpkg-source: warning: cannot verify inline signature for ./ruby-factory-bot_6.2.1-1.dsc: no acceptable signature found @@ -29,135 +29,167 @@ dpkg-source: info: applying 0004-Fix-failing-tests-with-rails-5.2.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/975654/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/1594645/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 May 5 17:31 /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/1594645/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/1594645/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=16' - DISTRIBUTION='bookworm' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="15" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + 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 parallel=15' + DIRSTACK=() + DISTRIBUTION=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='1de9519ff1434cb38cd798d69b605027' - 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='975654' - PS1='# ' - PS2='> ' + INVOCATION_ID=297f160e3b8d411f96b831711994f1a3 + 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=1594645 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.YW6jbO7L/pbuilderrc_AYqm --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.YW6jbO7L/b1 --logfile b1/build.log ruby-factory-bot_6.2.1-1.dsc' - SUDO_GID='110' - SUDO_UID='105' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://85.184.249.68:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.YW6jbO7L/pbuilderrc_LmuP --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.YW6jbO7L/b2 --logfile b2/build.log --extrapackages usrmerge ruby-factory-bot_6.2.1-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://78.137.99.97:3128 I: uname -a - Linux ionos5-amd64 6.1.0-0.deb11.6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.15-1~bpo11+1 (2023-03-16) x86_64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-22-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/Linux I: ls -l /bin total 5632 - -rwxr-xr-x 1 root root 1265648 Apr 23 2023 bash - -rwxr-xr-x 3 root root 39224 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 39224 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 39224 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 14568 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 44016 Sep 20 2022 cat - -rwxr-xr-x 1 root root 68656 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 64496 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 72752 Sep 20 2022 chown - -rwxr-xr-x 1 root root 151152 Sep 20 2022 cp - -rwxr-xr-x 1 root root 125640 Jan 5 2023 dash - -rwxr-xr-x 1 root root 121904 Sep 20 2022 date - -rwxr-xr-x 1 root root 89240 Sep 20 2022 dd - -rwxr-xr-x 1 root root 102200 Sep 20 2022 df - -rwxr-xr-x 1 root root 151344 Sep 20 2022 dir - -rwxr-xr-x 1 root root 88656 Mar 22 2023 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 2022 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 2022 domainname -> hostname - -rwxr-xr-x 1 root root 43856 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 2023 egrep - -rwxr-xr-x 1 root root 35664 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 2023 fgrep - -rwxr-xr-x 1 root root 85600 Mar 22 2023 findmnt - -rwsr-xr-x 1 root root 35128 Mar 22 2023 fusermount - -rwxr-xr-x 1 root root 203152 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 98136 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 22680 Dec 19 2022 hostname - -rwxr-xr-x 1 root root 72824 Sep 20 2022 ln - -rwxr-xr-x 1 root root 53024 Mar 23 2023 login - -rwxr-xr-x 1 root root 151344 Sep 20 2022 ls - -rwxr-xr-x 1 root root 207168 Mar 22 2023 lsblk - -rwxr-xr-x 1 root root 97552 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 72912 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 43952 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 59712 Mar 22 2023 more - -rwsr-xr-x 1 root root 59704 Mar 22 2023 mount - -rwxr-xr-x 1 root root 18744 Mar 22 2023 mountpoint - -rwxr-xr-x 1 root root 142968 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 2022 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 2023 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 43952 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 2023 rbash -> bash - -rwxr-xr-x 1 root root 52112 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 72752 Sep 20 2022 rm - -rwxr-xr-x 1 root root 56240 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 27560 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 126424 Jan 5 2023 sed - lrwxrwxrwx 1 root root 4 Jan 5 2023 sh -> dash - -rwxr-xr-x 1 root root 43888 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 85008 Sep 20 2022 stty - -rwsr-xr-x 1 root root 72000 Mar 22 2023 su - -rwxr-xr-x 1 root root 39824 Sep 20 2022 sync - -rwxr-xr-x 1 root root 531984 Apr 6 2023 tar - -rwxr-xr-x 1 root root 14520 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 109616 Sep 20 2022 touch - -rwxr-xr-x 1 root root 35664 Sep 20 2022 true - -rwxr-xr-x 1 root root 14568 Mar 22 2023 ulockmgr_server - -rwsr-xr-x 1 root root 35128 Mar 22 2023 umount - -rwxr-xr-x 1 root root 43888 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 151344 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 72024 Mar 22 2023 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 2022 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 6460 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 8103 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/975654/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1265648 Apr 24 11:23 bash + -rwxr-xr-x 3 root root 39224 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 39224 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 39224 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 14568 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 44016 Sep 21 2022 cat + -rwxr-xr-x 1 root root 68656 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 64496 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 72752 Sep 21 2022 chown + -rwxr-xr-x 1 root root 151152 Sep 21 2022 cp + -rwxr-xr-x 1 root root 125640 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 121904 Sep 21 2022 date + -rwxr-xr-x 1 root root 89240 Sep 21 2022 dd + -rwxr-xr-x 1 root root 102200 Sep 21 2022 df + -rwxr-xr-x 1 root root 151344 Sep 21 2022 dir + -rwxr-xr-x 1 root root 88656 Mar 24 00:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 43856 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 35664 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 85600 Mar 24 00:02 findmnt + -rwsr-xr-x 1 root root 35128 Mar 23 22:35 fusermount + -rwxr-xr-x 1 root root 203152 Jan 25 04:43 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 98136 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 22680 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 72824 Sep 21 2022 ln + -rwxr-xr-x 1 root root 53024 Mar 24 02:40 login + -rwxr-xr-x 1 root root 151344 Sep 21 2022 ls + -rwxr-xr-x 1 root root 207168 Mar 24 00:02 lsblk + -rwxr-xr-x 1 root root 97552 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 72912 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 43952 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 59712 Mar 24 00:02 more + -rwsr-xr-x 1 root root 59704 Mar 24 00:02 mount + -rwxr-xr-x 1 root root 18744 Mar 24 00:02 mountpoint + -rwxr-xr-x 1 root root 142968 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 43952 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:23 rbash -> bash + -rwxr-xr-x 1 root root 52112 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 72752 Sep 21 2022 rm + -rwxr-xr-x 1 root root 56240 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 27560 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 126424 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 May 5 17:31 sh -> /bin/bash + -rwxr-xr-x 1 root root 43888 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 85008 Sep 21 2022 stty + -rwsr-xr-x 1 root root 72000 Mar 24 00:02 su + -rwxr-xr-x 1 root root 39824 Sep 21 2022 sync + -rwxr-xr-x 1 root root 531984 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 14520 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 109616 Sep 21 2022 touch + -rwxr-xr-x 1 root root 35664 Sep 21 2022 true + -rwxr-xr-x 1 root root 14568 Mar 23 22:35 ulockmgr_server + -rwsr-xr-x 1 root root 35128 Mar 24 00:02 umount + -rwxr-xr-x 1 root root 43888 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 151344 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 72024 Mar 24 00:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 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 6460 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 8103 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/1594645/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -350,7 +382,7 @@ Get: 139 http://deb.debian.org/debian bookworm/main amd64 ruby-rspec-its all 1.3.0-1 [6864 B] Get: 140 http://deb.debian.org/debian bookworm/main amd64 ruby-sqlite3 amd64 1.4.2-4+b3 [43.2 kB] Get: 141 http://deb.debian.org/debian bookworm/main amd64 ruby-timecop all 0.9.6-1 [10.3 kB] -Fetched 47.7 MB in 1s (71.8 MB/s) +Fetched 47.7 MB in 2s (29.0 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:amd64. (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 ... 19596 files and directories currently installed.) @@ -937,8 +969,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/ruby-factory-bot-6.2.1/ && 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-factory-bot_6.2.1-1_source.changes +I: user script /srv/workspace/pbuilder/1594645/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/1594645/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/ruby-factory-bot-6.2.1/ && 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-factory-bot_6.2.1-1_source.changes dpkg-buildpackage: info: source package ruby-factory-bot dpkg-buildpackage: info: source version 6.2.1-1 dpkg-buildpackage: info: source distribution unstable @@ -967,7 +1010,7 @@ dh_prep -O--buildsystem=ruby dh_auto_install --destdir=debian/ruby-factory-bot/ -O--buildsystem=ruby dh_ruby --install /build/ruby-factory-bot-6.2.1/debian/ruby-factory-bot -/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20240605-982418-uxh6km/gemspec +/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20230505-1619657-67wfqk/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash WARNING: open-ended dependency on activesupport (>= 5.0.0) is not recommended if activesupport is semantically versioned, use: @@ -997,7 +1040,7 @@ Name: factory_bot Version: 6.2.1 File: factory_bot-6.2.1.gem -/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-factory-bot/usr/share/rubygems-integration/all /tmp/d20240605-982418-uxh6km/factory_bot-6.2.1.gem +/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-factory-bot/usr/share/rubygems-integration/all /tmp/d20230505-1619657-67wfqk/factory_bot-6.2.1.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/ruby-factory-bot-6.2.1/debian/ruby-factory-bot/usr/share/rubygems-integration/all/gems/factory_bot-6.2.1/lib/factory_bot.rb /build/ruby-factory-bot-6.2.1/debian/ruby-factory-bot/usr/share/rubygems-integration/all/gems/factory_bot-6.2.1/lib/factory_bot/aliases.rb @@ -1082,387 +1125,451 @@ mv Gemfile.lock ./.gem2deb.Gemfile.lock /usr/bin/ruby3.1 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.12.0/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.12.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.12.0/exe/rspec --pattern spec/\{\*_spec.rb,factory_bot/\*\*/\*_spec.rb\} --format documentation -Randomized with seed 15395 - -FactoryBot::Attribute::Association - is expected to be association - builds the association when calling the proc - builds the association when calling the proc - name - is expected to eq :author - -FactoryBot::EvaluatorClassDefiner - adds each attribute to the evaluator - sets attributes on the evaluator class - returns an evaluator when accessing the evaluator class - only instance_execs the block once even when returning nil - evaluates the block in the context of the evaluator - with a custom evaluator as a parent class - bases its attribute lists on itself and its parent evaluator - -FactoryBot::Factory when defined with a custom class name - has a build_class equal to its custom class name - -FactoryBot::Attribute::Dynamic - name - is expected to eq :first_name - with a block returning a static value - returns the value when executing the proc - with a block returning a sequence - raises a sequence abuse error - with a block returning its block-level variable - returns self when executing the proc - with a block referencing an attribute on the attribute - evaluates the attribute from the attribute - -FactoryBot::DefinitionProxy#sequence - creates a new sequence with a block - creates a new sequence with an overridden starting vaue - creates a new sequence starting at 1 +Randomized with seed 43281 -FactoryBot::DefinitionProxy#trait - declares a trait +FactoryBot::Factory with a string for a name + has a name FactoryBot::Internal .trait_by_name finds a previously registered trait - .strategy_by_name - finds a registered strategy + .register_trait + returns the registered trait + registers the provided trait + .factory_by_name + finds a registered factory + .rewind_sequences + rewinds the sequences and the internal sequences .register_factory returns the registered factory registers the provided factory + .sequence_by_name + finds a registered sequence .register_factory - returns the registered factory registers the provided factory - .rewind_sequences - rewinds the sequences and the internal sequences + returns the registered factory + .strategy_by_name + finds a registered strategy + .factory_by_name + finds a registered factory .register_sequence returns the registered sequence registers the provided sequence - .register_trait - returns the registered trait - registers the provided trait - .sequence_by_name - finds a registered sequence - .factory_by_name - finds a registered factory - .factory_by_name - finds a registered factory .register_strategy register the provided strategy name with the class +FactoryBot::AttributeList#define_attribute + returns the attribute + maintains a list of attributes + raises if an attribute has already been defined + +FactoryBot::DefinitionProxy#sequence + creates a new sequence starting at 1 + creates a new sequence with a block + creates a new sequence with an overridden starting vaue + +FactoryBot after defining an alias + the list of aliases should include a variant with no suffix at all, and one with an '_id' suffix + FactoryBot::DefinitionProxy#transient makes all attributes added ignored +FactoryBot::Strategy::Build + it should behave like strategy with association support + runs the factory with the correct overrides + finds the factory with the correct factory name + it should behave like strategy with strategy: :build + finds the factory with the correct factory name + runs the factory with the correct overrides + it should behave like strategy with callbacks + runs the callbacks [:after_build] with the evaluation's object + returns the object from the evaluation + FactoryBot::DefinitionProxy#association when passing a block raises an error declares an association declares an association with options -FactoryBot::DefinitionProxy#to_create - accepts a block to run in place of #save! +FactoryBot::Factory running a factory + creates the right strategy using the build class when running + calls the block and returns the result + returns the result from the strategy when running + +FactoryBot::Factory when given a class that overrides #to_s + sets build_class correctly + +FactoryBot::Strategy::Create + runs a custom create block + it should behave like strategy with association support + finds the factory with the correct factory name + runs the factory with the correct overrides + it should behave like strategy with callbacks + runs the callbacks [:after_build, :before_create, :after_create] with the evaluation's object + returns the object from the evaluation + +FactoryBot::Attribute::Association with a string name + name + is expected to eq :name FactoryBot::Attribute::Sequence assigns the next value in the sequence name is expected to eq :first_name +FactoryBot::DeclarationList#attributes + returns an AttributeList + defines each attribute on the attribute list + +FactoryBot + finds a registered strategy + .use_parent_strategy + is true by default + +FactoryBot::AttributeList filter based on ignored attributes + filters #non_ignored attributes + filters #ignored attributes + FactoryBot::NullObject responds to the given methods does not respond to other methods -FactoryBot::Factory - has a factory name +FactoryBot::AttributeList#associations returns associations + +FactoryBot::Factory guesses the build class from the factory name - has a build class + has a factory name includes associations from the parent factory - creates a new factory while overriding the parent class creates a new factory using the class of the parent + returns associations + creates a new factory while overriding the parent class + has a build class when overriding generated attributes with a hash overrides a symbol parameter with a string parameter returns the overridden value in the generated attributes overriding an attribute with an alias - discards the predefined value for the attribute uses the passed in value for the alias + discards the predefined value for the attribute -FactoryBot::Strategy::AttributesFor - returns the hash from the evaluation - does not run the to_create block - it should behave like strategy without association support - returns nil when accessing an association - -FactoryBot::Factory running a factory - returns the result from the strategy when running - calls the block and returns the result - creates the right strategy using the build class when running - -FactoryBot::Decorator::AttributeHash - #attributes - returns a hash of attributes - with an attribute called 'attributes' - does not call itself recursively - -FactoryBot::Factory when given a class that overrides #to_s - sets build_class correctly - -FactoryBot::Callback - runs its block with one parameter - converts strings to symbols - has a name - runs its block with no parameters - runs its block with two parameters - -FactoryBot - finds a registered strategy - .use_parent_strategy - is true by default - -FactoryBot::Factory when defined with a class instead of a name - has a name - has a build_class - -FactoryBot::Attribute - converts the name attribute to a symbol - is not an association - -FactoryBot::DefinitionProxy#method_missing - raises a NoMethodError when called with a static-attribute-like argument (PENDING: No reason given) - declares an implicit declaration when called without args or a block - declares a dynamic attribute when called with a block - declares an association when called with a ':factory' key - -FactoryBot::AttributeList filter based on ignored attributes - filters #non_ignored attributes - filters #ignored attributes - -FactoryBot aliases - for an attribute which starts with an underscore should not include a non-underscored version - for a foreign key should include both the suffixed and un-suffixed variants - for an attribute should include the original attribute and a version suffixed with '_id' - -FactoryBot::Factory human names - parses names with underscores - parses human names with aliases - parses names with aliases - parses human names with underscores - parses names with big letters - parses human names with big letters - parses names without underscores - parses human names without underscores - -FactoryBot::StrategyCalculator - returns the class passed when it is instantiated with a class - finds the strategy by name when instantiated with a symbol - returns the strategy found when instantiated with a symbol - -FactoryBot::DefinitionProxy#initialize_with - defines the constructor on the definition +FactoryBot::DefinitionProxy#factory + without options + with a block + with options FactoryBot::Declaration::Implicit with a known factory has the correct factory name creates an association attribute - with a known sequence - creates a sequence attribute - does not create an assocition attribute #== - when the attributes are equal - the objects are equal + when the names are different + the objects are NOT equal when one is ignored and the other isn't the objects are NOT equal when the factories are different the objects are NOT equal + when the attributes are equal + the objects are equal when comparing against another type of object the objects are NOT equal - when the names are different - the objects are NOT equal - -FactoryBot::DefinitionProxy#add_attribute - declares a dynamic attribute on the factory when the proxy ignores attributes - declares a dynamic attribute on the factory when the proxy respects attributes + with a known sequence + does not create an assocition attribute + creates a sequence attribute -FactoryBot::Decorator::DisallowsDuplicatesRegistry - delegates #register to the registry when not registered - raises when attempting to #register a previously registered strategy +FactoryBot::Attribute::Association + is expected to be association + builds the association when calling the proc + builds the association when calling the proc + name + is expected to eq :author FactoryBot::Factory for namespaced class sets build_class correctly with a namespaced class with Namespace::Class syntax sets build_class correctly with a namespaced class with namespace/class syntax -FactoryBot::AttributeList#associations - returns associations - -FactoryBot::Registry - iterates registered objects - finds a registered object with square brackets - clears registered factories - knows that an object is registered by string - adds and returns the object registered - knows when an object is not registered - knows that an object is registered by symbol - does not include duplicate objects with registered under different names - raises when an object cannot be found - includes a did_you_mean message - is an enumerable - finds a registered object - FactoryBot::Declaration::Association #== - when comparing against another type of object - the objects are NOT equal when the attributes are equal the objects are equal - when the names are different - the objects are NOT equal when the options are different the objects are NOT equal + when comparing against another type of object + the objects are NOT equal + when the names are different + the objects are NOT equal -FactoryBot::DeclarationList#declare_attribute - adds the declaration to the list when overridable - adds the declaration to the list when not overridable - deletes declarations with the same name when overridable - appends declarations with the same name when NOT overridable +FactoryBot::Definition + exposes a non-default create strategy when one is provided by the user + delegates :declare_attribute to declarations + creates a new attribute list with the name passed when given a name + maintains a list of traits + adds only unique traits + has a name + maintains a list of enum fields + doesn't expose a separate create strategy when none is specified + maintains a list of callbacks + has an overridable declaration list + +FactoryBot::AttributeList#define_attribute with a named attribute list + does not raise when the attribute is not a self-referencing association + raises when the attribute is a self-referencing association + +FactoryBot::DefinitionProxy#initialize_with + defines the constructor on the definition + +FactoryBot::AttributeList#apply_attributes + adds attributes in the order defined FactoryBot::Strategy::Stub + it should behave like strategy with association support + finds the factory with the correct factory name + runs the factory with the correct overrides asking for a result - assigns created_at - is expected to be persisted is expected not to be new record is expected not to be destroyed - overriding persistence method: #update_attributes + is expected to be persisted + assigns created_at + overriding persistence method: #update! raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #connection - raises an informative error if the method is called + overriding persistence method: #delete overrides the method with any arity - overriding persistence method: #update + raises an informative error if the method is called + overriding persistence method: #reload raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #update_columns + overriding persistence method: #update_column + overrides the method with any arity + raises an informative error if the method is called + overriding persistence method: #update_attributes raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #destroy! + overriding persistence method: #update_columns raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #delete + overriding persistence method: #connection raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #toggle! + overriding persistence method: #increment! overrides the method with any arity raises an informative error if the method is called - overriding persistence method: #touch - overrides the method with any arity + overriding persistence method: #update_attributes! raises an informative error if the method is called - overriding persistence method: #save! + overrides the method with any arity + overriding persistence method: #decrement! overrides the method with any arity raises an informative error if the method is called - overriding persistence method: #destroy + overriding persistence method: #destroy! overrides the method with any arity raises an informative error if the method is called - overriding persistence method: #update_attributes! + overriding persistence method: #save! raises an informative error if the method is called overrides the method with any arity overriding persistence method: #save overrides the method with any arity raises an informative error if the method is called - overriding persistence method: #decrement! + overriding persistence method: #touch + overrides the method with any arity raises an informative error if the method is called + overriding persistence method: #destroy overrides the method with any arity - overriding persistence method: #update! + raises an informative error if the method is called + overriding persistence method: #update overrides the method with any arity raises an informative error if the method is called overriding persistence method: #update_attribute overrides the method with any arity raises an informative error if the method is called - overriding persistence method: #increment! - raises an informative error if the method is called - overrides the method with any arity - overriding persistence method: #reload + overriding persistence method: #toggle! raises an informative error if the method is called overrides the method with any arity - overriding persistence method: #update_column - overrides the method with any arity - raises an informative error if the method is called + it should behave like strategy with strategy: :build + runs the factory with the correct overrides + finds the factory with the correct factory name it should behave like strategy with callbacks runs the callbacks [:after_stub] with the evaluation's object returns the object from the evaluation - it should behave like strategy with association support - finds the factory with the correct factory name - runs the factory with the correct overrides - it should behave like strategy with strategy: :build - finds the factory with the correct factory name - runs the factory with the correct overrides + +FactoryBot::DefinitionProxy#to_create + accepts a block to run in place of #save! + +FactoryBot::Factory when defined with a custom class + is an instance of that custom class + +FactoryBot::DefinitionProxy adding callbacks + adding both an :after_stub and an :after_create callback succeeds + adding both a :before_stub and a :before_create callback succeeds + adding an :after_stub callback succeeds + adding an :after_create callback succeeds + adding both an :after_stub and a :before_create callback succeeds + adding an :after_build callback succeeds + +FactoryBot::Decorator::DisallowsDuplicatesRegistry + delegates #register to the registry when not registered + raises when attempting to #register a previously registered strategy + +FactoryBot::DeclarationList#declare_attribute + adds the declaration to the list when overridable + deletes declarations with the same name when overridable + appends declarations with the same name when NOT overridable + adds the declaration to the list when not overridable + +FactoryBot::Attribute::Dynamic with a string name + name + is expected to eq :name + +FactoryBot::Attribute + is not an association + converts the name attribute to a symbol + +FactoryBot::StrategyCalculator + returns the class passed when it is instantiated with a class + finds the strategy by name when instantiated with a symbol + returns the strategy found when instantiated with a symbol + +FactoryBot::Attribute::Dynamic + with a block returning a static value + returns the value when executing the proc + name + is expected to eq :first_name + with a block referencing an attribute on the attribute + evaluates the attribute from the attribute + with a block returning its block-level variable + returns self when executing the proc + with a block returning a sequence + raises a sequence abuse error + +FactoryBot::Factory with a name ending in s + has a build class + has a name + +FactoryBot::Factory when defined with a custom class name + has a build_class equal to its custom class name + +FactoryBot::Callback + runs its block with no parameters + runs its block with two parameters + converts strings to symbols + has a name + runs its block with one parameter + +FactoryBot::Decorator::AttributeHash + #attributes + returns a hash of attributes + with an attribute called 'attributes' + does not call itself recursively + +FactoryBot::EvaluatorClassDefiner + only instance_execs the block once even when returning nil + sets attributes on the evaluator class + evaluates the block in the context of the evaluator + adds each attribute to the evaluator + returns an evaluator when accessing the evaluator class + with a custom evaluator as a parent class + bases its attribute lists on itself and its parent evaluator + +FactoryBot::Strategy::AttributesFor + returns the hash from the evaluation + does not run the to_create block + it should behave like strategy without association support + returns nil when accessing an association + +FactoryBot::Declaration::Dynamic + #== + when the attributes are equal + the objects are equal + when the blocks are different + the objects are NOT equal + when comparing against another type of object + the objects are NOT equal + when one is ignored and the other isn't + the objects are NOT equal + when the names are different + the objects are NOT equal + +FactoryBot::DefinitionProxy#add_attribute + declares a dynamic attribute on the factory when the proxy respects attributes + declares a dynamic attribute on the factory when the proxy ignores attributes + +FactoryBot::Factory when defined with a class instead of a name + has a build_class + has a name + +FactoryBot::AttributeList generating names + knows all its #names for #non_ignored attributes + knows all its #names for #ignored attributes + knows all its #names + knows all its #names for #associations + +FactoryBot::DefinitionProxy#method_missing + declares an association when called with a ':factory' key + raises a NoMethodError when called with a static-attribute-like argument (PENDING: No reason given) + declares an implicit declaration when called without args or a block + declares a dynamic attribute when called with a block definition loading - with a factories file under test/factories + with deeply nested factory files under test it should behave like finds definitions - is expected to load definitions from test/factories/post_factory.rb - with several factories files under spec/factories + is expected to load definitions from test/factories/subdirectory/person_factory.rb + is expected to load definitions from test/factories/subdirectory/post_factory.rb + with several factories files under test/factories in non-alphabetical order + loads the files in the right order + with a factories file under spec/factories it should behave like finds definitions - is expected to load definitions from spec/factories/person_factory.rb is expected to load definitions from spec/factories/post_factory.rb - with factories.rb - it should behave like finds definitions - is expected to load definitions from factories.rb with a factories file under test it should behave like finds definitions is expected to load definitions from test/factories.rb - with several factories files under test/factories in non-alphabetical order - loads the files in the right order - with several factories files under spec/factories in non-alphabetical order - loads the files in the right order - with deeply nested factory files under spec + with factories.rb it should behave like finds definitions - is expected to load definitions from spec/factories/subdirectory/post_factory.rb - is expected to load definitions from spec/factories/subdirectory/person_factory.rb - with deeply nested factory files under test + is expected to load definitions from factories.rb + with a factories file under test/factories it should behave like finds definitions - is expected to load definitions from test/factories/subdirectory/person_factory.rb - is expected to load definitions from test/factories/subdirectory/post_factory.rb + is expected to load definitions from test/factories/post_factory.rb + with nested and unnested factories files under spec + it should behave like finds definitions + is expected to load definitions from spec/factories/person_factory.rb + is expected to load definitions from spec/factories/post_factory.rb + is expected to load definitions from spec/factories.rb with a factories file under spec it should behave like finds definitions is expected to load definitions from spec/factories.rb - with nested and unnested factories files under spec + with several factories files under spec/factories it should behave like finds definitions is expected to load definitions from spec/factories/post_factory.rb is expected to load definitions from spec/factories/person_factory.rb - is expected to load definitions from spec/factories.rb - with a factories file under spec/factories + with several factories files under spec/factories in non-alphabetical order + loads the files in the right order + with deeply nested factory files under spec it should behave like finds definitions - is expected to load definitions from spec/factories/post_factory.rb + is expected to load definitions from spec/factories/subdirectory/post_factory.rb + is expected to load definitions from spec/factories/subdirectory/person_factory.rb with nested and unnested factories files under test it should behave like finds definitions is expected to load definitions from test/factories.rb - is expected to load definitions from test/factories/post_factory.rb is expected to load definitions from test/factories/person_factory.rb + is expected to load definitions from test/factories/post_factory.rb with several factories files under test/factories it should behave like finds definitions is expected to load definitions from test/factories/person_factory.rb is expected to load definitions from test/factories/post_factory.rb -FactoryBot::AttributeList generating names - knows all its #names for #associations - knows all its #names for #non_ignored attributes - knows all its #names - knows all its #names for #ignored attributes - -FactoryBot::Factory with a string for a name - has a name - -FactoryBot::Attribute::Association with a string name - name - is expected to eq :name - -FactoryBot::Attribute::Dynamic with a string name - name - is expected to eq :name +FactoryBot aliases + for a foreign key should include both the suffixed and un-suffixed variants + for an attribute should include the original attribute and a version suffixed with '_id' + for an attribute which starts with an underscore should not include a non-underscored version FactoryBot::Sequence - a custom scope increments within the correct scope after rewinding a custom sequence and scope increments within the correct scope + a custom scope increments within the correct scope after rewinding a custom sequence and scope increments within the correct scope when incrementing - a custom sequence + iterating over items in an enumerator + navigates to the next items until no items remain + behaves like a sequence + has a next value equal to the 2nd value after being incremented + has a next value equal to its first value + has a next value equal to the 1st value after rewinding + a sequence with custom value and aliases + has the expected names as its names behaves like a sequence has a next value equal to the 2nd value after being incremented has a next value equal to its first value @@ -1470,134 +1577,70 @@ a sequence with aliases using default value has the expected names as its names behaves like a sequence + has a next value equal to the 2nd value after being incremented has a next value equal to the 1st value after rewinding has a next value equal to its first value - has a next value equal to the 2nd value after being incremented a custom sequence without a block behaves like a sequence has a next value equal to the 1st value after rewinding has a next value equal to its first value has a next value equal to the 2nd value after being incremented - iterating over items in an enumerator - navigates to the next items until no items remain + a custom sequence behaves like a sequence - has a next value equal to its first value - has a next value equal to the 2nd value after being incremented has a next value equal to the 1st value after rewinding + has a next value equal to the 2nd value after being incremented + has a next value equal to its first value a basic sequence without a block behaves like a sequence - has a next value equal to its first value has a next value equal to the 2nd value after being incremented + has a next value equal to its first value has a next value equal to the 1st value after rewinding a basic sequence + name + is expected to eq :test names is expected to eq [:test] behaves like a sequence has a next value equal to the 2nd value after being incremented has a next value equal to the 1st value after rewinding has a next value equal to its first value - name - is expected to eq :test - a sequence with custom value and aliases - has the expected names as its names - behaves like a sequence - has a next value equal to the 1st value after rewinding - has a next value equal to the 2nd value after being incremented - has a next value equal to its first value - -FactoryBot::Factory with a name ending in s - has a build class - has a name -FactoryBot after defining an alias - the list of aliases should include a variant with no suffix at all, and one with an '_id' suffix - -FactoryBot::Strategy::Create - runs a custom create block - it should behave like strategy with association support - finds the factory with the correct factory name - runs the factory with the correct overrides - it should behave like strategy with callbacks - returns the object from the evaluation - runs the callbacks [:after_build, :before_create, :after_create] with the evaluation's object +FactoryBot::Registry + adds and returns the object registered + knows that an object is registered by symbol + finds a registered object with square brackets + finds a registered object + does not include duplicate objects with registered under different names + knows that an object is registered by string + clears registered factories + raises when an object cannot be found + is an enumerable + knows when an object is not registered + includes a did_you_mean message + iterates registered objects -FactoryBot::AttributeList#apply_attributes - adds attributes in the order defined +FactoryBot::Factory human names + parses names without underscores + parses human names without underscores + parses human names with underscores + parses names with big letters + parses human names with big letters + parses names with aliases + parses names with underscores + parses human names with aliases FactoryBot::NullFactory + has an instance of FactoryBot::AttributeList for its attributes attribute delegates attributes to its definition + delegates callbacks to its definition + has a nil value for its compile attribute + has a nil value for its class_name attribute has FactoryBot::Evaluator as its evaluator class delegates defined traits to its definition - has a nil value for its compile attribute - has an instance of FactoryBot::AttributeList for its attributes attribute delegates constructor to its definition - delegates callbacks to its definition - has a nil value for its class_name attribute -FactoryBot::Factory when defined with a custom class - is an instance of that custom class - -FactoryBot::DeclarationList#attributes - returns an AttributeList - defines each attribute on the attribute list - -FactoryBot::AttributeList#define_attribute with a named attribute list - raises when the attribute is a self-referencing association - does not raise when the attribute is not a self-referencing association - -FactoryBot::Declaration::Dynamic - #== - when one is ignored and the other isn't - the objects are NOT equal - when the names are different - the objects are NOT equal - when the attributes are equal - the objects are equal - when comparing against another type of object - the objects are NOT equal - when the blocks are different - the objects are NOT equal - -FactoryBot::Definition - has a name - creates a new attribute list with the name passed when given a name - maintains a list of enum fields - delegates :declare_attribute to declarations - has an overridable declaration list - exposes a non-default create strategy when one is provided by the user - adds only unique traits - maintains a list of callbacks - doesn't expose a separate create strategy when none is specified - maintains a list of traits - -FactoryBot::AttributeList#define_attribute - returns the attribute - raises if an attribute has already been defined - maintains a list of attributes - -FactoryBot::Strategy::Build - it should behave like strategy with callbacks - runs the callbacks [:after_build] with the evaluation's object - returns the object from the evaluation - it should behave like strategy with association support - runs the factory with the correct overrides - finds the factory with the correct factory name - it should behave like strategy with strategy: :build - finds the factory with the correct factory name - runs the factory with the correct overrides - -FactoryBot::DefinitionProxy adding callbacks - adding an :after_create callback succeeds - adding an :after_stub callback succeeds - adding both an :after_stub and a :before_create callback succeeds - adding both an :after_stub and an :after_create callback succeeds - adding an :after_build callback succeeds - adding both a :before_stub and a :before_create callback succeeds - -FactoryBot::DefinitionProxy#factory - without options - with a block - with options +FactoryBot::DefinitionProxy#trait + declares a trait Pending: (Failures listed here are expected and do not affect your suite's status) @@ -1605,748 +1648,748 @@ # No reason given # ./spec/factory_bot/definition_proxy_spec.rb:66 -Finished in 0.77262 seconds (files took 0.61348 seconds to load) +Finished in 2.58 seconds (files took 2.04 seconds to load) 290 examples, 0 failures, 1 pending -Randomized with seed 15395 +Randomized with seed 43281 /usr/bin/ruby3.1 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.12.0/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.12.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.12.0/exe/rspec --pattern spec/acceptance/\*\*/\*_spec.rb --format documentation -Randomized with seed 13581 - -`attributes_for` for a class whose constructor has required params - [:name] - is expected to eq "John Doe" - -using ActiveSupport::Instrumentation to track factory interaction - builds the correct payload - tracks proper time of creating the record - -an instance generated by a factory - registers the user factory +Randomized with seed 6401 -including FactoryBot::Syntax::Methods when custom strategies have been declared - allows adding additional strategies +traits with initialize_with + gives base traits normal priority + can apply initialize_with from traits + gives base traits lower priority than overrides + can apply initialize_with from the definition + gives additional traits higher priority than base traits and factory definition + gives additional traits higher priority than initialize_with from the definition -a generated stub instance - allows toggle - disables increment! - disables update_attribute - disables reload - allows decrement - isn't a new record - assigns a default attribute - disables save - disables connection - disables destroy - assigns an overridden attribute - generates unique ids - assigns associations that aren't new records - assigns associations - has an id - isn't changed - disables toggle! - disables decrement! - allows increment +attribute overrides + with an admin posting + secure + is expected to eq false + with no user posting + secure + is expected to be nil + with a non-admin posting + secure + is expected to be nil -associations overriding :strategy - uses the overridden create strategy to create the association +making sure the factory is properly compiled the first time we want to instantiate it + can honor traits on the very first call -callbacks using syntax methods without referencing FactoryBot explicitly - works when the callback has no variables - works when the callback has two variables - works when the callback has one variable +callbacks using Symbol#to_proc + runs the callback correctly -initialize_with has access to all attributes for construction +initialize_with with an 'attributes' attribute assigns attributes correctly -calling `build_stubbed` with a block - returns the stub instance - passes the stub instance - -applying inline traits - applies traits only to the instance generated for that call - -initialize_with for a constructor that requires a block - executes the block correctly - finding factories keyed by class instead of symbol doesn't find the factory -calling methods on the model instance - without the attribute being overridden - returns nil during attributes_for - returns the correct value from the instance - doesn't instantiate a record with attributes_for - with the referenced attribute being overridden - uses the overridden value - uses the overridden value during attributes_for - with the attribute being overridden - uses the overridden value - uses the overridden value during attributes_for +calling `create` with a block + returns the created instance + passes the created instance -defining a child factory before a parent - creates admin factories correctly +assigning overrides that are also private methods on object + y + is expected to eq 12345 + more_format + is expected to eq "format: Great" + some_funky_method + is expected to eq "foobar!" + format + is expected to eq "Great" -an instance generated by a factory that inherits from another factory - the child class redefining parent's attributes - is expected to be a kind of User(id: integer, name: string, admin: boolean, email: string, upper_email: string, login: string) - is expected to be admin - email - is expected to eq "admin@example.com" - login - is expected to eq "admin@example.com" - name - is expected to eq "admin" - upper_email - is expected to eq "ADMIN@EXAMPLE.COM" - the parent class - is expected not to be admin - login - is expected to eq "john@example.com" - name - is expected to eq "John" - email - is expected to eq "john@example.com" +a built instance + is expected to be new record + when the :use_parent_strategy config option is set to true + assigns but does not save associations + when the :use_parent_strategy config option is set to false + assigns and saves associations -multiple creates and transient attributes to dynamically build attribute lists - allows the number of posts to be modified - generates the correct number of posts +an instance generated by a factory named a camel case string + registers the UserModel factory -accessing methods from the instance within a dynamic attribute that is also a private method on object - more_format - is expected to eq "format: This is an awesome format" +looking up traits that don't exist + when a trait includes an invalid default trait + raises a KeyError including the factory name + when passing an invalid override trait + raises a KeyError + when the factory includes an invalid default trait + raises a KeyError including the factory name + maintains 'Did you mean?' suggestions at the end of the error message -initialize_with with a hash argument - builds the object correctly +initialize_with non-ORM-backed objects + generates random data + allows for overrides -a generated attributes hash where order matters - factory without a parent - assigns attributes in the order they're defined without a parent class - factory with a parent - assigns attributes in the order they're defined +build multiple instances + without default attributes + uses the default factory values + builds (but doesn't save) all the posts + length + is expected to eq 20 + with a block + correctly uses the set value + with a block that receives both the object and an index + correctly uses the set value + with default attributes + overrides the default values -initialize_with implicit constructor - instantiates the correct object +associations + when building collection associations + builds the association according to the given strategy + when accidentally using an implicit delcaration as an override + raises an error + when building interrelated associations + assigns the instance passed as an association attribute + connects records with interdependent relationships + when accidentally using an implicit delcaration for the factory + raises an error -an instance generated by a factory named a camel case string - registers the UserModel factory +`attributes_for` for a class whose constructor has required params + [:name] + is expected to eq "John Doe" + +a stubbed instance overriding strategy + acts as if it is saved in the database + assigns associations and acts as if it is saved global callbacks triggers after build callbacks for all factories -a generated attributes hash - assigns a lazy, dependent attribute - doesn't assign associations - assigns an overridden value - assigns a default value - -callbacks - runs child callback after parent callback - runs both the after(:stub) callback on the factory and the inherited after(:stub) callback - runs the after(:build) callback when building - runs both the after(:build) and after(:create) callbacks when creating - runs the after(:stub) callback when stubbing - -attributes defined using Symbol#to_proc - assigns values correctly - assigns overridden value correctly - assigns value with override correctly - -attribute aliases - assigning an association by passing factory - assigns attributes correctly - assigning an association by foreign key - doesn't assign both an association and its foreign key +modifying inherited factories with traits + returns the correct value for overridden attributes from traits + allows modification of attributes created via traits + returns the correct value for overridden attributes from traits defining multiple attributes -assigning overrides that are also private methods on object - more_format - is expected to eq "format: Great" - some_funky_method - is expected to eq "foobar!" - y - is expected to eq 12345 - format - is expected to eq "Great" +transient sequences + increments sequences correctly -traits added via strategy - adding traits in build_list - builds all the records - length - is expected to eq 2 - adding traits in attributes_for - [:name] - is expected to eq "John" - [:admin] - is expected to equal true - adding traits in create - doesn't modify the user factory - admin - is expected to equal true - name - is expected to eq "JOE" - adding traits in create_list - creates all the records - length - is expected to eq 2 - adding traits in build - admin - is expected to equal true - name - is expected to eq "Joe" - adding traits in build_stubbed - name - is expected to eq "Jack" - admin - is expected to equal true +initialize_with with FG attributes that are transient + name + is expected to eq "Handsome Chap from .construct" -calling `attributes_for` with a block - passes the hash of attributes - returns the hash of attributes +skipping the default create + doesn't execute anything when creating the instance sequences are evaluated in the correct context invokes a method with no arguments on the instance - builds a sequence calling sprintf correctly allows direct reference of a method in a sequence + builds a sequence calling sprintf correctly invokes the correct method on the instance -associations - when building interrelated associations - connects records with interdependent relationships - assigns the instance passed as an association attribute - when accidentally using an implicit delcaration as an override - raises an error - when accidentally using an implicit delcaration for the factory - raises an error - when building collection associations - builds the association according to the given strategy - -calling `build` with a block - passes the built instance - returns the built instance +#add_attribute + assigns attributes for reserved words on .build + assigns attributes for reserved words on .attributes_for binding a callback to multiple callbacks + binds the callback to creation does not bind the callback to building binds the callback to stubbing - binds the callback to creation -create multiple instances - without default attributes - uses the default factory values - creates all the posts - length - is expected to eq 2 - -global skip_create - does not persist any record - does not persist child records - honors inline trait to_create - honors overridden to_create +initialize_with parent and child factories + uses the parent's constructor when the child factory doesn't assign it + allows child factories to override initialize_with -a stubbed instance with no primary key - builds a stubbed instance - behaves like a persisted record +including FactoryBot::Syntax::Methods when custom strategies have been declared + allows adding additional strategies -build multiple instances - with a block that receives both the object and an index - correctly uses the set value - with default attributes - overrides the default values - with a block - correctly uses the set value - without default attributes - builds (but doesn't save) all the posts - uses the default factory values - length - is expected to eq 20 +attribute aliases + assigning an association by passing factory + assigns attributes correctly + assigning an association by foreign key + doesn't assign both an association and its foreign key -traits with callbacks - executes callbacks in the order assigned - when the factory has a trait passed via arguments - name - is expected to eq "JOHN" - when the factory has an implicit trait - name - is expected to eq "JOHN" +multiple creates and transient attributes to dynamically build attribute lists + allows the number of posts to be modified + generates the correct number of posts -initialize_with with FG attributes that are transient - name - is expected to eq "Handsome Chap from .construct" +a generated attributes hash where order matters + factory without a parent + assigns attributes in the order they're defined without a parent class + factory with a parent + assigns attributes in the order they're defined -modifying inherited factories with traits - returns the correct value for overridden attributes from traits - allows modification of attributes created via traits - returns the correct value for overridden attributes from traits defining multiple attributes +initialize_with has access to all attributes for construction + assigns attributes correctly -a built instance +a built instance with strategy: :create + assigns and saves associations is expected to be new record - when the :use_parent_strategy config option is set to false - assigns and saves associations - when the :use_parent_strategy config option is set to true - assigns but does not save associations - -assigning values from a transient attribute - does not ignore an _id attribute that is an alias for a transient attribute -declaring attributes on a Factory that are private methods on Object - link - is expected to eq "http://example.com" - sleep - is expected to eq -5 - system - is expected to eq false +trait indifferent access + when trait is defined as integer + can be invoked with as integer + can be invoked with a string + when trait is defined as a symbol + can be invoked with a symbol + can be invoked with a string + when trait is defined as struct + can be invoked with a struct + can be invoked with a string + when trait is defined as a string + can be invoked with a string + can be invoked with a symbol -an instance generated by a factory with a custom class name - is expected to be admin - is expected to be a kind of User(id: integer, admin: boolean) +nested factories with different parents + honors :parent over the factory block nesting -defaulting `created_at` - doesn't add created_at to objects who don't have the method - allows overriding created_at for objects with created_at - is doesn't mark the object as changed - behaves the same as a non-stubbed created_at - defaults created_at for objects with created_at - doesn't allow setting created_at on an object that doesn't define it - allows assignment of created_at +using ActiveSupport::Instrumentation to track factory interaction + tracks proper time of creating the record + builds the correct payload -an instance generated by a factory with multiple traits - the child class with one trait - is expected to be admin - gender - is expected to be nil - name - is expected to eq "John" - factory created with alternate syntax for specifying trait - where trait name and attribute are the same - great - is expected to eq "GREAT!!!" - where trait name and attribute are the same and attribute is overridden - great - is expected to eq "SORT OF!!!" - gender - is expected to eq "Male" - the other child class with one trait - is expected not to be admin - name - is expected to eq "Jane" - gender - is expected to eq "Female" - the child with multiple traits - is expected to be admin - name - is expected to eq "Jane" - gender - is expected to eq "Female" - child class with scoped trait and inherited trait - is expected to be admin - gender - is expected to eq "Female" - name - is expected to eq "Judy" - child factory using grandparents' trait - great - is expected to eq "GREAT!!!" - the child with multiple traits who override the same attribute - when the male assigns name after female - is expected to be admin - gender - is expected to eq "Male" - name - is expected to eq "Joe" - when the female assigns name after male - is expected to be admin - gender - is expected to eq "Female" - name - is expected to eq "Jane" - child factory created where trait attributes are inherited - gender - is expected to eq "Male" - date_of_birth - is expected to eq Sat, 01 Jan 2000 - the child with multiple traits and overridden attributes +an instance generated by a factory that inherits from another factory + the child class redefining parent's attributes is expected to be admin + is expected to be a kind of User(id: integer, name: string, admin: boolean, email: string, upper_email: string, login: string) name - is expected to eq "Jill" - gender - is expected to be nil - factory with trait defined multiple times - great - is expected to eq "GREAT!!!" - child factory redefining trait - great - is expected to eq "EVEN GREATER!!!" + is expected to eq "admin" + upper_email + is expected to eq "ADMIN@EXAMPLE.COM" + login + is expected to eq "admin@example.com" + email + is expected to eq "admin@example.com" the parent class is expected not to be admin - gender - is expected to be nil + email + is expected to eq "john@example.com" name is expected to eq "John" - factory using global trait - name - is expected to eq "Bill" - email - is expected to eq "Bill@example.com" + login + is expected to eq "john@example.com" -trait indifferent access - when trait is defined as a string - can be invoked with a symbol - can be invoked with a string - when trait is defined as struct - can be invoked with a struct - can be invoked with a string - when trait is defined as integer - can be invoked with as integer - can be invoked with a string - when trait is defined as a symbol - can be invoked with a symbol - can be invoked with a string +callbacks using syntax methods without referencing FactoryBot explicitly + works when the callback has no variables + works when the callback has one variable + works when the callback has two variables -global to_create - handles inline trait override - handles base to_create - handles child to_create with trait - handles child to_create - uses to_create globally across FactoryBot.define +custom callbacks + runs a custom before callback when the proper strategy executes + runs a custom callback without prepending before or after when the proper strategy executes + runs a custom after callback when the proper strategy executes register custom strategies - allows using the *_list method to build a list using a custom strategy allows adding additional strategies - allows using the *_pair method to build a list using a custom strategy + allows using the *_list method to build a list using a custom strategy allows overriding default strategies - -reload - does not reset the value of use_parent_strategy - -defaulting `updated_at` - doesn't add updated_at to objects who don't have the method - is doesn't mark the object as changed - behaves the same as a non-stubbed updated_at - allows overriding updated_at for objects with updated_at - doesn't allow setting updated_at on an object that doesn't define it - defaults updated_at for objects with updated_at - allows assignment of updated_at - -#add_attribute - assigns attributes for reserved words on .build - assigns attributes for reserved words on .attributes_for - -setting private attributes - raises a NoMethodError - -initialize_with with non-FG attributes - age - is expected to eq 21 - name - is expected to eq "John Doe" + allows using the *_pair method to build a list using a custom strategy a custom create uses the custom create block instead of save -defaulting `id` - allows overriding id - -defining methods inside FactoryBot - raises with a meaningful message - -attribute overrides - with no user posting - secure - is expected to be nil - with a non-admin posting - secure - is expected to be nil - with an admin posting - secure - is expected to eq false - -FactoryBot.lint - raises when a factory is invalid - does not raise when all factories are valid - allows for selective linting - factory strategy for linting - uses the requested strategy during trait validation - uses the requested strategy - trait validation - enabled - does not raise if a trait produces a valid object - raises if a trait produces an invalid object - disabled - does not raises if a trait produces an invalid object - verbose linting - prints the backtrace for each factory error - -enum traits - when automatically_define_enum_traits is false - raises an error for undefined traits - builds traits for each enumerated value when traits_for_enum are specified - when automatically_define_enum_traits is true - builds traits automatically for model enum field - builds traits for each enumerated value using a custom enumerable - builds traits for each enumerated value using a provided list of values as a Hash - builds traits for each enumerated value using a provided list of values as an Array - prefers user defined traits over automatically built traits +calling methods on the model instance + without the attribute being overridden + returns the correct value from the instance + doesn't instantiate a record with attributes_for + returns nil during attributes_for + with the attribute being overridden + uses the overridden value + uses the overridden value during attributes_for + with the referenced attribute being overridden + uses the overridden value during attributes_for + uses the overridden value -syntax methods within dynamic attributes - allows syntax methods to be used when the block has an arity of 1 - can access syntax methods from dynamic attributes - can access methods already existing on the class - can access syntax methods from dynamic attributes +associations without overriding :strategy + when the :use_parent_strategy config option is set to true + uses the parent strategy on the association + when the :use_parent_strategy config option is set to false + uses the overridden strategy on the association -custom callbacks - runs a custom after callback when the proper strategy executes - runs a custom callback without prepending before or after when the proper strategy executes - runs a custom before callback when the proper strategy executes +declaring attributes on a Factory that are private methods on Object + link + is expected to eq "http://example.com" + system + is expected to eq false + sleep + is expected to eq -5 -global initialize_with - handles inline trait override - handles child initialize_with with trait - handles base initialize_with - uses initialize_with globally across FactoryBot.define - handles child initialize_with +calling `build_stubbed` with a block + returns the stub instance + passes the stub instance -looking up traits that don't exist - when passing an invalid override trait - raises a KeyError - when the factory includes an invalid default trait - maintains 'Did you mean?' suggestions at the end of the error message - raises a KeyError including the factory name - when a trait includes an invalid default trait - raises a KeyError including the factory name +reload + does not reset the value of use_parent_strategy -a stubbed instance overriding strategy - acts as if it is saved in the database - assigns associations and acts as if it is saved +inline traits overriding existing attributes + prefers overridden attributes over attributes from traits, inline traits, or attributes on factories + prefers inline trait attributes over traits on a factory + prefers traits on a factory over default attributes + prefers inline traits over attributes on factories + prefers attributes on factories over attributes from non-inline traits + prefers inline trait attributes over default attributes + returns the default status -skipping the default create - doesn't execute anything when creating the instance +defaulting `id` + allows overriding id modifying factories + allows for overriding child classes raises an exception if the factory was not defined before doesn't overwrite already defined child's attributes - allows for overriding child classes + reusing traits + email + is expected to eq "Johnny Rockstar!!!@example.com" + login + is expected to eq "JOHNNY ROCKSTAR!!!" + name + is expected to eq "Johnny Rockstar!!!" simple modification doesn't allow the factory to be subsequently defined does allow the factory to be subsequently modified - login - is expected to eq "GREAT USER" name is expected to eq "Great User" - reusing traits login - is expected to eq "JOHNNY ROCKSTAR!!!" - email - is expected to eq "Johnny Rockstar!!!@example.com" + is expected to eq "GREAT USER" + adding callbacks + login + is expected to be nil name - is expected to eq "Johnny Rockstar!!!" + is expected to eq "great user" redefining attributes - creating admin - without overrides - name - is expected to eq "Great User" - email - is expected to eq "Great User-modified@example.com" - admin - is expected to equal true + creating user overriding the name email is expected to eq "wonderful-modified@example.com" - admin - is expected to equal true name is expected to eq "wonderful" - overriding the email - admin - is expected to equal true + without overrides + email + is expected to eq "Great User-modified@example.com" name is expected to eq "Great User" + overriding the email email is expected to eq "perfect@example.com" - creating user + name + is expected to eq "Great User" + creating admin overriding the email email is expected to eq "perfect@example.com" name is expected to eq "Great User" + admin + is expected to equal true without overrides - name - is expected to eq "Great User" + admin + is expected to equal true email is expected to eq "Great User-modified@example.com" + name + is expected to eq "Great User" overriding the name email is expected to eq "wonderful-modified@example.com" name is expected to eq "wonderful" - adding callbacks - login - is expected to be nil - name - is expected to eq "great user" + admin + is expected to equal true -inline traits overriding existing attributes - prefers traits on a factory over default attributes - prefers overridden attributes over attributes from traits, inline traits, or attributes on factories - prefers inline traits over attributes on factories - prefers inline trait attributes over traits on a factory - prefers attributes on factories over attributes from non-inline traits - returns the default status - prefers inline trait attributes over default attributes +global skip_create + honors overridden to_create + honors inline trait to_create + does not persist child records + does not persist any record -traits with to_create - can apply to_create from the definition - gives additional traits higher priority than base traits and factory definition - gives base traits normal priority - gives base traits lower priority than overrides - can apply to_create from traits - gives additional traits higher priority than to_create from the definition +defaulting `created_at` + allows overriding created_at for objects with created_at + doesn't allow setting created_at on an object that doesn't define it + allows assignment of created_at + is doesn't mark the object as changed + behaves the same as a non-stubbed created_at + doesn't add created_at to objects who don't have the method + defaults created_at for objects with created_at -making sure the factory is properly compiled the first time we want to instantiate it - can honor traits on the very first call +initialize_with with a hash argument + builds the object correctly -transient attributes - without transient variables assigned - uses the default value of the attribute - returning attributes for a factory - is expected to have key :email - is expected not to have key :upcased - is expected not to have key :rockstar - is expected to have key :name - is expected not to have key :four - with a transient variable assigned - generates the correct attributes on a rockstar with a name - generates the correct attributes on a rockstar - generates the correct attributes on a groupie - generates the correct attributes on an upcased rockstar +global to_create + handles base to_create + handles inline trait override + uses to_create globally across FactoryBot.define + handles child to_create with trait + handles child to_create -aliases and overrides - two - is expected to be nil - one - is expected to eq "override" +sequences + generates few values of the sequence + generates aliases for the sequence that reference the same block + generates aliases for the sequence that reference the same block and retains value + generates several values in the correct format + generates sequential numbers if no block is given + +FactoryBot.rewind_sequences + allows setting sequences within identically named traits + still allows global sequences prefixed with a factory name + resets inline sequences back to their starting value + does not collide with globally registered factories + resets all sequences back to their starting values + +setting private attributes + raises a NoMethodError + +assigning values from a transient attribute + does not ignore an _id attribute that is an alias for a transient attribute + +defaulting `updated_at` + behaves the same as a non-stubbed updated_at + doesn't add updated_at to objects who don't have the method + doesn't allow setting updated_at on an object that doesn't define it + is doesn't mark the object as changed + allows overriding updated_at for objects with updated_at + allows assignment of updated_at + defaults updated_at for objects with updated_at + +FactoryBot.lint + raises when a factory is invalid + does not raise when all factories are valid + allows for selective linting + verbose linting + prints the backtrace for each factory error + factory strategy for linting + uses the requested strategy during trait validation + uses the requested strategy + trait validation + disabled + does not raises if a trait produces an invalid object + enabled + raises if a trait produces an invalid object + does not raise if a trait produces a valid object + +defining methods inside FactoryBot + raises with a meaningful message + +an instance generated by a factory with a custom class name + is expected to be a kind of User(id: integer, admin: boolean) + is expected to be admin + +configuring the starting id + defines which id build_stubbed instances start with + +accessing methods from the instance within a dynamic attribute that is also a private method on object + more_format + is expected to eq "format: This is an awesome format" traits and dynamic attributes that are applied simultaneously + email + is expected to eq "John@example.com" combined is expected to eq "John " name is expected to eq "John" - email - is expected to eq "John@example.com" -nested factories with different parents - honors :parent over the factory block nesting +global initialize_with + uses initialize_with globally across FactoryBot.define + handles inline trait override + handles child initialize_with with trait + handles base initialize_with + handles child initialize_with + +defining a child factory before a parent + creates admin factories correctly + +enum traits + when automatically_define_enum_traits is true + builds traits automatically for model enum field + prefers user defined traits over automatically built traits + builds traits for each enumerated value using a provided list of values as a Hash + builds traits for each enumerated value using a provided list of values as an Array + builds traits for each enumerated value using a custom enumerable + when automatically_define_enum_traits is false + builds traits for each enumerated value when traits_for_enum are specified + raises an error for undefined traits create multiple instances - with a block - uses the new values without default attributes - uses the default factory values creates all the posts + uses the default factory values length is expected to eq 20 + with a block + uses the new values with default attributes overrides the default values - without the count - raise ArgumentError with the proper error message with a block that receives both the object and an index uses the new values + without the count + raise ArgumentError with the proper error message -a stubbed instance - acts as if it came from the database - assigns associations and acts as if it is saved +when a self-referential trait is defined + raises a TraitDefinitionError + raises a TraitDefinitionError + +syntax methods within dynamic attributes + can access methods already existing on the class + allows syntax methods to be used when the block has an arity of 1 + can access syntax methods from dynamic attributes + can access syntax methods from dynamic attributes + +transient attributes + returning attributes for a factory + is expected not to have key :upcased + is expected to have key :email + is expected not to have key :rockstar + is expected not to have key :four + is expected to have key :name + with a transient variable assigned + generates the correct attributes on a rockstar with a name + generates the correct attributes on a rockstar + generates the correct attributes on a groupie + generates the correct attributes on an upcased rockstar + without transient variables assigned + uses the default value of the attribute a custom create passing in an evaluator passes the evaluator to the custom create block -transient sequences - increments sequences correctly +initialize_with for a constructor that requires a block + executes the block correctly -associations without overriding :strategy - when the :use_parent_strategy config option is set to true - uses the parent strategy on the association - when the :use_parent_strategy config option is set to false - uses the overridden strategy on the association +a created instance + is expected not to be new record + assigns and saves associations -configuring the starting id - defines which id build_stubbed instances start with +an instance generated by a factory with multiple traits + factory using global trait + email + is expected to eq "Bill@example.com" + name + is expected to eq "Bill" + child class with scoped trait and inherited trait + is expected to be admin + name + is expected to eq "Judy" + gender + is expected to eq "Female" + the other child class with one trait + is expected not to be admin + name + is expected to eq "Jane" + gender + is expected to eq "Female" + the child with multiple traits and overridden attributes + is expected to be admin + name + is expected to eq "Jill" + gender + is expected to be nil + factory with trait defined multiple times + child factory redefining trait + great + is expected to eq "EVEN GREATER!!!" + great + is expected to eq "GREAT!!!" + the child with multiple traits who override the same attribute + when the male assigns name after female + is expected to be admin + gender + is expected to eq "Male" + name + is expected to eq "Joe" + when the female assigns name after male + is expected to be admin + name + is expected to eq "Jane" + gender + is expected to eq "Female" + child factory using grandparents' trait + great + is expected to eq "GREAT!!!" + child factory created where trait attributes are inherited + date_of_birth + is expected to eq Sat, 01 Jan 2000 + gender + is expected to eq "Male" + the parent class + is expected not to be admin + name + is expected to eq "John" + gender + is expected to be nil + factory created with alternate syntax for specifying trait + gender + is expected to eq "Male" + where trait name and attribute are the same and attribute is overridden + great + is expected to eq "SORT OF!!!" + where trait name and attribute are the same + great + is expected to eq "GREAT!!!" + the child class with one trait + is expected to be admin + name + is expected to eq "John" + gender + is expected to be nil + the child with multiple traits + is expected to be admin + name + is expected to eq "Jane" + gender + is expected to eq "Female" + +applying inline traits + applies traits only to the instance generated for that call + +a stubbed instance with no primary key + builds a stubbed instance + behaves like a persisted record + +initialize_with implicit constructor + instantiates the correct object + +initialize_with doesn't duplicate assignment on attributes accessed from initialize_with + instantiates the correct object + +initialize_with with non-FG attributes + name + is expected to eq "John Doe" + age + is expected to eq 21 + +traits added via strategy + adding traits in build + admin + is expected to equal true + name + is expected to eq "Joe" + adding traits in build_stubbed + admin + is expected to equal true + name + is expected to eq "Jack" + adding traits in create + doesn't modify the user factory + admin + is expected to equal true + name + is expected to eq "JOE" + adding traits in create_list + creates all the records + length + is expected to eq 2 + adding traits in attributes_for + [:name] + is expected to eq "John" + [:admin] + is expected to equal true + adding traits in build_list + builds all the records + length + is expected to eq 2 + +traits with callbacks + executes callbacks in the order assigned + when the factory has an implicit trait + name + is expected to eq "JOHN" + when the factory has a trait passed via arguments + name + is expected to eq "JOHN" + +a stubbed instance + assigns associations and acts as if it is saved + acts as if it came from the database implicit traits containing callbacks only runs the callback once -traits with initialize_with - gives additional traits higher priority than base traits and factory definition - gives base traits normal priority - can apply initialize_with from the definition - gives base traits lower priority than overrides - can apply initialize_with from traits - gives additional traits higher priority than initialize_with from the definition +attributes defined using Symbol#to_proc + assigns overridden value correctly + assigns values correctly + assigns value with override correctly -a built instance with strategy: :create - is expected to be new record - assigns and saves associations +associations overriding :strategy + uses the overridden create strategy to create the association -initialize_with with an 'attributes' attribute - assigns attributes correctly +a generated attributes hash + doesn't assign associations + assigns a default value + assigns an overridden value + assigns a lazy, dependent attribute -sequences - generates aliases for the sequence that reference the same block - generates aliases for the sequence that reference the same block and retains value - generates few values of the sequence - generates several values in the correct format - generates sequential numbers if no block is given +create multiple instances + without default attributes + creates all the posts + uses the default factory values + length + is expected to eq 2 -calling `create` with a block - returns the created instance - passes the created instance +traits used in associations + allows inline traits with a specific factory for an association + allows assigning traits for the factory of an association + allows inline traits with the default association -FactoryBot.rewind_sequences - allows setting sequences within identically named traits - resets inline sequences back to their starting value - does not collide with globally registered factories - still allows global sequences prefixed with a factory name - resets all sequences back to their starting values +association assignment from nested attributes + assigns the correct amount of comments + assigns the correct amount of comments when overridden -a created instance - assigns and saves associations - is expected not to be new record +calling `attributes_for` with a block + returns the hash of attributes + passes the hash of attributes -initialize_with parent and child factories - allows child factories to override initialize_with - uses the parent's constructor when the child factory doesn't assign it +aliases and overrides + two + is expected to be nil + one + is expected to eq "override" -callbacks using Symbol#to_proc - runs the callback correctly +calling `build` with a block + returns the built instance + passes the built instance -nested implicit traits - defined outside the factory - it should behave like assigning data from traits - assigns the correct values - defined inside the factory - it should behave like assigning data from traits - assigns the correct values +an instance generated by a factory + registers the user factory a created instance, specifying strategy: :build saves associations (strategy: :build only affects build, not create) -initialize_with non-ORM-backed objects - generates random data - allows for overrides - -initialize_with doesn't duplicate assignment on attributes accessed from initialize_with - instantiates the correct object +callbacks + runs child callback after parent callback + runs both the after(:stub) callback on the factory and the inherited after(:stub) callback + runs the after(:build) callback when building + runs both the after(:build) and after(:create) callbacks when creating + runs the after(:stub) callback when stubbing -association assignment from nested attributes - assigns the correct amount of comments when overridden - assigns the correct amount of comments +a generated stub instance + disables increment! + assigns an overridden attribute + assigns associations + disables update_attribute + disables destroy + disables connection + isn't changed + disables reload + disables decrement! + generates unique ids + has an id + allows toggle + disables save + assigns associations that aren't new records + allows decrement + isn't a new record + disables toggle! + assigns a default attribute + allows increment -when a self-referential trait is defined - raises a TraitDefinitionError - raises a TraitDefinitionError +traits with to_create + can apply to_create from the definition + can apply to_create from traits + gives base traits normal priority + gives base traits lower priority than overrides + gives additional traits higher priority than base traits and factory definition + gives additional traits higher priority than to_create from the definition -traits used in associations - allows inline traits with a specific factory for an association - allows inline traits with the default association - allows assigning traits for the factory of an association +nested implicit traits + defined outside the factory + it should behave like assigning data from traits + assigns the correct values + defined inside the factory + it should behave like assigning data from traits + assigns the correct values Deprecation Warnings: @@ -2362,10 +2405,10 @@ 2 deprecation warnings total -Finished in 4.24 seconds (files took 0.68276 seconds to load) +Finished in 9.47 seconds (files took 2.15 seconds to load) 362 examples, 0 failures -Randomized with seed 13581 +Randomized with seed 6401 mv ./.gem2deb.Gemfile.lock Gemfile.lock @@ -2401,12 +2444,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/1594645/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/1594645/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/975654 and its subdirectories -I: Current time: Wed Jun 5 21:53:33 -12 2024 -I: pbuilder-time-stamp: 1717667613 +I: removing directory /srv/workspace/pbuilder/1594645 and its subdirectories +I: Current time: Fri May 5 17:33:32 +14 2023 +I: pbuilder-time-stamp: 1683257612