Diff of the two buildlogs: -- --- b1/build.log 2021-05-23 08:17:49.690444766 +0000 +++ b2/build.log 2021-05-23 08:24:09.755596805 +0000 @@ -1,6 +1,8 @@ -I: pbuilder: network access will be disabled during build -I: Current time: Sat Jun 25 02:40:22 -12 2022 -I: pbuilder-time-stamp: 1656168022 +unshare: unshare failed: Cannot allocate memory +W: pbuilder: unshare CLONE_NEWNET not available +I: pbuilder: network access is available during build! +I: Current time: Sun May 23 22:17:53 +14 2021 +I: pbuilder-time-stamp: 1621757873 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bullseye-reproducible-base.tgz] I: copying local configuration @@ -17,8 +19,8 @@ I: copying [./ruby-virtus_1.0.5-3.debian.tar.xz] I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' -gpgv: keyblock resource '/tmp/dpkg-verify-sig.aDlPGUTB/trustedkeys.kbx': General error -gpgv: Signature made Wed Jul 20 17:47:10 2016 -12 +gpgv: keyblock resource '/tmp/dpkg-verify-sig.iuCX4vmd/trustedkeys.kbx': General error +gpgv: Signature made Thu Jul 21 19:47:10 2016 +14 gpgv: using RSA key CE1F9C674512C22A gpgv: Can't check signature: No public key dpkg-source: warning: failed to verify signature on ./ruby-virtus_1.0.5-3.dsc @@ -29,137 +31,171 @@ dpkg-source: info: applying fix-tests.patch I: using fakeroot in build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/40843/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/27914/tmp/hooks/D01_modify_environment starting +debug: Running on ionos2-i386. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +Removing 'diversion of /bin/sh to /bin/sh.distrib by dash' +Adding 'diversion of /bin/sh to /bin/sh.distrib by bash' +Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash' +Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash' +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/27914/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/27914/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=18' - DISTRIBUTION='' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="1" [2]="4" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.1.4(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=10' + DIRSTACK=() + DISTRIBUTION= + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='3cd9fceaf92f4c0dadd2a726183f3aae' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='40843' - PS1='# ' - PS2='> ' + INVOCATION_ID=139698c887dd46709e44917346eabb7e + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=27914 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.G2kg7r951H/pbuilderrc_fCGb --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.G2kg7r951H/b1 --logfile b1/build.log ruby-virtus_1.0.5-3.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://85.184.249.68:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.G2kg7r951H/pbuilderrc_zuCb --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.G2kg7r951H/b2 --logfile b2/build.log --extrapackages usrmerge ruby-virtus_1.0.5-3.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://78.137.99.97:3128 I: uname -a - Linux ionos6-i386 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux + Linux i-capture-the-hostname 4.19.0-16-686-pae #1 SMP Debian 4.19.181-1 (2021-03-19) i686 GNU/Linux I: ls -l /bin - total 5776 - -rwxr-xr-x 1 root root 1367848 Feb 24 2021 bash - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bunzip2 - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bzcat - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Jul 20 2020 bzdiff - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Sep 4 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Jul 20 2020 bzgrep - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bzip2 - -rwxr-xr-x 1 root root 17768 Jul 20 2020 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 20 2020 bzmore - -rwxr-xr-x 1 root root 38824 Sep 22 2020 cat - -rwxr-xr-x 1 root root 71624 Sep 22 2020 chgrp - -rwxr-xr-x 1 root root 67528 Sep 22 2020 chmod - -rwxr-xr-x 1 root root 75752 Sep 22 2020 chown - -rwxr-xr-x 1 root root 157960 Sep 22 2020 cp - -rwxr-xr-x 1 root root 128724 Dec 10 2020 dash - -rwxr-xr-x 1 root root 124904 Sep 22 2020 date - -rwxr-xr-x 1 root root 92172 Sep 22 2020 dd - -rwxr-xr-x 1 root root 100752 Sep 22 2020 df - -rwxr-xr-x 1 root root 153964 Sep 22 2020 dir - -rwxr-xr-x 1 root root 83644 Feb 7 2021 dmesg - lrwxrwxrwx 1 root root 8 Nov 6 2019 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Nov 6 2019 domainname -> hostname - -rwxr-xr-x 1 root root 34664 Sep 22 2020 echo - -rwxr-xr-x 1 root root 28 Nov 9 2020 egrep - -rwxr-xr-x 1 root root 34664 Sep 22 2020 false - -rwxr-xr-x 1 root root 28 Nov 9 2020 fgrep - -rwxr-xr-x 1 root root 71928 Feb 7 2021 findmnt - -rwsr-xr-x 1 root root 30112 Feb 26 2021 fusermount - -rwxr-xr-x 1 root root 210488 Nov 9 2020 grep - -rwxr-xr-x 2 root root 2346 Mar 2 2021 gunzip - -rwxr-xr-x 1 root root 6376 Mar 2 2021 gzexe - -rwxr-xr-x 1 root root 100952 Mar 2 2021 gzip - -rwxr-xr-x 1 root root 21916 Nov 6 2019 hostname - -rwxr-xr-x 1 root root 83980 Sep 22 2020 ln - -rwxr-xr-x 1 root root 55572 Feb 7 2020 login - -rwxr-xr-x 1 root root 153964 Sep 22 2020 ls - -rwxr-xr-x 1 root root 153124 Feb 7 2021 lsblk - -rwxr-xr-x 1 root root 96328 Sep 22 2020 mkdir - -rwxr-xr-x 1 root root 79912 Sep 22 2020 mknod - -rwxr-xr-x 1 root root 47048 Sep 22 2020 mktemp - -rwxr-xr-x 1 root root 58920 Feb 7 2021 more - -rwsr-xr-x 1 root root 50720 Feb 7 2021 mount - -rwxr-xr-x 1 root root 13856 Feb 7 2021 mountpoint - -rwxr-xr-x 1 root root 157996 Sep 22 2020 mv - lrwxrwxrwx 1 root root 8 Nov 6 2019 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 18 2021 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 38824 Sep 22 2020 pwd - lrwxrwxrwx 1 root root 4 Feb 24 2021 rbash -> bash - -rwxr-xr-x 1 root root 46984 Sep 22 2020 readlink - -rwxr-xr-x 1 root root 75720 Sep 22 2020 rm - -rwxr-xr-x 1 root root 46984 Sep 22 2020 rmdir - -rwxr-xr-x 1 root root 22292 Sep 27 2020 run-parts - -rwxr-xr-x 1 root root 125036 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Jun 23 03:46 sh -> dash - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sleep - -rwxr-xr-x 1 root root 83880 Sep 22 2020 stty - -rwsr-xr-x 1 root root 79396 Feb 7 2021 su - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sync - -rwxr-xr-x 1 root root 602584 Feb 16 2021 tar - -rwxr-xr-x 1 root root 13860 Sep 27 2020 tempfile - -rwxr-xr-x 1 root root 108520 Sep 22 2020 touch - -rwxr-xr-x 1 root root 34664 Sep 22 2020 true - -rwxr-xr-x 1 root root 17768 Feb 26 2021 ulockmgr_server - -rwsr-xr-x 1 root root 30236 Feb 7 2021 umount - -rwxr-xr-x 1 root root 34664 Sep 22 2020 uname - -rwxr-xr-x 2 root root 2346 Mar 2 2021 uncompress - -rwxr-xr-x 1 root root 153964 Sep 22 2020 vdir - -rwxr-xr-x 1 root root 63024 Feb 7 2021 wdctl - lrwxrwxrwx 1 root root 8 Nov 6 2019 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Mar 2 2021 zcat - -rwxr-xr-x 1 root root 1678 Mar 2 2021 zcmp - -rwxr-xr-x 1 root root 5880 Mar 2 2021 zdiff - -rwxr-xr-x 1 root root 29 Mar 2 2021 zegrep - -rwxr-xr-x 1 root root 29 Mar 2 2021 zfgrep - -rwxr-xr-x 1 root root 2081 Mar 2 2021 zforce - -rwxr-xr-x 1 root root 7585 Mar 2 2021 zgrep - -rwxr-xr-x 1 root root 2206 Mar 2 2021 zless - -rwxr-xr-x 1 root root 1842 Mar 2 2021 zmore - -rwxr-xr-x 1 root root 4553 Mar 2 2021 znew -I: user script /srv/workspace/pbuilder/40843/tmp/hooks/D02_print_environment finished + total 5820 + -rwxr-xr-x 1 root root 1367848 Feb 25 10:57 bash + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bunzip2 + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bzcat + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Jul 21 2020 bzdiff + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Sep 5 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Jul 21 2020 bzgrep + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bzip2 + -rwxr-xr-x 1 root root 17768 Jul 21 2020 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 21 2020 bzmore + -rwxr-xr-x 1 root root 38824 Sep 23 2020 cat + -rwxr-xr-x 1 root root 71624 Sep 23 2020 chgrp + -rwxr-xr-x 1 root root 67528 Sep 23 2020 chmod + -rwxr-xr-x 1 root root 75752 Sep 23 2020 chown + -rwxr-xr-x 1 root root 157960 Sep 23 2020 cp + -rwxr-xr-x 1 root root 128724 Dec 11 03:23 dash + -rwxr-xr-x 1 root root 124904 Sep 23 2020 date + -rwxr-xr-x 1 root root 92172 Sep 23 2020 dd + -rwxr-xr-x 1 root root 100752 Sep 23 2020 df + -rwxr-xr-x 1 root root 153964 Sep 23 2020 dir + -rwxr-xr-x 1 root root 83644 Feb 8 04:38 dmesg + lrwxrwxrwx 1 root root 8 Nov 8 2019 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Nov 8 2019 domainname -> hostname + -rwxr-xr-x 1 root root 34664 Sep 23 2020 echo + -rwxr-xr-x 1 root root 28 Nov 10 2020 egrep + -rwxr-xr-x 1 root root 34664 Sep 23 2020 false + -rwxr-xr-x 1 root root 28 Nov 10 2020 fgrep + -rwxr-xr-x 1 root root 71928 Feb 8 04:38 findmnt + -rwsr-xr-x 1 root root 30112 Feb 27 06:12 fusermount + -rwxr-xr-x 1 root root 210488 Nov 10 2020 grep + -rwxr-xr-x 2 root root 2346 Mar 3 13:30 gunzip + -rwxr-xr-x 1 root root 6376 Mar 3 13:30 gzexe + -rwxr-xr-x 1 root root 100952 Mar 3 13:30 gzip + -rwxr-xr-x 1 root root 21916 Nov 8 2019 hostname + -rwxr-xr-x 1 root root 83980 Sep 23 2020 ln + -rwxr-xr-x 1 root root 55572 Feb 8 2020 login + -rwxr-xr-x 1 root root 153964 Sep 23 2020 ls + -rwxr-xr-x 1 root root 153124 Feb 8 04:38 lsblk + -rwxr-xr-x 1 root root 96328 Sep 23 2020 mkdir + -rwxr-xr-x 1 root root 79912 Sep 23 2020 mknod + -rwxr-xr-x 1 root root 47048 Sep 23 2020 mktemp + -rwxr-xr-x 1 root root 58920 Feb 8 04:38 more + -rwsr-xr-x 1 root root 50720 Feb 8 04:38 mount + -rwxr-xr-x 1 root root 13856 Feb 8 04:38 mountpoint + -rwxr-xr-x 1 root root 157996 Sep 23 2020 mv + lrwxrwxrwx 1 root root 8 Nov 8 2019 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 19 05:38 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 38824 Sep 23 2020 pwd + lrwxrwxrwx 1 root root 4 Feb 25 10:57 rbash -> bash + -rwxr-xr-x 1 root root 46984 Sep 23 2020 readlink + -rwxr-xr-x 1 root root 75720 Sep 23 2020 rm + -rwxr-xr-x 1 root root 46984 Sep 23 2020 rmdir + -rwxr-xr-x 1 root root 22292 Sep 28 2020 run-parts + -rwxr-xr-x 1 root root 125036 Dec 23 2018 sed + lrwxrwxrwx 1 root root 4 May 23 22:21 sh -> bash + lrwxrwxrwx 1 root root 4 May 22 04:22 sh.distrib -> dash + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sleep + -rwxr-xr-x 1 root root 83880 Sep 23 2020 stty + -rwsr-xr-x 1 root root 79396 Feb 8 04:38 su + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sync + -rwxr-xr-x 1 root root 602584 Feb 17 23:55 tar + -rwxr-xr-x 1 root root 13860 Sep 28 2020 tempfile + -rwxr-xr-x 1 root root 108520 Sep 23 2020 touch + -rwxr-xr-x 1 root root 34664 Sep 23 2020 true + -rwxr-xr-x 1 root root 17768 Feb 27 06:12 ulockmgr_server + -rwsr-xr-x 1 root root 30236 Feb 8 04:38 umount + -rwxr-xr-x 1 root root 34664 Sep 23 2020 uname + -rwxr-xr-x 2 root root 2346 Mar 3 13:30 uncompress + -rwxr-xr-x 1 root root 153964 Sep 23 2020 vdir + -rwxr-xr-x 1 root root 63024 Feb 8 04:38 wdctl + lrwxrwxrwx 1 root root 8 Nov 8 2019 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Mar 3 13:30 zcat + -rwxr-xr-x 1 root root 1678 Mar 3 13:30 zcmp + -rwxr-xr-x 1 root root 5880 Mar 3 13:30 zdiff + -rwxr-xr-x 1 root root 29 Mar 3 13:30 zegrep + -rwxr-xr-x 1 root root 29 Mar 3 13:30 zfgrep + -rwxr-xr-x 1 root root 2081 Mar 3 13:30 zforce + -rwxr-xr-x 1 root root 7585 Mar 3 13:30 zgrep + -rwxr-xr-x 1 root root 2206 Mar 3 13:30 zless + -rwxr-xr-x 1 root root 1842 Mar 3 13:30 zmore + -rwxr-xr-x 1 root root 4553 Mar 3 13:30 znew +I: user script /srv/workspace/pbuilder/27914/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -352,7 +388,7 @@ Get: 139 http://deb.debian.org/debian bullseye/main i386 ruby-rspec-expectations all 3.9.0c2e2m1s3-2 [89.9 kB] Get: 140 http://deb.debian.org/debian bullseye/main i386 ruby-rspec-mocks all 3.9.0c2e2m1s3-2 [81.4 kB] Get: 141 http://deb.debian.org/debian bullseye/main i386 ruby-rspec all 3.9.0c2e2m1s3-2 [8348 B] -Fetched 45.0 MB in 1s (83.1 MB/s) +Fetched 45.0 MB in 21s (2116 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package bsdextrautils. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19674 files and directories currently installed.) @@ -944,9 +980,41 @@ Building dependency tree... Reading state information... fakeroot is already the newest version (1.25.3-1.1). -0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +The following additional packages will be installed: + libfile-find-rule-perl libnumber-compare-perl libtext-glob-perl +The following NEW packages will be installed: + libfile-find-rule-perl libnumber-compare-perl libtext-glob-perl usrmerge +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Need to get 59.5 kB of archives. +After this operation, 157 kB of additional disk space will be used. +Get:1 http://deb.debian.org/debian bullseye/main i386 libnumber-compare-perl all 0.03-1.1 [6956 B] +Get:2 http://deb.debian.org/debian bullseye/main i386 libtext-glob-perl all 0.11-1 [8888 B] +Get:3 http://deb.debian.org/debian bullseye/main i386 libfile-find-rule-perl all 0.34-1 [30.6 kB] +Get:4 http://deb.debian.org/debian bullseye/main i386 usrmerge all 25 [13.0 kB] +debconf: delaying package configuration, since apt-utils is not installed +Fetched 59.5 kB in 0s (701 kB/s) +Selecting previously unselected package libnumber-compare-perl. +(Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 27147 files and directories currently installed.) +Preparing to unpack .../libnumber-compare-perl_0.03-1.1_all.deb ... +Unpacking libnumber-compare-perl (0.03-1.1) ... +Selecting previously unselected package libtext-glob-perl. +Preparing to unpack .../libtext-glob-perl_0.11-1_all.deb ... +Unpacking libtext-glob-perl (0.11-1) ... +Selecting previously unselected package libfile-find-rule-perl. +Preparing to unpack .../libfile-find-rule-perl_0.34-1_all.deb ... +Unpacking libfile-find-rule-perl (0.34-1) ... +Selecting previously unselected package usrmerge. +Preparing to unpack .../archives/usrmerge_25_all.deb ... +Unpacking usrmerge (25) ... +Setting up libtext-glob-perl (0.11-1) ... +Setting up libnumber-compare-perl (0.03-1.1) ... +Setting up libfile-find-rule-perl (0.34-1) ... +Setting up usrmerge (25) ... +The system has been successfully converted. +Processing triggers for man-db (2.9.4-2) ... +Not building database; man-db/auto-update is not 'true'. I: Building the package -I: Running cd /build/ruby-virtus-1.0.5/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b +I: Running cd /build/ruby-virtus-1.0.5/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b dpkg-buildpackage: info: source package ruby-virtus dpkg-buildpackage: info: source version 1.0.5-3 dpkg-buildpackage: info: source distribution unstable @@ -992,39 +1060,39 @@ install -d /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/options.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/options.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/type_lookup.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/type_lookup.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/equalizer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/equalizer.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/module_extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/module_extensions.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/configuration.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/configuration.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/const_missing_extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/const_missing_extensions.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/extensions.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute_set.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute_set.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/builder/hook_context.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/builder/hook_context.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/instance_methods.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/instance_methods.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/coercer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/coercer.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_symbol.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_symbol.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_clonable.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_clonable.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_callable.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_callable.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/version.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/version.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/embedded_value.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/embedded_value.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/collection.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/collection.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/boolean.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/boolean.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/lazy_default.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/lazy_default.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/coercible.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/coercible.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/accessor.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/accessor.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/strict.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/strict.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/boolean.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/boolean.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/hash.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/hash.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/nullify_blank.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/nullify_blank.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/embedded_value.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/embedded_value.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/accessor.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/accessor.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/builder.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/builder.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/collection.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/collection.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/version.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/version.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/coercer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/coercer.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/coercible.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/coercible.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/nullify_blank.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/nullify_blank.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_callable.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_callable.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_symbol.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_symbol.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/default_value/from_clonable.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/default_value/from_clonable.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute/coercer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute/coercer.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/extensions.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/instance_methods.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/instance_methods.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/class_methods.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/class_methods.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/equalizer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/equalizer.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/options.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/options.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/support/type_lookup.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/support/type_lookup.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/model.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/model.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/class_inclusions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/class_inclusions.rb -install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/value_object.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/value_object.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/builder/hook_context.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/builder/hook_context.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/configuration.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/configuration.rb install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/builder.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/builder.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/attribute_set.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/attribute_set.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/module_extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/module_extensions.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/value_object.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/value_object.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/coercer.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/coercer.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/class_inclusions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/class_inclusions.rb +install -D -m644 /build/ruby-virtus-1.0.5/lib/virtus/const_missing_extensions.rb /build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby/virtus/const_missing_extensions.rb ┌──────────────────────────────────────────────────────────────────────────────┐ │ Install Rubygems integration metadata │ @@ -1040,335 +1108,318 @@ RUBYLIB=/build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby:. GEM_PATH=/build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/share/rubygems-integration/all:/var/lib/gems/2.7.0:/usr/local/lib/ruby/gems/2.7.0:/usr/lib/ruby/gems/2.7.0:/usr/lib/i386-linux-gnu/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/i386-linux-gnu/rubygems-integration/2.7.0 ruby2.7 -S rake -f debian/ruby-tests.rake /usr/bin/ruby2.7 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.9.3/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.9.2/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.9.2/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 6718 +Randomized with seed 13741 -Virtus::Attribute::Hash.build - when type is Hash[String => Struct.new(:id)] - sets value type - sets key type - is expected to be an instance of Virtus::Attribute::Hash - when type is Hash[String => Integer] - sets value type - sets key type - is expected to be an instance of Virtus::Attribute::Hash - when type is Hash[Virtus::Attribute::Hash => Virtus::Attribute::Boolean] - sets value type - is expected to be an instance of Virtus::Attribute::Hash - sets key type - when type is Hash[Struct.new(:id) => Integer] - is expected to be an instance of Virtus::Attribute::Hash - sets key type - sets value type - when type is Hash[String => Integer, Integer => String] - is expected to raise ArgumentError with "more than one [key => value] pair in `{String=>Integer, :Integer=>:String}`" - when type is Hash - sets default value type - is expected to be an instance of Virtus::Attribute::Hash - sets default key type - when strict mode is used - sets the strict mode for key/value types +Using Struct as an embedded value attribute + initialize a struct object with correct attributes + +Package + #dimensions + is expected to have key :width + is expected to have key :length + is expected to have key :height + should be coerced to [Symbol => Float] format + has 3 keys + #meta_info + is expected to have key "from" + should be coerced to [String => String] format + is expected to have key "to" + has 2 keys + +Virtus::Attribute#get + with :lazy is set to true + sets default only on first access + is expected to eql "Jane Doe" + with :lazy is set to false + is expected to equal "Jane Doe" + +Virtus#attributes= + with an instance + behaves like mass-assignment + allows writing known attributes + skips writing unknown attributes + with a class + raises when attributes is not hash-like object + behaves like mass-assignment + skips writing unknown attributes + allows writing known attributes + +Virtus::Attribute::Boolean#value_coerced? + when input is true + is expected to equal true + when input is false + is expected to equal true + when input is not coerced + is expected to equal false + +mass assignment with accessors + can be set with #attributes= + respects accessor visibility + works uppon instantiation + +Virtus::Attribute#set + is expected to equal "Jane Doe" + with coercion + is expected to change `instance.test` to "Jane Doe" + without coercion + is expected to change `instance.test` to "Jane Doe" + +Virtus::Attribute#set_default_value + with a symbol + when it is not a method name + #test + is expected to eq "hello_world" + when it is a method name + when method is public + #test + is expected to eq "hello world" + when method is private + #test + is expected to eq "hello world" + with a callable + #test + is expected to eq "model-test" + with a non-clonable object + #test + is expected to equal true + #instance_variables + is expected to include :@test + with a nil + #test + is expected to equal nil + #instance_variables + is expected to include :@test + with a clonable + #test + is expected not to equal + #test + is expected to eq [] + +embedded values + #attributes returns instances of the embedded values + allows you to pass a hash for the embedded value + +Virtus#[]= + is expected to change `object.test` from nil to "foo" + +Virtus::AttributeSet#<< + with a new attribute + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + indexes the new attribute under the string version of its #name property + indexes the new attribute under its #name property + adds an attribute + with a duplicate attribute + replaces the original attribute object + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + +Virtus::AttributeSet#[] + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + allows indexed access to attributes by the string representation of their name Virtus::Attribute.build without options - is expected not to be lazy - is expected to be coercible sets up a coercer - is expected to be public writer is expected to be public reader + is expected to be public writer + is expected not to be lazy + is expected to be coercible behaves like a valid attribute instance is expected to be frozen is expected to be an instance of Virtus::Attribute - when type is an axiom type - #type - is expected to equal Axiom::Types::Integer (Integer) + when options specify nullify blank mode + is expected to be nullify blank behaves like a valid attribute instance - is expected to be an instance of Virtus::Attribute is expected to be frozen - when type is a symbol of an existing class constant + is expected to be an instance of Virtus::Attribute + when options specify strict mode + is expected to be strict behaves like a valid attribute instance is expected to be frozen is expected to be an instance of Virtus::Attribute + when name is passed as a string + #name + is expected to equal :something + when type is a string #type - is expected to equal Axiom::Types::String (String) - when options specify lazy accessor - is expected to be lazy + is expected to equal Axiom::Types::Integer (Integer) behaves like a valid attribute instance + is expected to be an instance of Virtus::Attribute is expected to be frozen + when custom attribute class exists for a given primitive + is expected to be an instance of # + #type + is expected to equal Axiom::Types::Object (BasicObject) + when custom collection-like attribute class exists for a given enumerable primitive + is expected to be an instance of # + #type + is expected to be < Axiom::Types::Collection + when type is a range + #type + is expected to equal Axiom::Types::Object (Enumerable) + behaves like a valid attribute instance is expected to be an instance of Virtus::Attribute + is expected to be frozen when options specify writer visibility is expected to be public reader is expected not to be public writer behaves like a valid attribute instance is expected to be an instance of Virtus::Attribute is expected to be frozen - when options specify strict mode - is expected to be strict + when type is an axiom type + #type + is expected to equal Axiom::Types::Integer (Integer) behaves like a valid attribute instance - is expected to be an instance of Virtus::Attribute is expected to be frozen - when options specify reader visibility - is expected to be public writer - is expected not to be public reader - behaves like a valid attribute instance is expected to be an instance of Virtus::Attribute - is expected to be frozen - when custom collection-like attribute class exists for a given enumerable primitive - is expected to be an instance of # + when custom attribute class exists for a given array with member coercion defined + is expected to be an instance of # #type is expected to be < Axiom::Types::Collection - when type is a string + when type is a symbol of an existing class constant #type - is expected to equal Axiom::Types::Integer (Integer) + is expected to equal Axiom::Types::String (String) behaves like a valid attribute instance - is expected to be an instance of Virtus::Attribute is expected to be frozen - when custom attribute class exists for a given array with member coercion defined - is expected to be an instance of # - #type - is expected to be < Axiom::Types::Collection - when options specify nullify blank mode - is expected to be nullify blank + is expected to be an instance of Virtus::Attribute + when options specify reader visibility + is expected to be public writer + is expected not to be public reader behaves like a valid attribute instance is expected to be frozen is expected to be an instance of Virtus::Attribute - when custom attribute class exists for a given primitive - is expected to be an instance of # - #type - is expected to equal Axiom::Types::Object (BasicObject) when coercion is turned off in options is expected not to be coercible behaves like a valid attribute instance is expected to be frozen is expected to be an instance of Virtus::Attribute - when type is a range + when options specify lazy accessor + is expected to be lazy behaves like a valid attribute instance - is expected to be frozen is expected to be an instance of Virtus::Attribute - #type - is expected to equal Axiom::Types::Object (Enumerable) - when name is passed as a string - #name - is expected to equal :something - -I can extend objects - defining attributes on an object - -embedded values - #attributes returns instances of the embedded values - allows you to pass a hash for the embedded value + is expected to be frozen Virtus::Attribute.build - when type is a custom collection instance + when type is Array[Float] sets member type behaves like a valid collection attribute instance is expected to be an instance of Virtus::Attribute::Collection is expected to be frozen - when type is Array[Virtus::Attribute::Boolean] - sets member type + when type is Array[String, Integer] + is expected to raise NotImplementedError with "build SumType from list of types ([String, Integer])" + when type is Array subclass behaves like a valid collection attribute instance - is expected to be an instance of Virtus::Attribute::Collection is expected to be frozen - when type is Set[Float] - sets member type + is expected to be an instance of Virtus::Attribute::Collection + when type is an Enumerable behaves like a valid collection attribute instance is expected to be an instance of Virtus::Attribute::Collection is expected to be frozen when strict mode is used sets strict mode for member type - when type is Array[Float] + when type is Array[Virtus::Attribute::Boolean] sets member type behaves like a valid collection attribute instance + is expected to be frozen is expected to be an instance of Virtus::Attribute::Collection + when type is Set[Float] + sets member type + behaves like a valid collection attribute instance is expected to be frozen + is expected to be an instance of Virtus::Attribute::Collection when type is Set sets default member type behaves like a valid collection attribute instance is expected to be frozen is expected to be an instance of Virtus::Attribute::Collection - when type is Array subclass - behaves like a valid collection attribute instance - is expected to be an instance of Virtus::Attribute::Collection - is expected to be frozen - when type is Array[String, Integer] - is expected to raise NotImplementedError with "build SumType from list of types ([String, Integer])" when type is Array sets default member type behaves like a valid collection attribute instance - is expected to be an instance of Virtus::Attribute::Collection is expected to be frozen - when type is an Enumerable + is expected to be an instance of Virtus::Attribute::Collection + when type is a custom collection instance + sets member type behaves like a valid collection attribute instance is expected to be an instance of Virtus::Attribute::Collection is expected to be frozen +Virtus::Attribute::Hash#coerce + when input is a hash + when key/value types are primitives + uses coercer to coerce key and value + when key type is an array and value type is another hash + coerces keys and values + when key/value types are EVs + coerces keys and values + when input is not coercible to hash + is expected to equal "not really a hash" + when input is coercible to hash + is expected to eq {:hello=>"World"} + +virtus attribute definitions + Boolean attributes have a predicate method + the constructor accepts a hash for mass-assignment + virtus creates accessor methods + inheritance + inherits all the attributes from the base class + lets you add attributes to the base class at runtime + lets you add attributes to the subclass at runtime + with attributes + #to_h returns the object's attributes as a hash + #attributes returns the object's attributes as a hash + #to_hash returns the object's attributes as a hash + I can create a Virtus module - including a custom module with coercion enabled - including a custom module with coercion disabled including a custom module with nullify blank enabled + including a custom module with coercion disabled + including a custom module with coercion enabled including a custom module with strict enabled -overriding virtus behavior - overriding an attribute getter - calls the defined getter - super can be used to access the getter defined by virtus - overriding an attribute setter - super can be used to access the setter defined by virtus - calls the defined setter - -Virtus::Attribute::Boolean#value_coerced? - when input is not coerced - is expected to equal false - when input is true - is expected to equal true - when input is false - is expected to equal true - -Virtus.module - with another module - provides attributes for the model - behaves like an object extended with virtus module - with mass assignment is turned off - skips including mass assignment - behaves like a valid virtus object - reads and writes attribute - with default configuration - sets defaults - behaves like a valid virtus object - reads and writes attribute - with coercion turned off - builds non-coercible attributes - behaves like a valid virtus object - reads and writes attribute - with constructor turned off - skips including constructor - behaves like a valid virtus object - reads and writes attribute - as a peer to another module within a class - provides attributes for the model from both modules - includes the attributes from both modules - with a model instance - provides attributes for the instance - behaves like an object extended with virtus module - with coercion turned off - builds non-coercible attributes - behaves like a valid virtus object - reads and writes attribute - with mass assignment is turned off - skips including mass assignment - behaves like a valid virtus object - reads and writes attribute - with constructor turned off - skips including constructor - behaves like a valid virtus object - reads and writes attribute - with default configuration - sets defaults - behaves like a valid virtus object - reads and writes attribute - with multiple other modules mixed into it - provides attributes for the model from all modules - includes the attributes from all modules - with a class - defaults to Object for attribute type - provides attributes for the model - behaves like an object extended with virtus module - with mass assignment is turned off - skips including mass assignment - behaves like a valid virtus object - reads and writes attribute - with constructor turned off - skips including constructor - behaves like a valid virtus object - reads and writes attribute - with coercion turned off - builds non-coercible attributes - behaves like a valid virtus object - reads and writes attribute - with default configuration - sets defaults - behaves like a valid virtus object - reads and writes attribute - -Virtus::AttributeSet#[] - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - allows indexed access to attributes by the string representation of their name - -custom collection attributes - with an enumerable - behaves like a collection - coerces nil - coerces its members - coerces an empty array - defaults to an empty collection - can be used as Virtus attributes - coerces an array of attribute hashes - with an array subclass - behaves like a collection - coerces its members - can be used as Virtus attributes - coerces an empty array - coerces an array of attribute hashes - defaults to an empty collection - coerces nil - -Virtus::Attribute::Collection custom subclass - when primitive is set on the attribute subclass - #primitive - is expected to equal # - when primitive is not set on the attribute subclass - #primitive - is expected to equal # - -Virtus::Attribute::Boolean#coerce - when strict is turned on - with a coercible input - is expected to equal true - with a non-coercible input - raises coercion error - when strict is turned off - with a truthy value - is expected to equal true - with a falsy value - is expected to equal false - -I can define attributes within a module - including a module with attributes into a class - including a module with attributes into an instance - Virtus::Attribute#defined? when the attribute value has been defined is expected to equal true when the attribute value has not been defined is expected to equal false -Virtus#set_default_attributes! - is expected to equal #<#:0x5712404c @age=30, @name="foo"> - #age - is expected to equal 30 - #name - is expected to eql "foo" - -Using required attributes - raises coercion error when required attribute is nil - does not raise coercion error when not required attribute is nil +Virtus::AttributeSet#merge + with a duplicate attribute + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + replaces the original attribute object + with a new attribute + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + adds an attribute -Virtus#[]= - is expected to change `object.test` from nil to "foo" +Virtus::Attribute::Collection#coerce + when input is an array + when member type is a hash with key/value coercion + coerces members + when member type is an EV + coerces members + when member type is a primitive + uses coercer to coerce members + when input is nil + returns nil -Inheritance - inherits model from the base class - sets correct attributes on the descendant classes +Virtus::AttributeSet#[]= + with a new attribute + adds an attribute + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + allows #[] to access the attribute with a string + allows #reset to track overridden attributes + allows #[] to access the attribute with a symbol + with a duplicate attribute + allows #[] to access the attribute with a symbol + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + replaces the original attribute object + allows #[] to access the attribute with a string + allows #reset to track overridden attributes -Virtus#attributes= - with a class - raises when attributes is not hash-like object - behaves like mass-assignment - allows writing known attributes - skips writing unknown attributes - with an instance - behaves like mass-assignment - allows writing known attributes - skips writing unknown attributes +Virtus::Attribute.coerce + when it is set to false + is expected to equal false + with a value + sets the value and return self + when it is set to true + is expected to equal true Injectible coercer accepts an email hash @@ -1377,68 +1428,86 @@ Virtus#[] is expected to eq "foo" -Virtus::Attribute::EmbeddedValue.build - when type is OpenStruct - is expected to be an instance of Virtus::Attribute::EmbeddedValue - is expected to be frozen - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type is Struct - is expected to be an instance of Virtus::Attribute::EmbeddedValue - is expected to be frozen - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromStruct - when type is a Virtus.model - is expected to be an instance of Virtus::Attribute::EmbeddedValue - is expected to be frozen - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type includes Virtus - is expected to be an instance of Virtus::Attribute::EmbeddedValue - is expected to be frozen - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type is an OpenStruct subclass - is expected to be frozen - is expected to be an instance of Virtus::Attribute::EmbeddedValue - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct +Virtus::ValueObject + initialization + sets the attribute values provided to Class.new + writer visibility + attempts to call attribute writer methods raises NameError + attributes are configured for private writers + writer methods are set to private + #inspect + includes the class name and attribute values + equality + #== + returns false for different objects with different state + returns true for different objects with the same state + #equal? + returns false for different objects with the same state + returns false for different objects with different state + #hash + returns the same value for different objects with the same state + returns different values for different objects with different state + #eql? + returns false for different objects with different state + returns true for different objects with the same state -Virtus::Attribute#required? - when required option is false - is expected to equal false - when required option is true - is expected to equal true +Virtus::Attribute::Hash.build + when type is Hash[String => Integer, Integer => String] + is expected to raise ArgumentError with "more than one [key => value] pair in `{String=>Integer, :Integer=>:String}`" + when type is Hash[Virtus::Attribute::Hash => Virtus::Attribute::Boolean] + is expected to be an instance of Virtus::Attribute::Hash + sets value type + sets key type + when type is Hash[String => Struct.new(:id)] + sets value type + is expected to be an instance of Virtus::Attribute::Hash + sets key type + when type is Hash + sets default value type + is expected to be an instance of Virtus::Attribute::Hash + sets default key type + when type is Hash[String => Integer] + sets key type + is expected to be an instance of Virtus::Attribute::Hash + sets value type + when strict mode is used + sets the strict mode for key/value types + when type is Hash[Struct.new(:id) => Integer] + sets value type + sets key type + is expected to be an instance of Virtus::Attribute::Hash -Virtus::Attribute#coercible? - when :coerce is set to false - is expected to equal false - when :coerce is set to true - is expected to equal true +Defining a ValueObject with a custom constructor + initialize a value object attribute with correct attributes -custom attributes - allows you to define coercion methods - allows you to define custom attributes +Virtus.finalize + sets attributes that don't require finalization + it finalizes member type for a collection attribute + automatically resolves constant when it is already available + it finalizes type for an EV attribute + it finalizes value type for a hash attribute + it finalizes key type for a hash attribute -Virtus::AttributeSet#each - with a block - when the parent has attributes that are duplicates - yields the expected attributes - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - when the parent has no attributes - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - when the parent has attributes that are not duplicates - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - with no block - returns an enumerator when block is not provided - yields the expected attributes +Virtus::Attribute::Collection custom subclass + when primitive is set on the attribute subclass + #primitive + is expected to equal # + when primitive is not set on the attribute subclass + #primitive + is expected to equal # + +Virtus::Attribute#== (defined by including Virtus::Equalizer) + returns false when attributes have different type + returns true when attributes have same type and options + returns false when attributes have different options + +Virtus::Attribute#lazy? + when :lazy is set to false + is expected to equal false + when :lazy is set to true + is expected to equal true Virtus::AttributeSet#reset - when the parent is nil - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - includes changes from the parent when the parent has no attributes is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> #to_set @@ -1447,176 +1516,30 @@ is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> #to_set is expected to eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> + when the parent has changed + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + includes changes from the parent when the parent has attributes that are not duplicates is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> #to_set is expected to eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> - when the parent has changed - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - includes changes from the parent - -Virtus::AttributeSet#define_reader_method - with public visibility - defines public writer - with protected visibility - defines protected writer - with private visibility - defines public writer - -Virtus::Attribute#get - with :lazy is set to false - is expected to equal "Jane Doe" - with :lazy is set to true - sets default only on first access - is expected to eql "Jane Doe" - -Package - #meta_info - has 2 keys - should be coerced to [String => String] format - is expected to have key "to" - is expected to have key "from" - #dimensions - is expected to have key :length - has 3 keys - is expected to have key :height - should be coerced to [Symbol => Float] format - is expected to have key :width - -Virtus::AttributeSet#<< - with a new attribute - indexes the new attribute under its #name property - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - indexes the new attribute under the string version of its #name property - adds an attribute - with a duplicate attribute - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - replaces the original attribute object - -Virtus::Attribute#value_coerced? - when input is coerced - is expected to equal true - when input is not coerced - is expected to equal false - -Virtus.model - when mass-assignment is disabled - with an instance - is expected not to respond to #attributes - is expected not to respond to #attributes= - with a class - is expected not to respond to #attributes - is expected not to respond to #attributes= - with default configuration - with a class - defaults to Object for attribute type - behaves like a model with mass-assignment - accepts attribute hash - with a sub-class - has its own attributes - behaves like a model with constructor - accepts attribute hash - behaves like a model with mass-assignment - accepts attribute hash - behaves like a model with strict mode turned off - has attributes with strict set to false - behaves like a model with constructor - accepts attribute hash - behaves like a model with strict mode turned off - has attributes with strict set to false - with an instance - behaves like a model with strict mode turned off - has attributes with strict set to false - behaves like a model with mass-assignment - accepts attribute hash - when :required is set - with a class - has attributes with :required option inherited from module - with an instance - has attributes with strict set to true - when constructor is disabled - does not accept attribute hash in the constructor - when strict mode is enabled - with a class - has attributes with strict set to true - with an instance - has attributes with strict set to true - -Virtus::AttributeSet#merge - with a duplicate attribute - replaces the original attribute object - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - with a new attribute - adds an attribute + when the parent is nil is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - -Virtus::Attribute#set_default_value - with a callable - #test - is expected to eq "model-test" - with a symbol - when it is a method name - when method is private - #test - is expected to eq "hello world" - when method is public - #test - is expected to eq "hello world" - when it is not a method name - #test - is expected to eq "hello_world" - with a nil - #test - is expected to equal nil - #instance_variables - is expected to include :@test - with a clonable - #test - is expected not to equal - #test - is expected to eq [] - with a non-clonable object - #instance_variables - is expected to include :@test - #test - is expected to equal true - -Virtus::ValueObject - writer visibility - attempts to call attribute writer methods raises NameError - attributes are configured for private writers - writer methods are set to private - equality - #hash - returns the same value for different objects with the same state - returns different values for different objects with different state - #equal? - returns false for different objects with different state - returns false for different objects with the same state - #eql? - returns false for different objects with different state - returns true for different objects with the same state - #== - returns true for different objects with the same state - returns false for different objects with different state - initialization - sets the attribute values provided to Class.new - #inspect - includes the class name and attribute values + includes changes from the parent User - is expected to respond to #addresses= - is expected to respond to #addresses is expected to respond to #phone_numbers= + is expected to respond to #addresses= is expected to respond to #phone_numbers + is expected to respond to #addresses #addresses is expected to be an instance of Address - #postal_code - is expected to eql "21234" #address is expected to eql "1234 Any St." #region is expected to eql "DC" + #postal_code + is expected to eql "21234" #locality is expected to eql "Anytown" #phone_numbers @@ -1629,159 +1552,230 @@ #number is expected to eql "212-555-1212" +Virtus#freeze + does not change dynamic default values + is expected to be frozen + does not change default attributes that have been explicitly set + #age + is expected to equal 30 + #name + is expected to eql "foo" + +Virtus#attributes + with a class + behaves like attribute hash + includes all attributes + with an instance + behaves like attribute hash + includes all attributes + +I can define attributes within a module + including a module with attributes into an instance + including a module with attributes into a class + +Virtus::AttributeSet#define_reader_method + with public visibility + defines public writer + with protected visibility + defines protected writer + with private visibility + defines public writer + +default values + you can reset attribute to its default + you can pass a 'callable-object' to the :default option + you can set defaults for private attributes + without a default the value is nil + can be supplied with the :default option + a Set + without a default the value is an empty Set + an Array + without a default the value is an empty Array + a ValueObject + does not duplicate the ValueObject + a Hash + without a default the value is an empty Hash + +overriding virtus behavior + overriding an attribute setter + calls the defined setter + super can be used to access the setter defined by virtus + overriding an attribute getter + calls the defined getter + super can be used to access the getter defined by virtus + +Virtus::Attribute#value_coerced? + when input is not coerced + is expected to equal false + when input is coerced + is expected to equal true + +custom attributes + allows you to define custom attributes + allows you to define coercion methods + +I can extend objects + defining attributes on an object + Virtus instance level attributes adding an attribute allows setting the attribute value on the instance -Virtus::Attribute#== (defined by including Virtus::Equalizer) - returns false when attributes have different options - returns false when attributes have different type - returns true when attributes have same type and options - -Virtus#attribute - raises error when :name is a reserved name on an instance - returns self - allows :attributes as an attribute name when mass-assignment is not included - raises error when :name is a reserved name on a class - allows specifying attribute without type - with a module - included in the class - adds attributes from the module to a class that includes it - behaves like an object with string attribute - is expected to respond to #test= - is expected to respond to #test - can write and read the attribute - included in the class - behaves like an object with string attribute - is expected to respond to #test - is expected to respond to #test= - can write and read the attribute - using custom module - writes and reads attributes - is expected to respond to #test= - is expected to respond to #test - with an instance - behaves like an object with string attribute - is expected to respond to #test - is expected to respond to #test= - can write and read the attribute - with a class - when type is :Boolean - behaves like a class with boolean attribute - defines reader and writer - defines predicate method - with a subclass - behaves like a class with boolean attribute - gets attributes from the parent class - defines reader and writer - defines predicate method - when type is Decimal - maps type to the corresponding axiom type - when type is Boolean - behaves like a class with boolean attribute - defines reader and writer - defines predicate method - when type is Axiom::Types::Boolean - behaves like a class with boolean attribute - defines predicate method (PENDING: this will be fixed once Attribute::Boolean subclass is gone) - defines reader and writer (PENDING: this will be fixed once Attribute::Boolean subclass is gone) - when type is "Boolean" - behaves like a class with boolean attribute - defines predicate method - defines reader and writer - Virtus::ValueObject + using deprecated inclusion + behaves like a valid value object + defines #inspect + defines #== + allows to construct new values using #with + defines #eql? + defines #hash + sets private writers + disallows cloning + #id + is expected to equal 1 + #name + is expected to eql "Jane Doe" using new values {} block with mass-assignment behaves like a valid value object - defines #hash - defines #eql? - sets private writers - disallows cloning defines #== + sets private writers allows to construct new values using #with + defines #hash + disallows cloning defines #inspect + defines #eql? #id is expected to equal 1 #name is expected to eql "Jane Doe" - behaves like a valid value object with mass-assignment turned on - disallows mass-assignment with a model subclass behaves like a valid value object - defines #== - defines #eql? - disallows cloning - defines valid #== for a subclass defines #hash sets private writers for additional values - sets private writers - allows to construct new values using #with defines #inspect - #id - is expected to equal 1 + allows to construct new values using #with + defines valid #== for a subclass + defines #eql? + sets private writers + disallows cloning + defines #== #email is expected to eql "jane@doe.com" + #id + is expected to equal 1 #name is expected to eql "Jane Doe" + behaves like a valid value object with mass-assignment turned on + disallows mass-assignment without mass-assignment behaves like a valid value object defines #== - defines #inspect sets private writers + defines #inspect + defines #hash allows to construct new values using #with disallows cloning defines #eql? - defines #hash - #name - is expected to eql "Jane Doe" #id is expected to equal 1 - using deprecated inclusion - behaves like a valid value object - defines #inspect - sets private writers - defines #hash - disallows cloning - defines #eql? - defines #== - allows to construct new values using #with - #name - is expected to eql "Jane Doe" - #id - is expected to equal 1 + #name + is expected to eql "Jane Doe" -Virtus#attributes - with a class - behaves like attribute hash - includes all attributes - with an instance - behaves like attribute hash - includes all attributes +Virtus::Attribute::EmbeddedValue.build + when type is Struct + is expected to be frozen + is expected to be an instance of Virtus::Attribute::EmbeddedValue + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromStruct + when type includes Virtus + is expected to be frozen + is expected to be an instance of Virtus::Attribute::EmbeddedValue + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is an OpenStruct subclass + is expected to be frozen + is expected to be an instance of Virtus::Attribute::EmbeddedValue + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is a Virtus.model + is expected to be frozen + is expected to be an instance of Virtus::Attribute::EmbeddedValue + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is OpenStruct + is expected to be an instance of Virtus::Attribute::EmbeddedValue + is expected to be frozen + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct -Virtus::Attribute.coerce - with a value - sets the value and return self - when it is set to true +Virtus#set_default_attributes! + is expected to equal #<#:0x025f9b58 @age=30, @name="foo"> + #name + is expected to eql "foo" + #age + is expected to equal 30 + +custom collection attributes + with an enumerable + behaves like a collection + coerces its members + coerces an empty array + can be used as Virtus attributes + defaults to an empty collection + coerces an array of attribute hashes + coerces nil + with an array subclass + behaves like a collection + can be used as Virtus attributes + coerces nil + defaults to an empty collection + coerces its members + coerces an array of attribute hashes + coerces an empty array + +Virtus.config + provides global configuration + +Virtus::Attribute#rename + is expected not to equal #:public, :strict=>true, :r...Value value=nil>, :coercer=>#}> + is expected to be strict + #name + is expected to equal :bar + +Using required attributes + does not raise coercion error when not required attribute is nil + raises coercion error when required attribute is nil + +Virtus::Attribute#coercible? + when :coerce is set to true is expected to equal true - when it is set to false + when :coerce is set to false is expected to equal false -Virtus::Attribute#set - is expected to equal "Jane Doe" - without coercion - is expected to change `instance.test` to "Jane Doe" - with coercion - is expected to change `instance.test` to "Jane Doe" +Virtus::AttributeSet#each + with a block + when the parent has attributes that are not duplicates + yields the expected attributes + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + when the parent has no attributes + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + yields the expected attributes + when the parent has attributes that are duplicates + yields the expected attributes + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + with no block + yields the expected attributes + returns an enumerator when block is not provided Virtus::Attribute#coerce when strict mode is turned on raises error when input was not coerced uses coercer to coerce the input value - when attribute is required and input is nil - returns raises error when attribute is not required and input is nil returns nil + when attribute is required and input is nil + returns raises error when strict mode is turned off uses coercer to coerce the input value when the input is an empty String @@ -1791,180 +1785,254 @@ when both nullify_blank and strict are turned on does not raises an coercion error -Virtus::Attribute#lazy? - when :lazy is set to false - is expected to equal false - when :lazy is set to true - is expected to equal true - -Virtus.finalize - it finalizes type for an EV attribute - it finalizes value type for a hash attribute - it finalizes member type for a collection attribute - automatically resolves constant when it is already available - sets attributes that don't require finalization - it finalizes key type for a hash attribute - -Virtus::Attribute::Hash#coerce - when input is coercible to hash - is expected to eq {:hello=>"World"} - when input is a hash - when key type is an array and value type is another hash - coerces keys and values - when key/value types are primitives - uses coercer to coerce key and value - when key/value types are EVs - coerces keys and values - when input is not coercible to hash - is expected to equal "not really a hash" - -Defining a ValueObject with a custom constructor - initialize a value object attribute with correct attributes - -mass assignment with accessors - works uppon instantiation - can be set with #attributes= - respects accessor visibility - -Virtus.new - with attribute hash - skips setting attributes with private writers - sets attributes with public writers - without attribute hash - skips setting default values for lazy attributes - sets default values for non-lazy attributes - -Virtus#freeze - does not change dynamic default values - is expected to be frozen - does not change default attributes that have been explicitly set - #name - is expected to eql "foo" - #age - is expected to equal 30 - -Using Struct as an embedded value attribute - initialize a struct object with correct attributes - -default values - can be supplied with the :default option - you can pass a 'callable-object' to the :default option - you can set defaults for private attributes - without a default the value is nil - you can reset attribute to its default - a ValueObject - does not duplicate the ValueObject - a Hash - without a default the value is an empty Hash - an Array - without a default the value is an empty Array - a Set - without a default the value is an empty Set - -Virtus.config - provides global configuration - -Virtus::Attribute::Collection#coerce - when input is an array - when member type is a hash with key/value coercion - coerces members - when member type is an EV - coerces members - when member type is a primitive - uses coercer to coerce members - when input is nil - returns nil - -Virtus::Attribute#rename - is expected to be strict - is expected not to equal #:public, :strict=>true, :r...Value value=nil>, :coercer=>#}> - #name - is expected to equal :bar - Virtus::AttributeSet#define_writer_method with protected visibility defines protected writer - with public visibility - defines public writer with private visibility defines private writer - -virtus attribute definitions - Boolean attributes have a predicate method - the constructor accepts a hash for mass-assignment - virtus creates accessor methods - inheritance - lets you add attributes to the base class at runtime - lets you add attributes to the subclass at runtime - inherits all the attributes from the base class - with attributes - #to_h returns the object's attributes as a hash - #attributes returns the object's attributes as a hash - #to_hash returns the object's attributes as a hash + with public visibility + defines public writer Virtus::Attribute::EmbeddedValue#coerce - when :strict mode is enabled - when input is coercible - is expected to eql # - when input is not coercible - raises error - when primitive is OpenStruct + when primitive is Struct + when input is a model instance + is expected to equal # when input is an attribute hash - is expected to be an instance of OpenStruct - #name - is expected to eql "Piotr" + is expected to be an instance of # #age is expected to eql 30 - when input is a model instance - is expected to equal # + #name + is expected to eql "Piotr" when input is nil is expected to equal nil - when primitive is Struct + when primitive is OpenStruct when input is nil is expected to equal nil when input is a model instance - is expected to equal # + is expected to equal # when input is an attribute hash - is expected to be an instance of # + is expected to be an instance of OpenStruct #age is expected to eql 30 #name is expected to eql "Piotr" + when :strict mode is enabled + when input is coercible + is expected to eql # + when input is not coercible + raises error -Virtus::AttributeSet#[]= - with a duplicate attribute - allows #[] to access the attribute with a string - allows #reset to track overridden attributes - allows #[] to access the attribute with a symbol - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - replaces the original attribute object - with a new attribute - allows #reset to track overridden attributes - adds an attribute - allows #[] to access the attribute with a symbol - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - allows #[] to access the attribute with a string +Virtus::Attribute::Boolean#coerce + when strict is turned on + with a coercible input + is expected to equal true + with a non-coercible input + raises coercion error + when strict is turned off + with a falsy value + is expected to equal false + with a truthy value + is expected to equal true + +Virtus::Attribute#required? + when required option is false + is expected to equal false + when required option is true + is expected to equal true + +Virtus.new + without attribute hash + sets default values for non-lazy attributes + skips setting default values for lazy attributes + with attribute hash + sets attributes with public writers + skips setting attributes with private writers + +Virtus#attribute + raises error when :name is a reserved name on an instance + allows :attributes as an attribute name when mass-assignment is not included + raises error when :name is a reserved name on a class + allows specifying attribute without type + returns self + with an instance + behaves like an object with string attribute + is expected to respond to #test= + is expected to respond to #test + can write and read the attribute + with a class + when type is "Boolean" + behaves like a class with boolean attribute + defines reader and writer + defines predicate method + when type is Axiom::Types::Boolean + behaves like a class with boolean attribute + defines predicate method (PENDING: this will be fixed once Attribute::Boolean subclass is gone) + defines reader and writer (PENDING: this will be fixed once Attribute::Boolean subclass is gone) + when type is Decimal + maps type to the corresponding axiom type + when type is :Boolean + with a subclass + behaves like a class with boolean attribute + defines predicate method + defines reader and writer + gets attributes from the parent class + behaves like a class with boolean attribute + defines reader and writer + defines predicate method + when type is Boolean + behaves like a class with boolean attribute + defines predicate method + defines reader and writer + with a module + included in the class + adds attributes from the module to a class that includes it + behaves like an object with string attribute + is expected to respond to #test + is expected to respond to #test= + can write and read the attribute + included in the class + behaves like an object with string attribute + is expected to respond to #test + is expected to respond to #test= + can write and read the attribute + using custom module + is expected to respond to #test + writes and reads attributes + is expected to respond to #test= + +Virtus.module + with another module + provides attributes for the model + behaves like an object extended with virtus module + with mass assignment is turned off + skips including mass assignment + behaves like a valid virtus object + reads and writes attribute + with constructor turned off + skips including constructor + behaves like a valid virtus object + reads and writes attribute + with default configuration + sets defaults + behaves like a valid virtus object + reads and writes attribute + with coercion turned off + builds non-coercible attributes + behaves like a valid virtus object + reads and writes attribute + with multiple other modules mixed into it + provides attributes for the model from all modules + includes the attributes from all modules + with a class + defaults to Object for attribute type + provides attributes for the model + behaves like an object extended with virtus module + with coercion turned off + builds non-coercible attributes + behaves like a valid virtus object + reads and writes attribute + with constructor turned off + skips including constructor + behaves like a valid virtus object + reads and writes attribute + with mass assignment is turned off + skips including mass assignment + behaves like a valid virtus object + reads and writes attribute + with default configuration + sets defaults + behaves like a valid virtus object + reads and writes attribute + as a peer to another module within a class + provides attributes for the model from both modules + includes the attributes from both modules + with a model instance + provides attributes for the instance + behaves like an object extended with virtus module + with constructor turned off + skips including constructor + behaves like a valid virtus object + reads and writes attribute + with default configuration + sets defaults + behaves like a valid virtus object + reads and writes attribute + with coercion turned off + builds non-coercible attributes + behaves like a valid virtus object + reads and writes attribute + with mass assignment is turned off + skips including mass assignment + behaves like a valid virtus object + reads and writes attribute + +Virtus.model + when strict mode is enabled + with an instance + has attributes with strict set to true + with a class + has attributes with strict set to true + when mass-assignment is disabled + with a class + is expected not to respond to #attributes + is expected not to respond to #attributes= + with an instance + is expected not to respond to #attributes= + is expected not to respond to #attributes + when :required is set + with a class + has attributes with :required option inherited from module + with an instance + has attributes with strict set to true + with default configuration + with an instance + behaves like a model with mass-assignment + accepts attribute hash + behaves like a model with strict mode turned off + has attributes with strict set to false + with a class + defaults to Object for attribute type + behaves like a model with constructor + accepts attribute hash + behaves like a model with strict mode turned off + has attributes with strict set to false + behaves like a model with mass-assignment + accepts attribute hash + with a sub-class + has its own attributes + behaves like a model with strict mode turned off + has attributes with strict set to false + behaves like a model with mass-assignment + accepts attribute hash + behaves like a model with constructor + accepts attribute hash + when constructor is disabled + does not accept attribute hash in the constructor + +Inheritance + inherits model from the base class + sets correct attributes on the descendant classes Pending: (Failures listed here are expected and do not affect your suite's status) 1) Virtus#attribute with a class when type is Axiom::Types::Boolean behaves like a class with boolean attribute defines predicate method # this will be fixed once Attribute::Boolean subclass is gone Failure/Error: expect(object).to_not be_test - expected # to respond to `test?` + expected # to respond to `test?` Shared Example Group: "a class with boolean attribute" called from ./spec/unit/virtus/attribute_spec.rb:112 # ./spec/unit/virtus/attribute_spec.rb:21:in `block (3 levels) in ' 2) Virtus#attribute with a class when type is Axiom::Types::Boolean behaves like a class with boolean attribute defines reader and writer # this will be fixed once Attribute::Boolean subclass is gone Failure/Error: expect(object).to be_test - expected # to respond to `test?` + expected # to respond to `test?` Shared Example Group: "a class with boolean attribute" called from ./spec/unit/virtus/attribute_spec.rb:112 # ./spec/unit/virtus/attribute_spec.rb:15:in `block (3 levels) in ' -Finished in 0.52679 seconds (files took 0.31982 seconds to load) +Finished in 0.76845 seconds (files took 0.83555 seconds to load) 462 examples, 0 failures, 2 pending -Randomized with seed 6718 +Randomized with seed 13741 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -1999,13 +2067,14 @@ dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) -I: copying local configuration +I: user script /srv/workspace/pbuilder/27914/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/27914/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/40843 and its subdirectories -I: Current time: Sat Jun 25 02:40:49 -12 2022 -I: pbuilder-time-stamp: 1656168049 +I: removing directory /srv/workspace/pbuilder/27914 and its subdirectories +I: Current time: Sun May 23 22:24:08 +14 2021 +I: pbuilder-time-stamp: 1621758248