Diff of the two buildlogs: -- --- b1/build.log 2021-04-04 10:27:25.463169070 +0000 +++ b2/build.log 2021-04-04 10:28:05.249611788 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sat Apr 3 22:26:40 -12 2021 -I: pbuilder-time-stamp: 1617532000 +I: Current time: Sun May 8 06:50:34 +14 2022 +I: pbuilder-time-stamp: 1651942234 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/buster-reproducible-base.tgz] I: copying local configuration @@ -17,7 +17,7 @@ I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' gpgv: keyblock resource '/root/.gnupg/trustedkeys.kbx': General error -gpgv: Signature made Wed Jul 20 17:47:10 2016 -12 +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 @@ -28,136 +28,170 @@ dpkg-source: info: applying fix-tests.patch I: using fakeroot in build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/33203/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/36546/tmp/hooks/D01_modify_environment starting +debug: Running on ionos5-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 +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/36546/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/36546/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=15' - DISTRIBUTION='' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="0" [2]="3" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.0.3(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=16' + DIRSTACK=() + DISTRIBUTION= + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='d42f34d025c54dd1bdf088904764ea7a' - 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='33203' - PS1='# ' - PS2='> ' + INVOCATION_ID=40c0b8f7fd6c46dabb298df1d7355d6d + 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=36546 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.8fiN6XT7xR/pbuilderrc_BrrN --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.8fiN6XT7xR/b1 --logfile b1/build.log ruby-virtus_1.0.5-3.dsc' - SUDO_GID='111' - SUDO_UID='106' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://78.137.99.97: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.8fiN6XT7xR/pbuilderrc_4YjH --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.8fiN6XT7xR/b2 --logfile b2/build.log ruby-virtus_1.0.5-3.dsc' + SUDO_GID=110 + SUDO_UID=105 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://85.184.249.68:3128 I: uname -a - Linux ionos11-amd64 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-0.bpo.4-amd64 #1 SMP Debian 5.10.19-1~bpo10+1 (2021-03-13) x86_64 GNU/Linux I: ls -l /bin total 5116 - -rwxr-xr-x 1 root root 1168776 Apr 17 2019 bash - -rwxr-xr-x 3 root root 38984 Jul 10 2019 bunzip2 - -rwxr-xr-x 3 root root 38984 Jul 10 2019 bzcat - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2227 Jul 10 2019 bzdiff - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Jun 24 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3641 Jul 10 2019 bzgrep - -rwxr-xr-x 3 root root 38984 Jul 10 2019 bzip2 - -rwxr-xr-x 1 root root 14328 Jul 10 2019 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 10 2019 bzmore - -rwxr-xr-x 1 root root 43744 Feb 28 2019 cat - -rwxr-xr-x 1 root root 64320 Feb 28 2019 chgrp - -rwxr-xr-x 1 root root 64288 Feb 28 2019 chmod - -rwxr-xr-x 1 root root 72512 Feb 28 2019 chown - -rwxr-xr-x 1 root root 146880 Feb 28 2019 cp - -rwxr-xr-x 1 root root 121464 Jan 17 2019 dash - -rwxr-xr-x 1 root root 109408 Feb 28 2019 date - -rwxr-xr-x 1 root root 76712 Feb 28 2019 dd - -rwxr-xr-x 1 root root 93744 Feb 28 2019 df - -rwxr-xr-x 1 root root 138856 Feb 28 2019 dir - -rwxr-xr-x 1 root root 84288 Jan 9 2019 dmesg - lrwxrwxrwx 1 root root 8 Sep 26 2018 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Sep 26 2018 domainname -> hostname - -rwxr-xr-x 1 root root 39520 Feb 28 2019 echo - -rwxr-xr-x 1 root root 28 Jan 7 2019 egrep - -rwxr-xr-x 1 root root 35424 Feb 28 2019 false - -rwxr-xr-x 1 root root 28 Jan 7 2019 fgrep - -rwxr-xr-x 1 root root 68880 Jan 9 2019 findmnt - -rwsr-xr-x 1 root root 34896 Apr 22 2020 fusermount - -rwxr-xr-x 1 root root 198976 Jan 7 2019 grep - -rwxr-xr-x 2 root root 2345 Jan 5 2019 gunzip - -rwxr-xr-x 1 root root 6375 Jan 5 2019 gzexe - -rwxr-xr-x 1 root root 98048 Jan 5 2019 gzip - -rwxr-xr-x 1 root root 26696 Sep 26 2018 hostname - -rwxr-xr-x 1 root root 68552 Feb 28 2019 ln - -rwxr-xr-x 1 root root 56760 Jul 26 2018 login - -rwxr-xr-x 1 root root 138856 Feb 28 2019 ls - -rwxr-xr-x 1 root root 108624 Jan 9 2019 lsblk - -rwxr-xr-x 1 root root 89088 Feb 28 2019 mkdir - -rwxr-xr-x 1 root root 68544 Feb 28 2019 mknod - -rwxr-xr-x 1 root root 43808 Feb 28 2019 mktemp - -rwxr-xr-x 1 root root 43008 Jan 9 2019 more - -rwsr-xr-x 1 root root 51280 Jan 9 2019 mount - -rwxr-xr-x 1 root root 14408 Jan 9 2019 mountpoint - -rwxr-xr-x 1 root root 138728 Feb 28 2019 mv - lrwxrwxrwx 1 root root 8 Sep 26 2018 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Feb 14 2019 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 39616 Feb 28 2019 pwd - lrwxrwxrwx 1 root root 4 Apr 17 2019 rbash -> bash - -rwxr-xr-x 1 root root 47776 Feb 28 2019 readlink - -rwxr-xr-x 1 root root 68416 Feb 28 2019 rm - -rwxr-xr-x 1 root root 47776 Feb 28 2019 rmdir - -rwxr-xr-x 1 root root 23312 Jan 21 2019 run-parts - -rwxr-xr-x 1 root root 122224 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Mar 20 20:25 sh -> dash - -rwxr-xr-x 1 root root 39552 Feb 28 2019 sleep - -rwxr-xr-x 1 root root 80672 Feb 28 2019 stty - -rwsr-xr-x 1 root root 63568 Jan 9 2019 su - -rwxr-xr-x 1 root root 35488 Feb 28 2019 sync - -rwxr-xr-x 1 root root 445560 Apr 23 2019 tar - -rwxr-xr-x 1 root root 14440 Jan 21 2019 tempfile - -rwxr-xr-x 1 root root 97152 Feb 28 2019 touch - -rwxr-xr-x 1 root root 35424 Feb 28 2019 true - -rwxr-xr-x 1 root root 14328 Apr 22 2020 ulockmgr_server - -rwsr-xr-x 1 root root 34888 Jan 9 2019 umount - -rwxr-xr-x 1 root root 39584 Feb 28 2019 uname - -rwxr-xr-x 2 root root 2345 Jan 5 2019 uncompress - -rwxr-xr-x 1 root root 138856 Feb 28 2019 vdir - -rwxr-xr-x 1 root root 34896 Jan 9 2019 wdctl - -rwxr-xr-x 1 root root 946 Jan 21 2019 which - lrwxrwxrwx 1 root root 8 Sep 26 2018 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1983 Jan 5 2019 zcat - -rwxr-xr-x 1 root root 1677 Jan 5 2019 zcmp - -rwxr-xr-x 1 root root 5879 Jan 5 2019 zdiff - -rwxr-xr-x 1 root root 29 Jan 5 2019 zegrep - -rwxr-xr-x 1 root root 29 Jan 5 2019 zfgrep - -rwxr-xr-x 1 root root 2080 Jan 5 2019 zforce - -rwxr-xr-x 1 root root 7584 Jan 5 2019 zgrep - -rwxr-xr-x 1 root root 2205 Jan 5 2019 zless - -rwxr-xr-x 1 root root 1841 Jan 5 2019 zmore - -rwxr-xr-x 1 root root 4552 Jan 5 2019 znew -I: user script /srv/workspace/pbuilder/33203/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1168776 Apr 18 2019 bash + -rwxr-xr-x 3 root root 38984 Jul 11 2019 bunzip2 + -rwxr-xr-x 3 root root 38984 Jul 11 2019 bzcat + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2227 Jul 11 2019 bzdiff + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Jun 25 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3641 Jul 11 2019 bzgrep + -rwxr-xr-x 3 root root 38984 Jul 11 2019 bzip2 + -rwxr-xr-x 1 root root 14328 Jul 11 2019 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 11 2019 bzmore + -rwxr-xr-x 1 root root 43744 Mar 1 2019 cat + -rwxr-xr-x 1 root root 64320 Mar 1 2019 chgrp + -rwxr-xr-x 1 root root 64288 Mar 1 2019 chmod + -rwxr-xr-x 1 root root 72512 Mar 1 2019 chown + -rwxr-xr-x 1 root root 146880 Mar 1 2019 cp + -rwxr-xr-x 1 root root 121464 Jan 18 2019 dash + -rwxr-xr-x 1 root root 109408 Mar 1 2019 date + -rwxr-xr-x 1 root root 76712 Mar 1 2019 dd + -rwxr-xr-x 1 root root 93744 Mar 1 2019 df + -rwxr-xr-x 1 root root 138856 Mar 1 2019 dir + -rwxr-xr-x 1 root root 84288 Jan 10 2019 dmesg + lrwxrwxrwx 1 root root 8 Sep 27 2018 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Sep 27 2018 domainname -> hostname + -rwxr-xr-x 1 root root 39520 Mar 1 2019 echo + -rwxr-xr-x 1 root root 28 Jan 8 2019 egrep + -rwxr-xr-x 1 root root 35424 Mar 1 2019 false + -rwxr-xr-x 1 root root 28 Jan 8 2019 fgrep + -rwxr-xr-x 1 root root 68880 Jan 10 2019 findmnt + -rwsr-xr-x 1 root root 34896 Apr 23 2020 fusermount + -rwxr-xr-x 1 root root 198976 Jan 8 2019 grep + -rwxr-xr-x 2 root root 2345 Jan 6 2019 gunzip + -rwxr-xr-x 1 root root 6375 Jan 6 2019 gzexe + -rwxr-xr-x 1 root root 98048 Jan 6 2019 gzip + -rwxr-xr-x 1 root root 26696 Sep 27 2018 hostname + -rwxr-xr-x 1 root root 68552 Mar 1 2019 ln + -rwxr-xr-x 1 root root 56760 Jul 27 2018 login + -rwxr-xr-x 1 root root 138856 Mar 1 2019 ls + -rwxr-xr-x 1 root root 108624 Jan 10 2019 lsblk + -rwxr-xr-x 1 root root 89088 Mar 1 2019 mkdir + -rwxr-xr-x 1 root root 68544 Mar 1 2019 mknod + -rwxr-xr-x 1 root root 43808 Mar 1 2019 mktemp + -rwxr-xr-x 1 root root 43008 Jan 10 2019 more + -rwsr-xr-x 1 root root 51280 Jan 10 2019 mount + -rwxr-xr-x 1 root root 14408 Jan 10 2019 mountpoint + -rwxr-xr-x 1 root root 138728 Mar 1 2019 mv + lrwxrwxrwx 1 root root 8 Sep 27 2018 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Feb 15 2019 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 39616 Mar 1 2019 pwd + lrwxrwxrwx 1 root root 4 Apr 18 2019 rbash -> bash + -rwxr-xr-x 1 root root 47776 Mar 1 2019 readlink + -rwxr-xr-x 1 root root 68416 Mar 1 2019 rm + -rwxr-xr-x 1 root root 47776 Mar 1 2019 rmdir + -rwxr-xr-x 1 root root 23312 Jan 22 2019 run-parts + -rwxr-xr-x 1 root root 122224 Dec 23 2018 sed + lrwxrwxrwx 1 root root 4 May 8 06:50 sh -> bash + lrwxrwxrwx 1 root root 4 Apr 24 04:46 sh.distrib -> dash + -rwxr-xr-x 1 root root 39552 Mar 1 2019 sleep + -rwxr-xr-x 1 root root 80672 Mar 1 2019 stty + -rwsr-xr-x 1 root root 63568 Jan 10 2019 su + -rwxr-xr-x 1 root root 35488 Mar 1 2019 sync + -rwxr-xr-x 1 root root 445560 Apr 24 2019 tar + -rwxr-xr-x 1 root root 14440 Jan 22 2019 tempfile + -rwxr-xr-x 1 root root 97152 Mar 1 2019 touch + -rwxr-xr-x 1 root root 35424 Mar 1 2019 true + -rwxr-xr-x 1 root root 14328 Apr 23 2020 ulockmgr_server + -rwsr-xr-x 1 root root 34888 Jan 10 2019 umount + -rwxr-xr-x 1 root root 39584 Mar 1 2019 uname + -rwxr-xr-x 2 root root 2345 Jan 6 2019 uncompress + -rwxr-xr-x 1 root root 138856 Mar 1 2019 vdir + -rwxr-xr-x 1 root root 34896 Jan 10 2019 wdctl + -rwxr-xr-x 1 root root 946 Jan 22 2019 which + lrwxrwxrwx 1 root root 8 Sep 27 2018 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1983 Jan 6 2019 zcat + -rwxr-xr-x 1 root root 1677 Jan 6 2019 zcmp + -rwxr-xr-x 1 root root 5879 Jan 6 2019 zdiff + -rwxr-xr-x 1 root root 29 Jan 6 2019 zegrep + -rwxr-xr-x 1 root root 29 Jan 6 2019 zfgrep + -rwxr-xr-x 1 root root 2080 Jan 6 2019 zforce + -rwxr-xr-x 1 root root 7584 Jan 6 2019 zgrep + -rwxr-xr-x 1 root root 2205 Jan 6 2019 zless + -rwxr-xr-x 1 root root 1841 Jan 6 2019 zmore + -rwxr-xr-x 1 root root 4552 Jan 6 2019 znew +I: user script /srv/workspace/pbuilder/36546/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -354,7 +388,7 @@ Get: 143 http://deb.debian.org/debian buster/main amd64 ruby-thread-order all 1.1.0-1 [5096 B] Get: 144 http://deb.debian.org/debian buster/main amd64 ruby-rspec-core all 3.8.0c0e1m0s0-1 [190 kB] Get: 145 http://deb.debian.org/debian buster/main amd64 ruby-rspec all 3.8.0c0e1m0s0-1 [7620 B] -Fetched 43.2 MB in 1s (44.3 MB/s) +Fetched 43.2 MB in 1s (64.5 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libbsd0: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 ... 19195 files and directories currently installed.) @@ -966,7 +1000,7 @@ fakeroot is already the newest version (1.23-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 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 @@ -1051,541 +1085,742 @@ RUBYLIB=/build/ruby-virtus-1.0.5/debian/ruby-virtus/usr/lib/ruby/vendor_ruby:. GEM_PATH=debian/ruby-virtus/usr/share/rubygems-integration/all:/var/lib/gems/2.5.0:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.5.0:/usr/share/rubygems-integration/2.5.0:/usr/share/rubygems-integration/all ruby2.5 -S rake -f debian/ruby-tests.rake /usr/bin/ruby2.5 /usr/bin/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 40898 +Randomized with seed 12709 -Virtus#attributes - with an instance - behaves like attribute hash - includes all attributes - with a class - 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::Attribute::Boolean#value_coerced? - when input is not coerced +Virtus::ValueObject + #inspect + includes the class name and attribute values + 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 the same state + returns false for different objects with different state + #== + returns true for different objects with the same state + returns false for different objects with different state + #eql? + returns false for different objects with different state + returns true for different objects with the same state + 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 + +User + should respond to #addresses + should respond to #phone_numbers= + should respond to #addresses= + should respond to #phone_numbers + #phone_numbers + first entry + should be an instance of PhoneNumber + #number + should eql "212-555-1212" + last entry + should be an instance of PhoneNumber + #number + should eql "919-444-3265" + #addresses + should be an instance of Address + #address + should eql "1234 Any St." + #region + should eql "DC" + #locality + should eql "Anytown" + #postal_code + should eql "21234" + +Virtus#set_default_attributes! + should equal #<#:0x00005640d19e3578 @age=30, @name="foo"> + #name + should eql "foo" + #age + should equal 30 + +Virtus::AttributeSet#define_writer_method + with private visibility + defines private writer + with protected visibility + defines protected writer + with public visibility + defines public writer + +Virtus#[]= + should change `object.test` from nil to "foo" + +Virtus::Attribute#defined? + when the attribute value has not been defined should equal false - when input is true + when the attribute value has been defined should equal true - when input is false + +Virtus::Attribute.build + when options specify lazy accessor + should be lazy + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when options specify strict mode + should be strict + behaves like a valid attribute instance + should be frozen + should be an instance of Virtus::Attribute + when options specify writer visibility + should not be public writer + should be public reader + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when type is an axiom type + #type + should equal Axiom::Types::Integer (Integer) + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when coercion is turned off in options + should not be coercible + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when type is a string + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + #type + should equal Axiom::Types::Integer (Integer) + when custom collection-like attribute class exists for a given enumerable primitive + should be an instance of # + #type + should be < Axiom::Types::Collection + when options specify nullify blank mode + should be nullify blank + behaves like a valid attribute instance + should be frozen + should be an instance of Virtus::Attribute + when custom attribute class exists for a given array with member coercion defined + should be an instance of # + #type + should be < Axiom::Types::Collection + when name is passed as a string + #name + should equal :something + when custom attribute class exists for a given primitive + should be an instance of # + #type + should equal Axiom::Types::Object (BasicObject) + when type is a range + #type + should equal Axiom::Types::Object (Enumerable) + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when options specify reader visibility + should be public writer + should not be public reader + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + without options + should be public reader + should be coercible + should not be lazy + sets up a coercer + should be public writer + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + when type is a symbol of an existing class constant + behaves like a valid attribute instance + should be an instance of Virtus::Attribute + should be frozen + #type + should equal Axiom::Types::String (String) + +Inheritance +/build/ruby-virtus-1.0.5/spec/integration/inheritance_spec.rb:11: warning: constant ::Fixnum is deprecated + inherits model from the base class +/build/ruby-virtus-1.0.5/spec/integration/inheritance_spec.rb:11: warning: constant ::Fixnum is deprecated + sets correct attributes on the descendant classes + +Virtus::AttributeSet#each + with a block + when the parent has attributes that are not duplicates + yields the expected attributes + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + when the parent has attributes that are duplicates + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + yields the expected attributes + when the parent has no attributes + should equal #: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::AttributeSet#define_reader_method + with protected visibility + defines protected writer + with private visibility + defines public writer + with public visibility + defines public writer + +Virtus::Attribute#set + should equal "Jane Doe" + without coercion + should change `instance.test` to "Jane Doe" + with coercion + should change `instance.test` to "Jane Doe" + +Virtus::Attribute#value_coerced? + when input is coerced should equal true + when input is not coerced + should equal false -Virtus::Attribute::Boolean#coerce - when strict is turned off - with a truthy value - should equal true - with a falsy value - should equal false - when strict is turned on - with a coercible input - should equal true - with a non-coercible input - raises coercion error +I can create a Virtus module + including a custom module with coercion enabled + including a custom module with strict enabled + including a custom module with coercion disabled + including a custom module with nullify blank enabled -custom collection attributes - with an enumerable - behaves like a collection - coerces nil - coerces its members - coerces an array of attribute hashes - defaults to an empty collection - can be used as Virtus attributes - coerces an empty array - with an array subclass - behaves like a collection - coerces an array of attribute hashes - coerces an empty array - defaults to an empty collection - coerces its members - can be used as Virtus attributes - coerces nil +Virtus#attributes= + with an instance + behaves like mass-assignment + skips writing unknown attributes + allows writing known attributes + with a class + raises when attributes is not hash-like object + behaves like mass-assignment + allows writing known attributes + skips writing unknown attributes -Injectible coercer - coerces an embedded string - accepts an email hash +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::Hash.build + when type is Hash[String => Integer] + should be an instance of Virtus::Attribute::Hash + sets key type + sets value type + when type is Hash + sets default value type + sets default key type + should be an instance of Virtus::Attribute::Hash + when type is Hash[Struct.new(:id) => Integer] + sets key type + should 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[String => Struct.new(:id)] + should be an instance of Virtus::Attribute::Hash + sets value type + sets key type + when type is Hash[String => Integer, Integer => String] + should raise ArgumentError with "more than one [key => value] pair in `{String=>Integer, :Integer=>:String}`" + when type is Hash[Virtus::Attribute::Hash => Virtus::Attribute::Boolean] + sets value type + sets key type + should be an instance of Virtus::Attribute::Hash Virtus.model - when strict mode is enabled - with a class - has attributes with strict set to true + when :required is set with an instance has attributes with strict set to true - when mass-assignment is disabled - with an instance - should not respond to #attributes= - should not respond to #attributes with a class - should not respond to #attributes= - should not respond to #attributes + has attributes with :required option inherited from module + when constructor is disabled + does not accept attribute hash in the constructor with default configuration - 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 with a class defaults to Object for attribute type + 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 sub-class has its own attributes - 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 - behaves like a model with mass-assignment - accepts attribute hash + behaves like a model with constructor + accepts attribute hash behaves like a model with constructor accepts attribute hash + with an instance behaves like a model with strict mode turned off has attributes with strict set to false - when constructor is disabled - does not accept attribute hash in the constructor - when :required is set + behaves like a model with mass-assignment + accepts attribute hash + when mass-assignment is disabled with a class - has attributes with :required option inherited from module + should not respond to #attributes= + should not respond to #attributes + with an instance + should not respond to #attributes + should not respond to #attributes= + 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::Attribute#lazy? - when :lazy is set to false +Using required attributes + raises coercion error when required attribute is nil + does not raise coercion error when not required attribute is nil + +Virtus::AttributeSet#<< + with a duplicate attribute + replaces the original attribute object + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + with a new attribute + adds an attribute + indexes the new attribute under the string version of its #name property + indexes the new attribute under its #name property + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + +Virtus::Attribute#required? + when required option is false should equal false - when :lazy is set to true + when required option is true should equal true -Using Struct as an embedded value attribute - initialize a struct object with correct 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::Attribute::Boolean#value_coerced? + when input is not coerced + should equal false + when input is true + should equal true + when input is false + should equal true -Virtus#set_default_attributes! - should equal #<#:0x00005559297e4a50 @age=30, @name="foo"> - #name - should eql "foo" +Virtus#freeze + should be frozen + does not change dynamic default values + does not change default attributes that have been explicitly set #age should equal 30 + #name + should eql "foo" + +Virtus::AttributeSet#reset + when the parent has changed + includes changes from the parent + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + when the parent is nil + includes changes from the parent + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + when the parent has attributes that are not duplicates + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + #to_set + should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> + when the parent has no attributes + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + #to_set + should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> + when the parent has attributes that are duplicates + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + #to_set + should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> + +Virtus#[] + should eq "foo" Virtus#attribute - raises error when :name is a reserved name on a class + returns self allows specifying attribute without type raises error when :name is a reserved name on an instance + raises error when :name is a reserved name on a class allows :attributes as an attribute name when mass-assignment is not included - returns self - with an instance - behaves like an object with string attribute - should respond to #test - should respond to #test= - can write and read the attribute - using custom module - should respond to #test - should respond to #test= - writes and reads attributes with a class + when type is Decimal + maps type to the corresponding axiom type + when type is "Boolean" + behaves like a class with boolean attribute + defines predicate method + defines reader and writer when type is Axiom::Types::Boolean behaves like a class with boolean attribute - defines reader and writer (PENDING: this will be fixed once Attribute::Boolean subclass is gone) 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 reader and writer defines predicate method + defines reader and writer with a subclass behaves like a class with boolean attribute - defines reader and writer 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 "Boolean" - behaves like a class with boolean attribute - defines reader and writer - defines predicate method with a module included in the class behaves like an object with string attribute - can write and read the attribute - should respond to #test= should respond to #test + should respond to #test= + can write and read the attribute included in the class adds attributes from the module to a class that includes it behaves like an object with string attribute - should respond to #test can write and read the attribute + should respond to #test should respond to #test= + with an instance + behaves like an object with string attribute + can write and read the attribute + should respond to #test + should respond to #test= + using custom module + should respond to #test= + should respond to #test + writes and reads attributes -Virtus::Attribute#required? - when required option is true +Package + #meta_info + should have key "to" + should have key "from" + has 2 keys + should be coerced to [String => String] format + #dimensions + should have key :width + should have key :length + should have key :height + has 3 keys + should be coerced to [Symbol => Float] format + +Virtus::Attribute#== (defined by including Virtus::Equalizer) + returns false when attributes have different type + returns false when attributes have different options + returns true when attributes have same type and options + +Virtus#attributes + with a class + behaves like attribute hash + includes all attributes + with an instance + behaves like attribute hash + includes all attributes + +Virtus::Attribute#set_default_value + with a nil + #test + should equal nil + #instance_variables + should include :@test + with a non-clonable object + #test + should equal true + #instance_variables + should include :@test + with a symbol + when it is a method name + when method is private + #test + should eq "hello world" + when method is public + #test + should eq "hello world" + when it is not a method name + #test + should eq "hello_world" + with a clonable + #test + should eq [] + #test + should not equal + with a callable + #test + should eq "model-test" + +default values + you can reset attribute to its default + you can pass a 'callable-object' to the :default option + without a default the value is nil + you can set defaults for private attributes + can be supplied with the :default option + a Set + without a default the value is an empty Set + 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 + +Virtus::Attribute::Collection#coerce + when input is an array + when member type is a primitive + uses coercer to coerce members + when member type is a hash with key/value coercion + coerces members + when member type is an EV + coerces members + when input is nil + returns nil + +Virtus::AttributeSet#[] + allows indexed access to attributes by the string representation of their name + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + +Injectible coercer + accepts an email hash + coerces an embedded string + +Virtus::Attribute#lazy? + when :lazy is set to true should equal true - when required option is false + when :lazy is set to false should equal false -Virtus::AttributeSet#merge - with a new attribute - adds an attribute - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - with a duplicate attribute - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - replaces the original attribute object +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::ValueObject + using deprecated inclusion + behaves like a valid value object + defines #== + sets private writers + defines #inspect + allows to construct new values using #with + defines #eql? + disallows cloning + defines #hash + #id + should equal 1 + #name + should eql "Jane Doe" using new values {} block - without mass-assignment + with mass-assignment behaves like a valid value object - defines #inspect + sets private writers defines #hash - defines #== allows to construct new values using #with - defines #eql? disallows cloning - sets private writers + defines #eql? + defines #== + defines #inspect #name should eql "Jane Doe" #id should equal 1 - with mass-assignment + behaves like a valid value object with mass-assignment turned on + disallows mass-assignment with a model subclass behaves like a valid value object - allows to construct new values using #with - defines valid #== for a subclass - defines #eql? + sets private writers for additional values defines #inspect - defines #hash - disallows cloning sets private writers - sets private writers for additional values defines #== - #id - should equal 1 + allows to construct new values using #with + disallows cloning + defines #hash + defines valid #== for a subclass + defines #eql? #email should eql "jane@doe.com" #name should eql "Jane Doe" + #id + should equal 1 + without mass-assignment behaves like a valid value object + sets private writers defines #eql? + disallows cloning + defines #hash defines #== - sets private writers defines #inspect - disallows cloning allows to construct new values using #with - defines #hash - #name - should eql "Jane Doe" #id should equal 1 - behaves like a valid value object with mass-assignment turned on - disallows mass-assignment - using deprecated inclusion - behaves like a valid value object - defines #== - disallows cloning - defines #inspect - defines #eql? - allows to construct new values using #with - defines #hash - sets private writers - #name - should eql "Jane Doe" - #id - should equal 1 - -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 - sets attributes that don't require finalization - automatically resolves constant when it is already available - it finalizes key type for a hash attribute - -default values - can be supplied with the :default option - you can set defaults for private attributes - you can pass a 'callable-object' to the :default option - you can reset attribute to its default - without a default the value is nil - a Set - without a default the value is an empty Set - an Array - without a default the value is an empty Array - a Hash - without a default the value is an empty Hash - a ValueObject - does not duplicate the ValueObject + #name + should eql "Jane Doe" -overriding virtus behavior - overriding an attribute getter - super can be used to access the getter defined by virtus - calls the defined getter - overriding an attribute setter - calls the defined setter - super can be used to access the setter defined by virtus +Virtus::Attribute::EmbeddedValue.build + when type is Struct + should be frozen + should be an instance of Virtus::Attribute::EmbeddedValue + #coercer + should be an instance of Virtus::Attribute::EmbeddedValue::FromStruct + when type includes Virtus + should be frozen + should be an instance of Virtus::Attribute::EmbeddedValue + #coercer + should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is a Virtus.model + should be an instance of Virtus::Attribute::EmbeddedValue + should be frozen + #coercer + should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is OpenStruct + should be frozen + should be an instance of Virtus::Attribute::EmbeddedValue + #coercer + should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct + when type is an OpenStruct subclass + should be frozen + should be an instance of Virtus::Attribute::EmbeddedValue + #coercer + should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct -Virtus::AttributeSet#define_writer_method - with public visibility - defines public writer - with protected visibility - defines protected writer - with private visibility - defines private writer +mass assignment with accessors + works uppon instantiation + can be set with #attributes= + respects accessor visibility -Inheritance -/build/ruby-virtus-1.0.5/spec/integration/inheritance_spec.rb:11: warning: constant ::Fixnum is deprecated - inherits model from the base class -/build/ruby-virtus-1.0.5/spec/integration/inheritance_spec.rb:11: warning: constant ::Fixnum is deprecated - sets correct attributes on the descendant classes +Virtus.config + provides global configuration -Virtus::Attribute#set - should equal "Jane Doe" - with coercion - should change `instance.test` to "Jane Doe" - without coercion - should change `instance.test` to "Jane Doe" +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 subclass at runtime + inherits all the attributes from the base class + lets you add attributes to the base class at runtime + with attributes + #to_hash returns the object's attributes as a hash + #to_h returns the object's attributes as a hash + #attributes returns the object's attributes as a hash -Virtus::AttributeSet#[] - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - allows indexed access to attributes by the string representation of their name +Using Struct as an embedded value attribute + initialize a struct object with correct attributes -Virtus::Attribute::Collection custom subclass - when primitive is not set on the attribute subclass - #primitive - should equal # - when primitive is set on the attribute subclass - #primitive - should equal # +Virtus::Attribute::Boolean#coerce + when strict is turned on + with a coercible input + should equal true + with a non-coercible input + raises coercion error + when strict is turned off + with a falsy value + should equal false + with a truthy value + should equal true -Virtus.new - without attribute hash - sets default values for non-lazy attributes - skips setting default values for lazy attributes - with attribute hash - skips setting attributes with private writers - sets attributes with public writers +Virtus::AttributeSet#[]= + with a duplicate attribute + replaces the original attribute object + allows #[] to access the attribute with a string + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + allows #[] to access the attribute with a symbol + allows #reset to track overridden attributes + with a new attribute + should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + adds an attribute + allows #reset to track overridden attributes + allows #[] to access the attribute with a symbol + allows #[] to access the attribute with a string -Virtus::Attribute#value_coerced? - when input is coerced - should equal true - when input is not coerced - should equal false +custom attributes + allows you to define custom attributes + allows you to define coercion methods -Package - #meta_info - has 2 keys - should have key "to" - should have key "from" - should be coerced to [String => String] format - #dimensions - should have key :length - should be coerced to [Symbol => Float] format - should have key :height - has 3 keys - should have key :width +custom collection attributes + with an array subclass + behaves like a collection + coerces nil + coerces its members + coerces an array of attribute hashes + coerces an empty array + can be used as Virtus attributes + defaults to an empty collection + with an enumerable + behaves like a collection + coerces an array of attribute hashes + can be used as Virtus attributes + coerces an empty array + coerces nil + defaults to an empty collection + coerces its members -User - should respond to #phone_numbers= - should respond to #phone_numbers - should respond to #addresses - should respond to #addresses= - #addresses - should be an instance of Address - #region - should eql "DC" - #postal_code - should eql "21234" - #locality - should eql "Anytown" - #address - should eql "1234 Any St." - #phone_numbers - first entry - should be an instance of PhoneNumber - #number - should eql "212-555-1212" - last entry - should be an instance of PhoneNumber - #number - should eql "919-444-3265" +Virtus.finalize + it finalizes value type for a hash attribute + automatically resolves constant when it is already available + sets attributes that don't require finalization + it finalizes key type for a hash attribute + it finalizes type for an EV attribute + it finalizes member type for a collection attribute Defining a ValueObject with a custom constructor initialize a value object attribute with correct attributes -Virtus::Attribute::Hash#coerce - when input is a hash - when key/value types are EVs - coerces keys and values - 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 input is coercible to hash - should eq {:hello=>"World"} - when input is not coercible to hash - should equal "not really a hash" - -Virtus::Attribute.build - when options specify writer visibility - should not be public writer - should be public reader - behaves like a valid attribute instance - should be frozen - should be an instance of Virtus::Attribute - when custom collection-like attribute class exists for a given enumerable primitive - should be an instance of # - #type - should be < Axiom::Types::Collection - when custom attribute class exists for a given array with member coercion defined - should be an instance of # - #type - should be < Axiom::Types::Collection - when coercion is turned off in options - should not be coercible - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - when options specify reader visibility - should be public writer - should not be public reader - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - when type is a string - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - #type - should equal Axiom::Types::Integer (Integer) - when type is a range - #type - should equal Axiom::Types::Object (Enumerable) - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - when options specify strict mode - should be strict - behaves like a valid attribute instance - should be frozen - should be an instance of Virtus::Attribute - when options specify nullify blank mode - should be nullify blank - behaves like a valid attribute instance - should be frozen - should be an instance of Virtus::Attribute - when options specify lazy accessor - should be lazy - behaves like a valid attribute instance - should be frozen - should be an instance of Virtus::Attribute - when custom attribute class exists for a given primitive - should be an instance of # - #type - should equal Axiom::Types::Object (BasicObject) - when name is passed as a string - #name - should equal :something - without options - should be public writer - should be public reader - should not be lazy - sets up a coercer - should be coercible - behaves like a valid attribute instance - should be frozen - should be an instance of Virtus::Attribute - when type is an axiom type - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - #type - should equal Axiom::Types::Integer (Integer) - when type is a symbol of an existing class constant - #type - should equal Axiom::Types::String (String) - behaves like a valid attribute instance - should be an instance of Virtus::Attribute - should be frozen - -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#coercible? - when :coerce is set to true - should equal true - when :coerce is set to false - should equal false - -custom attributes - allows you to define custom attributes - allows you to define coercion methods - -Virtus.config - provides global configuration - -mass assignment with accessors - works uppon instantiation - can be set with #attributes= - respects accessor visibility +Virtus::Attribute#rename + should not equal #:public, :strict=>true, :r...Value value=nil>, :coercer=>#}> + should be strict + #name + should equal :bar -Virtus::ValueObject - equality - #equal? - returns false for different objects with the same state - returns false for different objects with different 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 - #hash - returns different values for different objects with different state - returns the same value for different objects with the same state - writer visibility - writer methods are set to private - attempts to call attribute writer methods raises NameError - attributes are configured for private writers - initialization - sets the attribute values provided to Class.new - #inspect - includes the class name and attribute values +Virtus::Attribute#coerce + when the input is an empty String + when both nullify_blank and strict are turned on + does not raises an coercion error + when nullify_blank is turned on + returns the ouput if it was coerced + returns nil + when strict mode is turned on + raises error when input was not coerced + uses coercer to coerce the input value + 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 -Using required attributes - raises coercion error when required attribute is nil - does not raise coercion error when not required attribute is nil +Virtus::Attribute::Collection custom subclass + when primitive is set on the attribute subclass + #primitive + should equal # + when primitive is not set on the attribute subclass + #primitive + should equal # Virtus::Attribute.build - when type is Set - sets default member type - behaves like a valid collection attribute instance - should be an instance of Virtus::Attribute::Collection - should be frozen - when type is Set[Float] + when strict mode is used + sets strict mode for member type + when type is a custom collection instance sets member type behaves like a valid collection attribute instance should be an instance of Virtus::Attribute::Collection should be frozen - when type is Array[Float] - sets member type + when type is Array[String, Integer] + should raise NotImplementedError with "build SumType from list of types ([String, Integer])" + when type is Array subclass behaves like a valid collection attribute instance should be an instance of Virtus::Attribute::Collection should be frozen - when strict mode is used - sets strict mode for member type - when type is an Enumerable + when type is Set[Float] + sets member type behaves like a valid collection attribute instance should be an instance of Virtus::Attribute::Collection should be frozen - when type is Array[String, Integer] - should raise NotImplementedError with "build SumType from list of types ([String, Integer])" - when type is Array[Virtus::Attribute::Boolean] - sets member type + when type is Set + sets default member type behaves like a valid collection attribute instance should be an instance of Virtus::Attribute::Collection should be frozen @@ -1594,356 +1829,122 @@ behaves like a valid collection attribute instance should be frozen should be an instance of Virtus::Attribute::Collection - when type is a custom collection instance + when type is Array[Virtus::Attribute::Boolean] sets member type behaves like a valid collection attribute instance should be frozen should be an instance of Virtus::Attribute::Collection - when type is Array subclass + when type is an Enumerable + behaves like a valid collection attribute instance + should be frozen + should be an instance of Virtus::Attribute::Collection + when type is Array[Float] + sets member type behaves like a valid collection attribute instance should be an instance of Virtus::Attribute::Collection should be frozen -Virtus::Attribute::EmbeddedValue.build - when type is Struct - should be frozen - should be an instance of Virtus::Attribute::EmbeddedValue - #coercer - should be an instance of Virtus::Attribute::EmbeddedValue::FromStruct - when type is a Virtus.model - should be an instance of Virtus::Attribute::EmbeddedValue - should be frozen - #coercer - should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type is OpenStruct - should be an instance of Virtus::Attribute::EmbeddedValue - should be frozen - #coercer - should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type is an OpenStruct subclass - should be an instance of Virtus::Attribute::EmbeddedValue - should be frozen - #coercer - should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct - when type includes Virtus - should be an instance of Virtus::Attribute::EmbeddedValue - should be frozen - #coercer - should be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct +Virtus::Attribute.coerce + when it is set to true + should equal true + with a value + sets the value and return self + when it is set to false + should equal false -Virtus::AttributeSet#<< +Virtus::AttributeSet#merge with a new attribute - indexes the new attribute under the string version of its #name property - adds an attribute - indexes the new attribute under its #name property should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + adds an attribute with a duplicate attribute replaces the original attribute object should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> +I can extend objects + defining attributes on an object + Virtus::Attribute::EmbeddedValue#coerce when primitive is Struct - when input is nil - should equal nil when input is an attribute hash - should be an instance of # + should be an instance of # #age should eql 30 #name should eql "Piotr" + when input is nil + should equal nil when input is a model instance should equal # when :strict mode is enabled - when input is coercible - should eql # when input is not coercible raises error + when input is coercible + should eql # when primitive is OpenStruct + when input is nil + should equal nil + when input is a model instance + should equal # when input is an attribute hash should be an instance of OpenStruct - #age - should eql 30 #name should eql "Piotr" - when input is a model instance - should equal # - when input is nil - should equal nil - -Virtus::Attribute#coerce - when strict mode is turned on - uses coercer to coerce the input value - raises error when input was not coerced - when attribute is not required and input is nil - returns nil - when attribute is required and input is nil - returns raises error - when the input is an empty String - when both nullify_blank and strict are turned on - does not raises an coercion error - when nullify_blank is turned on - returns nil - returns the ouput if it was coerced - when strict mode is turned off - uses coercer to coerce the input value - -I can extend objects - defining attributes on an object - -Virtus::Attribute#get - with :lazy is set to false - should equal "Jane Doe" - with :lazy is set to true - sets default only on first access - should eql "Jane Doe" - -I can create a Virtus module - including a custom module with coercion disabled - including a custom module with nullify blank enabled - including a custom module with coercion enabled - including a custom module with strict enabled - -Virtus::Attribute::Hash.build - when type is Hash[String => Integer] - should be an instance of Virtus::Attribute::Hash - sets key type - sets value type - when type is Hash - sets default value type - should be an instance of Virtus::Attribute::Hash - sets default key type - when type is Hash[String => Struct.new(:id)] - sets key type - sets value type - should be an instance of Virtus::Attribute::Hash - when type is Hash[Virtus::Attribute::Hash => Virtus::Attribute::Boolean] - sets key type - should be an instance of Virtus::Attribute::Hash - sets value type - when type is Hash[Struct.new(:id) => Integer] - sets value type - should be an instance of Virtus::Attribute::Hash - sets key type - when strict mode is used - sets the strict mode for key/value types - when type is Hash[String => Integer, Integer => String] - should raise ArgumentError with "more than one [key => value] pair in `{String=>Integer, :Integer=>:String}`" - -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 a primitive - uses coercer to coerce members - when member type is an EV - coerces members - when input is nil - returns nil - -Virtus::Attribute#set_default_value - with a non-clonable object - #test - should equal true - #instance_variables - should include :@test - with a callable - #test - should eq "model-test" - with a nil - #instance_variables - should include :@test - #test - should equal nil - with a symbol - when it is not a method name - #test - should eq "hello_world" - when it is a method name - when method is private - #test - should eq "hello world" - when method is public - #test - should eq "hello world" - with a clonable - #test - should not equal - #test - should eq [] + #age + should eql 30 embedded values allows you to pass a hash for the embedded value #attributes returns instances of the embedded values -Virtus::Attribute#rename - should not equal #:public, :strict=>true, :r...Value value=nil>, :coercer=>#}> - should be strict - #name - should equal :bar - -Virtus::AttributeSet#each - with a block - when the parent has no attributes - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - when the parent has attributes that are duplicates - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - when the parent has attributes that are not duplicates - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - with no block - yields the expected attributes - returns an enumerator when block is not provided - -Virtus#[] - should eq "foo" - -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 - skips writing unknown attributes - allows writing known attributes - -Virtus::AttributeSet#[]= - with a new attribute - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - allows #[] to access the attribute with a string - adds an attribute - allows #reset to track overridden attributes - allows #[] to access the attribute with a symbol - with a duplicate attribute - allows #reset to track overridden attributes - allows #[] to access the attribute with a string - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - replaces the original attribute object - allows #[] to access the attribute with a symbol - -Virtus instance level attributes - adding an attribute - allows setting the attribute value on the instance - -Virtus::Attribute.coerce - with a value - sets the value and return self - when it is set to false - should equal false - when it is set to true - should equal true - -Virtus::AttributeSet#reset - when the parent has changed - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - includes changes from the parent - when the parent is nil - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - includes changes from the parent - when the parent has attributes that are not duplicates - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - #to_set - should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> - when the parent has attributes that are duplicates - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - #to_set - should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> - when the parent has no attributes - should equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - #to_set - should eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> - -Virtus#freeze - should be frozen - does not change dynamic default values - does not change default attributes that have been explicitly set - #age - should equal 30 - #name - should eql "foo" - -Virtus#[]= - should change `object.test` from nil to "foo" - -virtus attribute definitions - the constructor accepts a hash for mass-assignment - virtus creates accessor methods - Boolean attributes have a predicate method - with attributes - #to_hash returns the object's attributes as a hash - #attributes returns the object's attributes as a hash - #to_h returns the object's attributes as a hash - inheritance - lets you add attributes to the subclass at runtime - lets you add attributes to the base class at runtime - inherits all the attributes from the base class - -Virtus::Attribute#defined? - when the attribute value has been defined - should equal true - when the attribute value has not been defined - should equal false - Virtus.module with multiple other modules mixed into it - includes the attributes from all modules provides attributes for the model from all modules - with a model instance - provides attributes for the instance + 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 constructor turned off - skips including constructor + 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 coercion turned off - builds non-coercible attributes + 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 - 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 class - defaults to Object for attribute type + 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 coercion turned off - builds non-coercible attributes - behaves like a valid virtus object - reads and writes attribute - with default configuration - sets defaults + with mass assignment is turned off + skips including mass assignment behaves like a valid virtus object reads and writes attribute - with another module - provides attributes for the model - behaves like an object extended with virtus module with default configuration sets defaults behaves like a valid virtus object reads and writes attribute - with constructor turned off - skips including constructor + with coercion turned off + builds non-coercible attributes behaves like a valid virtus object reads and writes attribute + as a peer to another module within a class + includes the attributes from both modules + provides attributes for the model 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 @@ -1952,32 +1953,65 @@ 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 constructor turned off + skips including constructor + behaves like a valid virtus object + reads and writes attribute -Virtus::Attribute#== (defined by including Virtus::Equalizer) - returns true when attributes have same type and options - returns false when attributes have different type - returns false when attributes have different options +Virtus instance level attributes + adding an attribute + allows setting the attribute value on the instance + +Virtus::Attribute#coercible? + when :coerce is set to false + should equal false + when :coerce is set to true + should equal true + +Virtus::Attribute::Hash#coerce + when input is coercible to hash + should eq {:hello=>"World"} + when input is a hash + when key/value types are primitives + uses coercer to coerce key and value + when key/value types are EVs + coerces keys and values + when key type is an array and value type is another hash + coerces keys and values + when input is not coercible to hash + should equal "not really a hash" + +Virtus::Attribute#get + with :lazy is set to false + should equal "Jane Doe" + with :lazy is set to true + sets default only on first access + should eql "Jane Doe" 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 reader and writer + 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 be_test - expected # to respond to `test?` + Failure/Error: expect(object).to_not be_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 ' + # ./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 predicate method + 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_not be_test - expected # to respond to `test?` + Failure/Error: expect(object).to be_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 ' + # ./spec/unit/virtus/attribute_spec.rb:15:in `block (3 levels) in ' -Finished in 1.22 seconds (files took 0.67695 seconds to load) +Finished in 0.78786 seconds (files took 0.4901 seconds to load) 462 examples, 0 failures, 2 pending -Randomized with seed 40898 +Randomized with seed 12709 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -2006,12 +2040,14 @@ dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) I: copying local configuration +I: user script /srv/workspace/pbuilder/36546/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/36546/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/33203 and its subdirectories -I: Current time: Sat Apr 3 22:27:25 -12 2021 -I: pbuilder-time-stamp: 1617532045 +I: removing directory /srv/workspace/pbuilder/36546 and its subdirectories +I: Current time: Sun May 8 06:51:12 +14 2022 +I: pbuilder-time-stamp: 1651942272