Diff of the two buildlogs: -- --- b1/build.log 2024-10-27 09:12:14.844097241 +0000 +++ b2/build.log 2024-10-27 09:13:24.529615900 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sat Nov 29 03:34:37 -12 2025 -I: pbuilder-time-stamp: 1764430477 +I: Current time: Sun Oct 27 23:12:17 +14 2024 +I: pbuilder-time-stamp: 1730020337 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -30,54 +30,86 @@ dpkg-source: info: applying 0003-Replace-deprecated-Fixnum-by-Integer-in-tests.patch I: using fakeroot in build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/83300/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/D01_modify_environment starting +debug: Running on ionos12-i386. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Oct 27 09:12 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=22 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="32" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.2.32(1)-release' + BUILDDIR=/build/reproducible-path + 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 parallel=10 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='f8667f99d8a7492faad15f1a3d2232eb' - 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='83300' - PS1='# ' - PS2='> ' + INVOCATION_ID=33df6107132c4b11a90e5db16c55d58a + 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=65357 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.dVitlAhb/pbuilderrc_uukD --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.dVitlAhb/b1 --logfile b1/build.log ruby-virtus_2.0.0-2.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://213.165.73.152:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.dVitlAhb/pbuilderrc_LBbH --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.dVitlAhb/b2 --logfile b2/build.log ruby-virtus_2.0.0-2.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://46.16.76.132:3128 I: uname -a - Linux ionos6-i386 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Aug 4 2024 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/83300/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Aug 4 21:30 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -277,7 +309,7 @@ Get: 144 http://deb.debian.org/debian trixie/main i386 ruby-rspec-expectations all 3.13.0c0e0m0s1-2 [90.2 kB] Get: 145 http://deb.debian.org/debian trixie/main i386 ruby-rspec-mocks all 3.13.0c0e0m0s1-2 [81.3 kB] Get: 146 http://deb.debian.org/debian trixie/main i386 ruby-rspec all 3.13.0c0e0m0s1-2 [5184 B] -Fetched 44.8 MB in 1s (75.3 MB/s) +Fetched 44.8 MB in 1s (52.3 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.12-minimal:i386. (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 ... 19934 files and directories currently installed.) @@ -766,8 +798,8 @@ Setting up tzdata (2024a-4) ... Current default time zone: 'Etc/UTC' -Local time is now: Sat Nov 29 15:34:59 UTC 2025. -Universal Time is now: Sat Nov 29 15:34:59 UTC 2025. +Local time is now: Sun Oct 27 09:12:52 UTC 2024. +Universal Time is now: Sun Oct 27 09:12:52 UTC 2024. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up autotools-dev (20220109.1) ... @@ -902,7 +934,11 @@ fakeroot is already the newest version (1.36-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/reproducible-path/ruby-virtus-2.0.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-virtus_2.0.0-2_source.changes +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/ruby-virtus-2.0.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-virtus_2.0.0-2_source.changes dpkg-buildpackage: info: source package ruby-virtus dpkg-buildpackage: info: source version 2.0.0-2 dpkg-buildpackage: info: source distribution unstable @@ -987,200 +1023,293 @@ RUBYLIB=/build/reproducible-path/ruby-virtus-2.0.0/debian/ruby-virtus/usr/lib/ruby/vendor_ruby:. GEM_PATH=/build/reproducible-path/ruby-virtus-2.0.0/debian/ruby-virtus/usr/share/rubygems-integration/all:/build/reproducible-path/ruby-virtus-2.0.0/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.1.0:/var/lib/gems/3.1.0:/usr/local/lib/ruby/gems/3.1.0:/usr/lib/ruby/gems/3.1.0:/usr/lib/i386-linux-gnu/ruby/gems/3.1.0:/usr/share/rubygems-integration/3.1.0:/usr/share/rubygems-integration/all:/usr/lib/i386-linux-gnu/rubygems-integration/3.1.0 ruby3.1 -S rake --rakelibdir /gem2deb-nonexistent -f debian/ruby-tests.rake /usr/bin/ruby3.1 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 1067 +Randomized with seed 29265 -Virtus::AttributeSet#define_reader_method - with public visibility - defines public writer - with private visibility - defines public writer - with protected visibility - defines protected writer - -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 # - -Adding attribute called 'attributes' - when mass assignment is disabled - doesn't accept `attributes` key in initializer - allows model to use `attributes` attribute +Virtus::Attribute::Hash#coerce + when input is coercible to hash + is expected to eq {:hello=>"World"} + when input is not coercible to hash + is expected to equal "not really a hash" + 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 -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 no block + returns an enumerator when block is not provided + yields the expected attributes + 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 + yields the expected attributes + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + 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 -Virtus::Attribute.build - when type is Array - 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 strict mode is used - sets strict mode for member type - 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 type is a custom collection instance - 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 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[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 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 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 - 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 +Virtus::Attribute::EmbeddedValue.build + 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 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 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 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 frozen + is expected to be an instance of Virtus::Attribute::EmbeddedValue + #coercer + is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromStruct -Virtus instance level attributes - adding an attribute - allows setting the attribute value on the instance +Injectible coercer + coerces an embedded string + accepts an email hash -Virtus::Attribute.coerce - when it is set to false +Virtus::Attribute::Boolean#value_coerced? + when input is true + is expected to equal true + when input is not coerced is expected to equal false - when it is set to true + when input is false is expected to equal true - with a value - sets the value and return self -Virtus::Attribute#coerce - when the input is an empty String - when nullify_blank is turned on - returns the ouput if it was coerced - returns nil - when both nullify_blank and strict are turned on - does not raises an coercion error - 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 +Virtus::Attribute#set_default_value + with a clonable + #test + is expected to eq [] + #test + is expected not to equal + with a callable + #test + is expected to eq "model-test" + 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 private + #test + is expected to eq "hello world" + when method is public + #test + is expected to eq "hello world" + with a non-clonable object + #instance_variables + is expected to include :@test + #test + is expected to equal true + with a nil + #instance_variables + is expected to include :@test + #test + is expected to equal nil -Virtus::Attribute#lazy? - when :lazy is set to true - is expected to equal true - when :lazy is set to false - is expected to equal false +Virtus#[]= + is expected to change `object.test` from nil to "foo" Virtus::ValueObject - using deprecated inclusion - behaves like a valid value object - defines #hash - disallows cloning - defines #== - defines #eql? - sets private writers - allows to construct new values using #with - defines #inspect - #id - is expected to equal 1 - #name - is expected to eql "Jane Doe" using new values {} block - without mass-assignment + 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 + sets private writers for additional values + sets private writers + disallows cloning + defines #== + defines #hash + allows to construct new values using #with + defines valid #== for a subclass + defines #inspect + defines #eql? + #name + is expected to eql "Jane Doe" + #email + is expected to eql "jane@doe.com" + #id + is expected to equal 1 behaves like a valid value object - defines #inspect defines #eql? + allows to construct new values using #with + sets private writers + defines #inspect disallows cloning - defines #hash defines #== - sets private writers - allows to construct new values using #with - #id - is expected to equal 1 + defines #hash #name is expected to eql "Jane Doe" - with mass-assignment + #id + is expected to equal 1 + without mass-assignment behaves like a valid value object - sets private writers disallows cloning - defines #hash - allows to construct new values using #with defines #eql? + defines #hash defines #== + sets private writers defines #inspect + allows to construct new values using #with #name is expected to eql "Jane Doe" #id is expected to equal 1 - 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 #inspect - defines #eql? - defines #== - disallows cloning - allows to construct new values using #with - sets private writers - defines #hash - sets private writers for additional values - defines valid #== for a subclass - #id - is expected to equal 1 - #name - is expected to eql "Jane Doe" - #email - is expected to eql "jane@doe.com" + using deprecated inclusion + behaves like a valid value object + sets private writers + defines #inspect + defines #eql? + allows to construct new values using #with + disallows cloning + defines #hash + defines #== + #id + is expected to equal 1 + #name + is expected to eql "Jane Doe" + +Virtus::AttributeSet#reset + when the parent has changed + includes changes from the parent + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> and #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + when the parent has attributes that are duplicates + 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 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 is nil + includes changes from the parent + 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=>#}> + #to_set + is expected to eq #:public, :strict=>...lue value=nil>, :coercer=>#}>}> + +embedded values + #attributes returns instances of the embedded values + allows you to pass a hash for the embedded value + +Defining a ValueObject with a custom constructor + initialize a value object attribute with correct attributes + +Using required attributes + does not raise coercion error when not required attribute is nil + raises coercion error when required attribute is nil + +Adding attribute called 'attributes' + when mass assignment is disabled + doesn't accept `attributes` key in initializer + allows model to use `attributes` attribute + +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 off + uses coercer to coerce the input value + when strict mode is turned on + uses coercer to coerce the input value + raises error when input was not coerced + when attribute is required and input is nil + returns raises error + when attribute is not required and input is nil + returns nil + +Virtus#freeze + does not change dynamic default values + does not change default attributes that have been explicitly set + is expected to be frozen + #age + is expected to equal 30 + #name + is expected to eql "foo" + +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 + +Virtus instance level attributes + adding an attribute + allows setting the attribute value on the instance + +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 (PENDING: Temporarily skipped with xit) + behaves like mass-assignment + skips writing unknown attributes + allows writing known attributes + +Virtus::AttributeSet#define_writer_method + with public visibility + defines public writer + with private visibility + defines private writer + with protected visibility + defines protected writer User + 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= - #phone_numbers - first entry - is expected to be an instance of PhoneNumber - #number - is expected to eql "212-555-1212" - last entry - is expected to be an instance of PhoneNumber - #number - is expected to eql "919-444-3265" #addresses is expected to be an instance of Address #postal_code is expected to eql "21234" + #address + is expected to eql "1234 Any St." #locality is expected to eql "Anytown" #region is expected to eql "DC" - #address - is expected to eql "1234 Any St." + #phone_numbers + last entry + is expected to be an instance of PhoneNumber + #number + is expected to eql "919-444-3265" + first entry + is expected to be an instance of PhoneNumber + #number + is expected to eql "212-555-1212" + +overriding virtus behavior + overriding an attribute setter + super can be used to access the setter defined by virtus + calls the defined setter + overriding an attribute getter + super can be used to access the getter defined by virtus + calls the defined getter Virtus::Attribute#rename is expected to be strict @@ -1188,107 +1317,42 @@ #name is expected to equal :bar -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 a class + including a module with attributes into an instance -Virtus::Attribute::EmbeddedValue.build - 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 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 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 an OpenStruct subclass - 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 frozen - is expected to be an instance of Virtus::Attribute::EmbeddedValue - #coercer - is expected to be an instance of Virtus::Attribute::EmbeddedValue::FromOpenStruct +custom attributes + allows you to define custom attributes + allows you to define coercion methods -Virtus::AttributeSet#merge - with a new attribute - adds an attribute - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> +Virtus::AttributeSet#<< 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 + indexes the new attribute under its #name property + indexes the new attribute under the string version of its #name property + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> -Using required attributes - raises coercion error when required attribute is nil - does not raise coercion error when not required attribute is nil - -virtus attribute definitions - virtus creates accessor methods - Boolean attributes have a predicate method - the constructor accepts a hash for mass-assignment - 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_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 - -Virtus::Attribute#defined? - when the attribute value has not been defined - is expected to equal false - when the attribute value has been defined - is expected to equal true - -I can define attributes within a module - including a module with attributes into an instance - including a module with attributes into a class - -I can extend objects - defining attributes on an object - -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 - -Virtus::Attribute::Hash#coerce - when input is coercible to hash - is expected to eq {:hello=>"World"} - when input is not coercible to hash - is expected to equal "not really a hash" - 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 +Virtus::Attribute#get + with :lazy is set to true + is expected to eql "Jane Doe" + sets default only on first access + with :lazy is set to false + is expected to equal "Jane Doe" Virtus.model - when constructor is disabled - does not accept attribute hash in the constructor with default configuration - with a class - defaults to Object for attribute type + 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 with a sub-class has its own attributes behaves like a model with constructor @@ -1299,131 +1363,249 @@ accepts attribute hash behaves like a model with mass-assignment 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 - 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 strict mode is enabled with an instance has attributes with strict set to true with a class - has attributes with :required option inherited from module + has attributes with strict set to true + when constructor is disabled + does not accept attribute hash in the constructor 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 strict mode is enabled with a class - has attributes with strict set to true - with an instance - has attributes with strict set to true - -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 strict enabled - including a custom module with nullify blank enabled + is expected not to respond to #attributes= + is expected not to respond to #attributes -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::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::AttributeSet#<< +Virtus::AttributeSet#[]= with a duplicate attribute is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + allows #[] to access the attribute with a string replaces the original attribute object + allows #reset to track overridden attributes + allows #[] to access the attribute with a symbol with a new attribute - indexes the new attribute under the string version of its #name property + allows #[] to access the attribute with a string + allows #[] to access the attribute with a symbol adds an attribute + allows #reset to track overridden attributes is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - indexes the new attribute under its #name property + +I can extend objects + defining attributes on an object + +virtus attribute definitions + virtus creates accessor methods + Boolean attributes have a predicate method + the constructor accepts a hash for mass-assignment + 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 + #attributes returns the object's attributes as a hash + #to_h returns the object's attributes as a hash + #to_hash returns the object's attributes as a hash Virtus::Attribute::Collection#value_coerced? + when input has incorrectly typed members + is expected to equal false when the input is empty is expected to equal true + when input has correctly typed members + is expected to equal true when the collection type is incorrect is expected to equal false - when input has incorrectly typed members + +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::Collection custom subclass + when primitive is not set on the attribute subclass + #primitive + is expected to equal # + when primitive is set on the attribute subclass + #primitive + is expected to equal # + +Virtus::Attribute.coerce + when it is set to false is expected to equal false - when input has correctly typed members + when it is set to true + is expected to equal true + with a value + sets the value and return self + +Virtus#set_default_attributes! + is expected to equal #<#:0xf765ac50 @age=30, @name="foo"> + #age + is expected to equal 30 + #name + is expected to eql "foo" + +Virtus::Attribute#required? + when required option is false + is expected to equal false + when required option is true + is expected to equal true + +mass assignment with accessors + works uppon instantiation + respects accessor visibility + can be set with #attributes= + +Virtus.finalize + it finalizes value type for a hash attribute + it finalizes type for an EV attribute + 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 key type for a hash attribute + +Virtus::AttributeSet#merge + with a new attribute + adds an attribute + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + with a duplicate attribute + replaces the original attribute object + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + +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::Attribute.build - when type is an axiom 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 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[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 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 + when type is Set[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 + 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 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 an Enumerable + behaves like a valid collection attribute instance + is expected to be frozen + is expected to be an instance of Virtus::Attribute::Collection + when strict mode is used + sets strict mode for member type + +Virtus::Attribute.build + when custom attribute class exists for a given array with member coercion defined + is expected to be an instance of # #type - is expected to equal Axiom::Types::Integer (Integer) + is expected to be < Axiom::Types::Collection + when options specify strict mode + is expected to be strict 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 + when type is an axiom type behaves like a valid attribute instance - is expected to be an instance of Virtus::Attribute is expected to be frozen - #type - is expected to equal Axiom::Types::String (String) - when type is a string + is expected to be an instance of Virtus::Attribute #type is expected to equal Axiom::Types::Integer (Integer) + 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 frozen is expected to be an instance of Virtus::Attribute - when options specify reader visibility - is expected not to be public reader + without options + is expected to be coercible + is expected to be public reader is expected to be public writer + is expected not to be lazy + sets up a coercer 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 - without options - is expected to be coercible - sets up a coercer + when options specify reader visibility is expected to be public writer - is expected not to be lazy - is expected to be public reader + 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 attribute class exists for a given primitive - is expected to be an instance of # - #type - is expected to equal Axiom::Types::Object (BasicObject) when name is passed as a string #name is expected to equal :something - 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 custom attribute class exists for a given array with member coercion defined - is expected to be an instance of # + when type is a string #type - is expected to be < Axiom::Types::Collection - when coercion is turned off in options - is expected not to be coercible + 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 strict mode - is expected to be strict + 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 options specify nullify blank mode - is expected to be nullify blank + 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 @@ -1432,64 +1614,191 @@ 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 type is a symbol of an existing class constant behaves like a valid attribute instance is expected to be an instance of Virtus::Attribute is expected to be frozen #type - is expected to equal Axiom::Types::Object (Enumerable) + is expected to equal Axiom::Types::String (String) + when options specify nullify blank mode + is expected to be nullify blank + behaves like a valid attribute instance + is expected to be frozen + is expected to be an instance of Virtus::Attribute -Virtus::Attribute#required? - when required option is true +Virtus::Attribute#value_coerced? + when input is coerced is expected to equal true - when required option is false + when input is not coerced is expected to equal false +Virtus::AttributeSet#[] + allows indexed access to attributes by the string representation of their name + is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> + +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#[] + is expected to eq "foo" + +Package + #dimensions + is expected to have key :height + is expected to have key :width + should be coerced to [Symbol => Float] format + has 3 keys + is expected to have key :length + #meta_info + is expected to have key "from" + should be coerced to [String => String] format + has 2 keys + is expected to have key "to" + Virtus::Attribute::Hash.build + when strict mode is used + sets the strict mode for key/value types when type is Hash[Virtus::Attribute::Hash => Virtus::Attribute::Boolean] - is expected to be an instance of Virtus::Attribute::Hash sets value type + is expected to be an instance of Virtus::Attribute::Hash sets key type when type is Hash + sets default key type is expected to be an instance of Virtus::Attribute::Hash sets default value type - sets default key type - when type is Hash[String => Struct.new(:id)] + when type is Hash[Struct.new(:id) => Integer] 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 + 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 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[String => Integer, Integer => String] is expected to raise ArgumentError with "more than one [key => value] pair in `{String=>Integer, :Integer=>:String}`" -Virtus#set_default_attributes! - is expected to equal #<#:0xf4f38a28 @age=30, @name="foo"> - #age - is expected to equal 30 - #name - is expected to eql "foo" +Virtus::Attribute#== (defined by including Virtus::Equalizer) + returns true when attributes have same type and options + returns false when attributes have different options + returns false when attributes have different type + +Virtus.config + provides global configuration + +Virtus#attributes + with a class + behaves like attribute hash + includes all attributes + with an instance + behaves like attribute hash + includes all attributes + +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 + +Using Struct as an embedded value attribute + initialize a struct object with correct attributes + +Virtus::Attribute::EmbeddedValue#coerce + when :strict mode is enabled + when input is not coercible + raises error + when input is coercible + is expected to eql # + when primitive is OpenStruct + when input is an attribute hash + is expected to be an instance of OpenStruct + #name + is expected to eql "Piotr" + #age + is expected to eql 30 + when input is nil + is expected to equal nil + when input is a model instance + is expected to equal # + when primitive is Struct + when input is nil + is expected to equal nil + when input is a model instance + is expected to equal # + when input is an attribute hash + is expected to be an instance of # + #age + is expected to eql 30 + #name + is expected to eql "Piotr" + +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::Attribute::Boolean#coerce + when strict is turned off + with a truthy value + is expected to equal true + with a falsy value + is expected to equal false + when strict is turned on + with a non-coercible input + raises coercion error + with a coercible input + is expected to equal true + +default values + you can reset attribute to its default + 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 + a Hash + without a default the value is an empty Hash + 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 Virtus#attribute raises error when :name is a reserved name on a class - returns self raises error when :name is a reserved name on an instance - allows :attributes as an attribute name when mass-assignment is not included allows specifying attribute without type + allows :attributes as an attribute name when mass-assignment is not included + returns self with an instance behaves like an object with string attribute can write and read the attribute is expected to respond to #test= is expected to respond to #test with a class + when type is :Boolean + with a subclass + behaves like a class with boolean attribute + gets attributes from the parent class + defines predicate method + defines reader and writer + behaves like a class with boolean attribute + defines predicate method + defines reader and writer + when type is "Boolean" + behaves like a class with boolean attribute + defines reader and writer + defines predicate method when type is Decimal maps type to the corresponding axiom type when type is Axiom::Types::Boolean @@ -1498,342 +1807,60 @@ defines predicate method (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 - when type is "Boolean" - behaves like a class with boolean attribute - defines predicate method - defines reader and writer - when type is :Boolean - behaves like a class with boolean attribute defines predicate method - defines reader and writer - with a subclass - behaves like a class with boolean attribute - defines reader and writer - defines predicate method - gets attributes from the parent class + using custom module + writes and reads attributes + is expected to respond to #test + is expected to respond to #test= 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= - can write and read the attribute 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= can write and read the attribute is expected to respond to #test - using custom module - is expected to respond to #test - is expected to respond to #test= - writes and reads attributes - -Virtus#[] - is expected to eq "foo" - -Virtus::AttributeSet#define_writer_method - with public visibility - defines public writer - with protected visibility - defines protected writer - with private visibility - defines private writer - -Virtus.finalize - it finalizes value type for a hash attribute - it finalizes type for an EV attribute - it finalizes key type for a hash attribute - automatically resolves constant when it is already available - sets attributes that don't require finalization - it finalizes member type for a collection attribute - -Inheritance - inherits model from the base class - sets correct attributes on the descendant classes - -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 - super can be used to access the setter defined by virtus - calls the defined setter - -Virtus#freeze - does not change dynamic default values - does not change default attributes that have been explicitly set - is expected to be frozen - #name - is expected to eql "foo" - #age - is expected to equal 30 - -Virtus::Attribute#value_coerced? - when input is not coerced - is expected to equal false - when input is coerced - is expected to equal true - -Injectible coercer - coerces an embedded string - accepts an email hash - -custom attributes - allows you to define coercion methods - allows you to define custom attributes - -Virtus::Attribute::Boolean#value_coerced? - when input is false - is expected to equal true - when input is not coerced - is expected to equal false - when input is true - is expected to equal true - -Virtus::Attribute#coercible? - when :coerce is set to true - is expected to equal true - when :coerce is set to false - is expected to equal false - -Virtus#[]= - is expected to change `object.test` from nil to "foo" - -Defining a ValueObject with a custom constructor - initialize a value object attribute with correct attributes - -Package - #meta_info - has 2 keys - should be coerced to [String => String] format - is expected to have key "from" - is expected to have key "to" - #dimensions - is expected to have key :height - has 3 keys - is expected to have key :length - is expected to have key :width - should be coerced to [Symbol => Float] format - -Virtus::ValueObject - equality - #hash - returns the same value for different objects with the same state - returns different values for different objects with different state - #== - returns false for different objects with different state - returns true for different objects with the same state - #equal? - returns false for different objects with different state - returns false for different objects with the same state - #eql? - returns true for different objects with the same state - returns false for different objects with different state - #inspect - includes the class name and attribute values - writer visibility - attributes are configured for private writers - writer methods are set to private - attempts to call attribute writer methods raises NameError - initialization - sets the attribute values provided to Class.new - -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 + is expected to respond to #test= custom collection attributes - with an enumerable + with an array subclass behaves like a collection - coerces its members - coerces an empty array + coerces nil can be used as Virtus attributes defaults to an empty collection - coerces nil + coerces an empty array + coerces its members coerces an array of attribute hashes - with an array subclass + with an enumerable behaves like a collection - coerces an empty array coerces an array of attribute hashes - coerces its members - defaults to an empty collection can be used as Virtus attributes + defaults to an empty collection + coerces its members coerces nil + coerces an empty array -embedded values - #attributes returns instances of the embedded values - allows you to pass a hash for the embedded value - -Virtus.config - provides global configuration - -Virtus::Attribute#set_default_value - with a nil - #instance_variables - is expected to include :@test - #test - is expected to equal nil - with a clonable - #test - is expected to eq [] - #test - is expected not to equal - with a callable - #test - is expected to eq "model-test" - 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 non-clonable object - #test - is expected to equal true - #instance_variables - is expected to include :@test - -Virtus::AttributeSet#each - with a block - when the parent has attributes that are duplicates - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - yields the expected attributes - 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 - yields the expected attributes - returns an enumerator when block is not provided - -Virtus#attributes - with an instance - behaves like attribute hash - includes all attributes - with a class - behaves like attribute hash - includes all attributes - -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 (PENDING: Temporarily skipped with xit) - behaves like mass-assignment - skips writing unknown attributes - allows writing known attributes - -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::AttributeSet#[]= - with a new attribute - adds an attribute - 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=>#}> - allows #[] to access the attribute with a string - with a duplicate attribute - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> - allows #[] to access the attribute with a symbol - allows #[] to access the attribute with a string - allows #reset to track overridden attributes - replaces the original attribute object - -Virtus::Attribute::EmbeddedValue#coerce - when primitive is Struct - when input is nil - is expected to equal nil - when input is an attribute hash - is expected to be an instance of # - #name - is expected to eql "Piotr" - #age - is expected to eql 30 - when input is a model instance - is expected to equal # - 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 input is an attribute hash - is expected to be an instance of OpenStruct - #age - is expected to eql 30 - #name - is expected to eql "Piotr" - when input is nil - is expected to equal nil - when input is a model instance - is expected to equal # - -default values - you can reset attribute to its default - can be supplied with the :default option - you can pass a 'callable-object' to the :default option - without a default the value is nil - you can set defaults for private attributes - an Array - without a default the value is an empty Array - a Hash - without a default the value is an empty Hash - a Set - without a default the value is an empty Set - a ValueObject - does not duplicate the ValueObject - -Virtus::AttributeSet#reset - 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 - when the parent has no attributes - 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 attributes that are duplicates - 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 is nil - includes changes from the parent - is expected to equal #:public, :strict=>false, :...Value value=nil>, :coercer=>#}> +Inheritance + sets correct attributes on the descendant classes + inherits model from the base class Virtus.module + with multiple other modules mixed into it + provides attributes for the model from all modules + includes the attributes from all modules as a peer to another module within a class - provides attributes for the model from both modules includes the attributes from both modules + provides attributes for the model from both modules with a class provides attributes for the model defaults to Object for attribute type behaves like an object extended with virtus module - with constructor turned off - skips including constructor + with mass assignment is turned off + skips including mass assignment behaves like a valid virtus object reads and writes attribute with coercion turned off @@ -1844,20 +1871,13 @@ sets defaults 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 multiple other modules mixed into it - provides attributes for the model from all modules - includes the attributes from all 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 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 @@ -1870,67 +1890,83 @@ builds non-coercible attributes behaves like a valid virtus object reads and writes attribute - with another module - provides attributes for the model + with constructor turned off + skips including constructor + behaves like a valid virtus object + reads and writes attribute + with a model instance + provides attributes for the instance 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 - 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 coercion turned off builds non-coercible attributes 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 - -Virtus.new - without attribute hash - skips setting default values for lazy attributes - sets default values for non-lazy attributes - with attribute hash - skips setting attributes with private writers - sets attributes with public writers +Virtus::ValueObject + #inspect + includes the class name and attribute values + writer visibility + attempts to call attribute writer methods raises NameError + attributes are configured for private writers + writer methods are set to private + equality + #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 + #equal? + returns false for different objects with different state + returns false for different objects with the same state + #hash + returns different values for different objects with different state + returns the same value for different objects with the same state + initialization + sets the attribute values provided to Class.new -mass assignment with accessors - respects accessor visibility - can be set with #attributes= - works uppon instantiation +I can create a Virtus module + including a custom module with coercion enabled + including a custom module with nullify blank enabled + including a custom module with coercion disabled + including a custom module with strict enabled 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#attributes= with a class raises when attributes is not hash-like object + # Temporarily skipped with xit + # ./spec/unit/virtus/attributes_writer_spec.rb:32 + + 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 ' - 2) Virtus#attribute with a class when type is Axiom::Types::Boolean behaves like a class with boolean attribute defines predicate method + 3) 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 ' - 3) Virtus#attributes= with a class raises when attributes is not hash-like object - # Temporarily skipped with xit - # ./spec/unit/virtus/attributes_writer_spec.rb:32 - -Finished in 0.66968 seconds (files took 0.42865 seconds to load) +Finished in 1.22 seconds (files took 0.87535 seconds to load) 468 examples, 0 failures, 3 pending -Randomized with seed 1067 +Randomized with seed 29265 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -1961,12 +1997,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/65357/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/65357/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/83300 and its subdirectories -I: Current time: Sat Nov 29 03:35:13 -12 2025 -I: pbuilder-time-stamp: 1764430513 +I: removing directory /srv/workspace/pbuilder/65357 and its subdirectories +I: Current time: Sun Oct 27 23:13:23 +14 2024 +I: pbuilder-time-stamp: 1730020403