Diff of the two buildlogs: -- --- b1/build.log 2020-12-22 17:02:38.870309964 +0000 +++ b2/build.log 2020-12-22 17:05:58.628132058 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Jan 24 11:25:02 -12 2022 -I: pbuilder-time-stamp: 1643066702 +I: Current time: Wed Dec 23 07:02:41 +14 2020 +I: pbuilder-time-stamp: 1608656561 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 Tue Feb 6 06:14:11 2018 -12 +gpgv: Signature made Wed Feb 7 08:14:11 2018 +14 gpgv: using RSA key 7E43E9ACBF727AB3CF0885338716CE4614A452D8 gpgv: Can't check signature: No public key dpkg-source: warning: failed to verify signature on ./ruby-memfs_1.0.0-1.dsc @@ -29,136 +29,170 @@ dpkg-source: info: applying 002_fix-spec-ruby25.patch I: using fakeroot in build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/65218/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/9967/tmp/hooks/D01_modify_environment starting +debug: Running on ionos1-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/9967/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/9967/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=16' - DISTRIBUTION='' - 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=15' + 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='64e5f5d2f8604d4c91aa9c394f3e1e96' - 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='65218' - PS1='# ' - PS2='> ' + INVOCATION_ID=ef28419c7c8e4e7f8477ec5b71f89ccc + 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=9967 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.ltI2UDoPgw/pbuilderrc_Hu5b --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.ltI2UDoPgw/b1 --logfile b1/build.log ruby-memfs_1.0.0-1.dsc' - SUDO_GID='110' - SUDO_UID='105' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://85.184.249.68:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.ltI2UDoPgw/pbuilderrc_SiUg --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.ltI2UDoPgw/b2 --logfile b2/build.log ruby-memfs_1.0.0-1.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://78.137.99.97:3128 I: uname -a - Linux ionos5-amd64 5.9.0-0.bpo.2-amd64 #1 SMP Debian 5.9.6-1~bpo10+1 (2020-11-19) x86_64 GNU/Linux + Linux i-capture-the-hostname 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) 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 Jan 23 12:18 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/65218/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 Dec 23 07:03 sh -> bash + lrwxrwxrwx 1 root root 4 Dec 21 22:25 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/9967/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -360,7 +394,7 @@ Get: 156 http://deb.debian.org/debian buster/main amd64 ruby-thread-order all 1.1.0-1 [5096 B] Get: 157 http://deb.debian.org/debian buster/main amd64 ruby-rspec-core all 3.8.0c0e1m0s0-1 [190 kB] Get: 158 http://deb.debian.org/debian buster/main amd64 ruby-rspec all 3.8.0c0e1m0s0-1 [7620 B] -Fetched 44.5 MB in 1s (67.3 MB/s) +Fetched 44.5 MB in 2s (25.9 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.) @@ -1024,7 +1058,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-memfs-1.0.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b +I: Running cd /build/ruby-memfs-1.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 dpkg-buildpackage: info: source package ruby-memfs dpkg-buildpackage: info: source version 1.0.0-1 dpkg-buildpackage: info: source distribution unstable @@ -1106,136 +1140,137 @@ All examples were filtered out; ignoring {:focus=>true} -Randomized with seed 36971 +Randomized with seed 53625 -MemFs::File::Stat +MemFs::Fake::File + stores the modification made on its content + #close + sets the file as closed? + #content + returns the file content + when the file is empty + returns an empty string container + #type + when the file is a regular file + returns 'file' + when the file is a block device + returns 'blockSpecial' + when the file is a character device + returns 'characterSpecial' + +MemFs::Fake::Directory + #entry_names + returns the list of the names of the entries in the directory + #paths + returns the path of the directory and its entries recursively + #parent= + sets the parent directory + sets the .. entry in entries list + #find + should remove any leading / in the path + should remove any trailing / in the path + calls find on the next directory in the search chain + returns the named entry if it is one of the entries + #type + returns 'directory' .new - when optional dereference argument is set to true - when the last target of the link chain does not exist - raises an exception + sets . in the entries list + sets .. in the entries list + #remove_entry + removes an entry from the entries list + empty? + returns true if the directory is empty + returns false if the directory is not empty + #path + returns the directory path + when the directory is / + returns / + #add_entry + sets the parent of the added entry + adds the entry to the entries list + +MemFs::File::Stat + #socket? + when the file is not a socket + returns false #mode returns an integer representing the permission bits of stat - #grpowned? - when the effective user group owns of the file - returns true - when the effective user group does not own of the file - returns false (PENDING: Temporarily skipped with xit) - #atime - returns the access time of the entry - when the entry is a symlink - and the optional dereference argument is false - returns the access time of the symlink itself - and the optional dereference argument is true - returns the access time of the last target of the link chain - #world_reable? - when +file_name+ is not readable by others - returns nil - when +file_name+ is readable by others - returns an integer representing the file permission bits of +file_name+ - #world_writable? - when +file_name+ is writable by others - returns an integer representing the file permission bits of +file_name+ - when +file_name+ is not writable by others - returns nil - #readable? - when the file is readable by anyone - and the user has no specific right on it - returns true - when the file is user readable - and the current user owns the file - returns true - when the file is not readable by anyone - return false - when the file is group readable - and the current user is part of the owner group - returns true #setgid? - when the file does not have the setgid bit set - returns false when the file has the setgid bit set returns true - #zero? - when the file has a zero size - returns true - when the file does not have a zero size + when the file does not have the setgid bit set returns false #blockdev? when the file is not a block device returns false when the file is a block device returns true - #gid - returns the group id of the named entry - #readable_real? - when the file is not readable by anyone - return false - when the file does not exist + #setuid? + when the file has the setuid bit set + returns true + when the file does not have the setuid bit set returns false - when the file is user readable - and the current user owns the file - returns true - when the file is group readable - and the current user is part of the owner group - returns true - when the file is readable by anyone - and the user has no specific right on it - returns true - #ctime - returns the access time of the entry - when the entry is a symlink - and the optional dereference argument is false - returns the access time of the symlink itself - and the optional dereference argument is true - returns the access time of the last target of the link chain - #uid - returns the user id of the named entry - #blksize - returns the block size of the file - #ino - returns the inode number for stat. #file? when dereference is true - when the entry is not a regular file - returns false when the entry is a symlink - and the last target of the link chain is not a regular file - returns false and the last target of the link chain is a regular file returns true + and the last target of the link chain is not a regular file + returns false + when the entry is not a regular file + returns false when the entry is a regular file returns true when dereference is false + when the entry is not a regular file + returns false when the entry is a regular file returns true when the entry is a symlink - and the last target of the link chain is not a regular file - returns false and the last target of the link chain is a regular file returns false - when the entry is not a regular file - returns false - #chardev? - when the file is not a character device - returns false - when the file is a character device - returns true - #dev - returns an integer representing the device on which stat resides - #writable_real? - when the file is executable by anyone + and the last target of the link chain is not a regular file + returns false + #blksize + returns the block size of the file + #entry + returns the comcerned entry + .new + when optional dereference argument is set to true + when the last target of the link chain does not exist + raises an exception + #readable_real? + when the file is readable by anyone and the user has no specific right on it returns true - when the file is not executable by anyone - return false when the file does not exist returns false - when the file is user executable + when the file is not readable by anyone + return false + when the file is user readable and the current user owns the file returns true + when the file is group readable + and the current user is part of the owner group + returns true + #owned? + when the effective user does not own of the file + returns false (PENDING: Temporarily skipped with xit) + when the effective user owns of the file + returns true + #atime + returns the access time of the entry + when the entry is a symlink + and the optional dereference argument is false + returns the access time of the symlink itself + and the optional dereference argument is true + returns the access time of the last target of the link chain + #writable_real? + when the file is not executable by anyone + return false when the file is group executable and the current user is part of the owner group returns true - #executable? when the file does not exist returns false when the file is user executable @@ -1244,71 +1279,118 @@ when the file is executable by anyone and the user has no specific right on it returns true - when the file is not executable by anyone - return false - when the file is group executable - and the current user is part of the owner group - returns true + #ino + returns the inode number for stat. + #world_writable? + when +file_name+ is not writable by others + returns nil + when +file_name+ is writable by others + returns an integer representing the file permission bits of +file_name+ + #dev + returns an integer representing the device on which stat resides #sticky? - returns false if the named file hasn't' the sticky bit set returns true if the named file has the sticky bit set - #symlink? - when dereference is true - when the entry is a symlink - returns false - when the entry is not a symlink - returns false - when dereference is false - when the entry is not a symlink - returns false - when the entry is a symlink - returns true - #setuid? - when the file does not have the setuid bit set - returns false - when the file has the setuid bit set + returns false if the named file hasn't' the sticky bit set + #grpowned? + when the effective user group owns of the file returns true - #entry - returns the comcerned entry + when the effective user group does not own of the file + returns false (PENDING: Temporarily skipped with xit) #ftype + when the entry is a regular file + returns 'file' + when the entry is a block device + returns 'blockSpecial' when the entry has no specific type returns 'unknown' when the entry is a character device returns 'characterSpecial' - when the entry is a regular file - returns 'file' - when the entry is a symlink - returns 'link' when the entry is a directory returns 'directory' - when the entry is a block device - returns 'blockSpecial' + when the entry is a symlink + returns 'link' #writable? + when the file is not executable by anyone + return false when the file is group executable and the current user is part of the owner group returns true when the file is executable by anyone and the user has no specific right on it returns true - when the file is not executable by anyone - return false when the file is user executable and the current user owns the file returns true when the file does not exist returns false + #readable? + when the file is readable by anyone + and the user has no specific right on it + returns true + when the file is user readable + and the current user owns the file + returns true + when the file is not readable by anyone + return false + when the file is group readable + and the current user is part of the owner group + returns true #pipe? when the file is not a pipe returns false - #owned? - when the effective user owns of the file + #zero? + when the file has a zero size returns true - when the effective user does not own of the file - returns false (PENDING: Temporarily skipped with xit) - #socket? - when the file is not a socket + when the file does not have a zero size + returns false + #uid + returns the user id of the named entry + #executable_real? + when the file is not executable by anyone + return false + when the file is user executable + and the current user owns the file + returns true + when the file does not exist + returns false + when the file is executable by anyone + and the user has no specific right on it + returns true + when the file is group executable + and the current user is part of the owner group + returns true + #gid + returns the group id of the named entry + #executable? + when the file is group executable + and the current user is part of the owner group + returns true + when the file is user executable + and the current user owns the file + returns true + when the file is executable by anyone + and the user has no specific right on it + returns true + when the file does not exist returns false + when the file is not executable by anyone + return false + #world_reable? + when +file_name+ is not readable by others + returns nil + when +file_name+ is readable by others + returns an integer representing the file permission bits of +file_name+ #directory? + when dereference is false + when the entry is a directory + returns true + when the entry is a symlink + and the last target of the link chain is a directory + returns false + and the last target of the link chain is not a directory + returns false + when the entry is not a directory + returns false when dereference is true when the entry is a directory returns true @@ -1319,79 +1401,796 @@ returns true and the last target of the link chain is not a directory returns false + #chardev? + when the file is not a character device + returns false + when the file is a character device + returns true + #symlink? when dereference is false - when the entry is a directory + when the entry is not a symlink + returns false + when the entry is a symlink returns true + when dereference is true + when the entry is not a symlink + returns false when the entry is a symlink - and the last target of the link chain is not a directory - returns false - and the last target of the link chain is a directory - returns false - when the entry is not a directory returns false - #executable_real? - when the file is group executable - and the current user is part of the owner group + #ctime + returns the access time of the entry + when the entry is a symlink + and the optional dereference argument is false + returns the access time of the symlink itself + and the optional dereference argument is true + returns the access time of the last target of the link chain + +MemFs::Dir + is Enumerable + .tmpdir + returns /tmp + .pwd + behaves like aliased method + #getwd + .delete + behaves like aliased method + #rmdir + .foreach + when a block is given + passes each entry as a parameter to the block + calls the block once for each entry in the named directory + and the directory doesn't exist + raises an exception + and the given path is not a directory + raises an exception + when no block is given + returns an enumerator + and the given path is not a directory + returns an enumerator + and the directory doesn't exist + returns an enumerator + #pos= + seeks to a particular location in dir + returns the given position + when the location has not been seeked yet + doesn't change the location + when the location is negative + doesn't change the location + [] + when a string is given + acts like calling glob + when a list of strings is given + acts like calling glob + #seek + seeks to a particular location in dir + returns the dir itself + when the location is negative + doesn't change the location + when the location has not been seeked yet + doesn't change the location + .chroot + changes the process's idea of the file system root + returns zero + when the user is not root + raises an exception + when the given path doesn't exist + raises an exception + when the given path is a file + raises an exception + .new + when the given path is not a directory + raises an exception + when the given directory doesn't exist + raises an exception + #rewind + returns the dir itself + repositions dir to the first entry + .mkdir + sets directory permissions to default 0777 + creates a directory + when the directory already exist + raises an exception + when permissions are specified + sets directory permissions to specified value + #path + returns the path parameter passed to dir's constructor + #to_path + returns the path parameter passed to dir's constructor + .glob + when a flag is given + uses it to compare filenames + behaves like returning matching filenames + with /test[^2] + behaves like returning matching filenames + with /test[01] + behaves like returning matching filenames + with /test* + when pattern is an array of patterns + returns the list of files matching any pattern + behaves like returning matching filenames + with /* + behaves like returning matching filenames + with / + behaves like returning matching filenames + with /*es* + behaves like returning matching filenames + with /*0 + behaves like returning matching filenames + with /* + behaves like returning matching filenames + with /**/file0 + behaves like returning matching filenames + with /test0 + behaves like returning matching filenames + with /test{1,2} + behaves like returning matching filenames + with /test? + when a block is given + returns nil + calls the block with every matching filenames + behaves like returning matching filenames + with / + .exist? + behaves like aliased method + #exists? + #close + closes the directory + #read + reads the next entry from dir and returns it + when calling several times + returns the next entry each time + when there are no entries left + returns nil + .unlink + behaves like aliased method + #rmdir + .home + returns the home directory of the current user (PENDING: Temporarily skipped with xit) + when a username is given + returns the home directory of the given user (PENDING: Temporarily skipped with xit) + #pos + returns the current position in dir + .rmdir + deletes the named directory + when the directory is not empty + raises an exception + .exists? + returns false if the given +path+ does not exist + returns true if the given +path+ exists and is a directory + returns false if the given +path+ is not a directory + .getwd + returns the path to the current working directory + .chdir + returns zero + changes the current working directory + raises an error when the folder does not exist + when a block is given + changes current working directory for the block + gets back to previous directory once the block is finished + #each + passes the filename of each entry as a parameter to the block + calls the block once for each entry in this directory + when no block is given + returns an enumerator + .open + when a block is given + returns nil + ensures the directory is closed + calls the block with the opened directory as argument + when the given directory doesn't exist + raises an exception + when no block is given + returns the opened directory + when the given path is not a directory + raises an exception + .entries + returns an array containing all of the filenames in the given directory + #tell + returns the current position in dir + +MemFs::Fake::Entry + behaves like it has accessors for + ctime + behaves like it has accessors for + mode + behaves like it has accessors for + uid + behaves like it has accessors for + character_device + behaves like it has accessors for + block_device + #ino + Returns the inode number for the entry + behaves like it has accessors for + mtime + #path + returns the complete path of the entry + #type + returns 'unknown + #delete + removes the entry from its parent + behaves like it has accessors for + gid + paths + returns an array containing the entry path + behaves like it has accessors for + parent + #dereferenced_name + returns the entry name + #find + raises an error + #dereferenced + returns the entry itself + #dev + returns an integer representing the device on which the entry resides + behaves like it has accessors for + atime + #touch + sets the modification time to now + sets the access time to now + .new + sets its default uid to the current user's uid + sets its default gid to the current user's gid + sets the modification time + sets the access time + sets atime and mtime to the same value + extract its name from the path passed as argument + sets an empty string as name if none is given + behaves like it has accessors for + name + #dereferenced_path + returns the entry path + +MemFs + .activate + calls the given block with MemFs activated + resets the original classes once finished + deactivates MemFs even when an exception occurs + .halt + maintains the state of the faked fs + switches back to the original Ruby Dir & File classes + switches back to the faked Dir & File classes no matter what + switches back to the faked Dir & File classes + .deactivate! + sets back the Ruby File class to the original one + sets back the Ruby Dir class to the original one + .touch + creates the specified file + when several files are specified + creates every file + when the parent folder do not exist + creates them all + .activate! + replaces Ruby Dir class with a fake one + replaces Ruby File class with a fake one + +FileUtils + .ln_s + creates a symbolic link which points to +old+ + creates a symbolic link +new+ + when +new+ already exists + and it is a directory + creates a symbolic link +new/old+ + and it is not a directory + raises an exeption + and +:force+ is set + overwrites +new+ + when passing a list of paths + creates several symbolic links in +destdir+ + creates symbolic links pointing to each item in the list + when +destdir+ is not a directory + raises an error + .mkdir_p + creates a directory + creates all the parent directories + when passing a list of paths + creates each directory + creates each directory's parents + when passing options + when passing noop parameter + does not create any directories + when passing mode parameter + creates directory with specified permissions + .copy_entry + preserves file types + copies a file system entry +src+ to +dest+ + when +preserve+ is true + preserves group + preserves owner + preserves permissions + preserves modified time + when +src+ is a directory + copies its contents recursively + when +dest+ already exists + overwrite it + when +src+ does not exist + raises an exception + when +remove_destination+ is true + removes each destination file before copy + .remove_file + removes a file path + when +force+ is set + ignores StandardError + .cp_r + copies +src+ to +dest+ + when +dest+ is a directory + copies +src+ to +dest/src+ + when +src+ is a directory + copies all its contents recursively + when +src+ is a list of files + copies each of them in +dest+ + .makedirs + behaves like aliased method + #mkdir_p + .copy_file + copies file contents of src to dest + .rm + removes the specified file + cannot remove a directory + removes files specified in list + when +:force+ is set + ignores StandardError + .install + copies +src+ to +dest+ + when +dest+ already exists + removes destination before copy + and +dest+ is a directory + installs +src+ in dest/src + when +src+ and +dest+ are the same file + raises an exception + when +:mode+ is set + changes the permission mode to +mode+ + .link + behaves like aliased method + #ln + .chown + doesn't change group if group is nil + changes owner on the named files (in list) + changes owner on the named file + changes group on the named entries in list + changes group on the named entry + doesn't change user if user is nil + when the name entry is a symlink + doesn't change the group of the symlink + doesn't change the owner of the symlink + changes the group on the last target of the link chain + changes the owner on the last target of the link chain + .rm_r + removes a list of files + when an item of the list is a directory + removes all its contents recursively + when +:force+ is set + ignores StandardError + .symlink + behaves like aliased method + #ln_s + .compare_file + returns true if the contents of a file A and a file B are identical + returns false if the contents of a file A and a file B are not identical + .uptodate? + returns true if +newer+ is newer than all +old_list+ + when +newer+ does not exist + consideres it as older + when a item of +old_list+ does not exist + consideres it as older than +newer+ + .chmod + raises an error if an entry does not exist + changes permission bits on the named files (in list) to the bit pattern represented by mode + changes permission bits on the named file to the bit pattern represented by mode + returns an array containing the file names + when the named file is a symlink + when File responds to lchmod + changes the mode on the link + doesn't change the mode of the link's target + when File doesn't respond to lchmod + does nothing + .mv + removes +src+ + moves +src+ to +dest+ + when +dest+ already exists + and +dest+ is not a directory + it overwrites +dest+ + and is a directory + moves +src+ to dest/src + .cd + raises an error when the given path is not a directory + raises an error when the given path doesn't exist + changes the current working directory + returns nil + when the destination is a symlink + raises an error if the last target of the link chain doesn't exist + changes directory to the last target of the link chain + when called with a block + changes current working directory for the block execution + resumes to the old working directory after the block execution finished + .getwd + behaves like aliased method + #pwd + .cmp + behaves like aliased method + #compare_file + .identical? + behaves like aliased method + #compare_file + .rm_f + calls rm with +:force+ set to true + .chmod_R + changes the permission bits on the named entry + changes the permission bits on any descendant file of the named entry + changes the permission bits on any sub-directory of the named entry + .rmtree + behaves like aliased method + #rm_rf + .rmdir + Removes a directory + Removes a list of directories + when a directory is not empty + doesn’t remove the directory + raises an error + .move + behaves like aliased method + #mv + .remove_entry + removes a file system entry +path+ + when +path+ is a directory + removes it recursively + .touch + creates a file if it doesn't exist + creates a list of files if they don't exist + .chown_R + changes the group on the named entry + changes the group on any descendant file of the named entry + changes the group on any sub-directory of the named entry + changes the owner on any sub-directory of the named entry + changes the owner on the named entry + changes the owner on any descendant file of the named entry + .mkdir + creates one directory + when passing options + when passing noop parameter + does not create any directories + when passing mode parameter + creates directory with specified permissions + when passing a list of paths + creates several directories + .mkpath + behaves like aliased method + #mkdir_p + .copy + behaves like aliased method + #cp + .pwd + returns the name of the current directory + .remove_entry_secure + removes a file system entry +path+ + when +path+ is a directory + removes it recursively + and is word writable + calls chmod(2) on all sub directories + calls chown(2) on it + .remove + behaves like aliased method + #rm + .ln + creates a hard link, not a symlink + creates a hard link +dest+ which points to +src+ + when passing a list of paths + creates a link for each path in +destdir+ + and +destdir+ is not a directory + raises an exception + when +dest+ already exists + and it is not a directory + raises an exception + and +:force+ is set + overwrites +dest+ + and is a directory + creates a link dest/src + .rm_rf + calls rm with +:force+ set to true + .compare_stream + returns false if the contents of a stream A and stream B are not identical + returns true if the contents of a stream A and stream B are identical + .ln_sf + calls ln_s with +:force+ set to true + .cp + copies a file content +src+ to +dest+ + when +dest+ is a directory + copies +src+ to +dest/src+ + when src is a list of files + when +dest+ is not a directory + raises an error + when +src+ and +dest+ are the same file + raises an error + .remove_dir + removes the given directory +dir+ + removes the contents of the given directory +dir+ + when +force+ is set + ignores standard errors + .safe_unlink + behaves like aliased method + #rm_f + +MemFs::Fake::Symlink + #find + when the symlink's target does not exist + returns nil + when the symlink's target exists + forwards the search to it + #target + returns the target of the symlink + #dereferenced_path + when the symlink's target does not exist + raises an exception + when the symlink's target exists + returns its target path + #type + returns 'link' + #content + returns the target's content + #dereferenced + returns the last target of the chain + returns the target if it's not a symlink + #dereferenced_name + when the symlink's target exists + returns its target name + when the symlink's target does not exist + returns its target name + +MemFs::File + implements Enumerable + #ctime + returns a Time object + .umask + returns the current umask value for this process + when the optional argument is given + return the previous value + sets the umask to that value + #each_byte + calls the given block once for each byte of the file + returns the file itself + when the file is not open for reading + raises an exception + when no block is given + does not raise an exception + when no block is given + returns an enumerator + #mtime + returns a Time object + .world_writable? + when file_name is writable by others + returns an integer representing the file permission bits + when file_name is not writable by others + returns nil + #close + closes the file stream + #size + returns the size of the file + .split + splits the given string into a directory and a file component + .symlink? + when the named entry is not a symlink + returns false + when the named entry is a symlink + returns true + when the named entry does not exist + returns false + #each + calls the block for every line in the file + returns the file itself + when a separator is given + uses this separator to split lines + when no block is given + returns an enumerator + when the file is not open for reading + raises an exception + when no block is given + does not raise an exception + .stat + returns a File::Stat object for the named file + always returns a new object + follows the last symbolic link + when the named file is a symlink + and its target does not exist + raises an exception + when the named file does not exist + raises an exception + #close_on_exec? + returns true by default + when the close-on-exec flag is set to false + returns false + #printf + appends the string in the file + converts parameters under control of the format string + returns nil + .basename + returns the last component of the filename given in +file_name+ + when +suffix+ is given + when it is present at the end of +file_name+ + removes the +suffix+ from the filename basename + .writable_real? + when the file is writable by anyone + and the user has no specific right on it returns true when the file does not exist returns false - when the file is user executable + when the file is group writable + and the current user is part of the owner group + returns true + when the file is user writable and the current user owns the file returns true - when the file is not executable by anyone + when the file is not writable by anyone return false - when the file is executable by anyone + #atime + returns a Time object + .ctime + returns the change time for the named file as a Time object + raises an error if the entry does not exist + when the entry is a symlink + returns the last access time of the last target of the link chain + .link + creates a new name for an existing file using a hard link + returns zero + when +old_name+ does not exist + raises an exception + when +new_name+ already exists + raises an exception + .rename + returns zero + renames the given file to the new name + #print + appends the given object to the file + returns nil + converts any given object to string with to_s + when the output field separator is not nil + inserts it between the objects + when the output field separator is nil + inserts nothing between the objects + when no argument is given + prints $_ (PENDING: I don't know how to test with $_) + when the output record separator is not nil + inserts it at the end of the output + when multiple objects are given + appends the given objects to the file + when the is not opened for writing + raises an exception + when the output record separator is nil + inserts nothing at the end of the output + #pos + returns zero when the file was just opened + returns the reading offset when some of the file has been read + .join + returns a new string formed by joining the strings using File::SEPARATOR + #read + when no length is given + returns the content of the named file + returns an empty string if called a second time + when a length is given + returns a string of the given length + returns nil when there is nothing more to read + when a buffer is given + fills the buffer with the read content + .size + returns the size of the file + .writable? + when the file is user writable + and the current user owns the file + returns true + when the file is writable by anyone and the user has no specific right on it returns true - -MemFs::Fake::File::Content + when the file is not writable by anyone + return false + when the file is group writable + and the current user is part of the owner group + returns true + when the file does not exist + returns false + .write + writes the string to the given file + when +offset+ is provided + raises an error if offset is a string + writes the string to the given file when offset is 0 + raises an error if offset is a boolean + starts writing from the offset (PENDING: Offsets not yet implemented in IO.write) + writes the string to the given file when offset is nil + raises an error if offset is negative + #seek + returns zero + when +whence+ is IO::SEEK_END + seeks to +amount+ plus end of stream + when +whence+ is IO::SEEK_CUR + seeks to +amount+ plus current position + when +whence+ is IO::SEEK_SET + seeks to the absolute location given by +amount+ + when +whence+ is invalid + raises an exception + if the position ends up to be less than zero + raises an exception + when +whence+ is not provided + seeks to the absolute location given by +amount+ + #chmod + changes permission bits on the file + returns zero + .expand_path + references path from the current working directory + converts a pathname to an absolute pathname + when +dir_string+ is provided + uses +dir_string+ as the stating point + .chown + changes owner on the named files (in list) + ignores -1 group id + changes the group of the named file to the given numeric group id + ignores -1 user id + ignores nil group id + returns the number of files + ignores nil user id + changes the owner of the named file to the given numeric owner id + when the named entry is a symlink + changes the group on the last target of the link chain + does not change the owner of the symlink + does not change the group of the symlink + changes the owner on the last target of the link chain + #path + returns the path of the file + .setuid? + when the named file does not exist + returns false + when the named file exists + and the named file does not have the setuid bit set + returns false + and the named file has the setuid bit set + returns true + .socket? + when the named file is not a socket + returns false + .readable_real? + when the file is not readable by anyone + return false + when the file is user readable + and the current user owns the file + returns true + when the file does not exist + returns false + when the file is group readable + and the current user is part of the owner group + returns true + when the file is readable by anyone + and the user has no specific right on it + returns true + .blockdev? + when the name file exists + and it is not a block device + returns false + and it is a block device + returns true + when the name file does not exist + returns false + .zero? + when the named file does not exist + returns false + when the named file exists + and does not have a zero size + returns false + and has a zero size + returns true + .unlink + returns the number of names passed as arguments + deletes the named file + when multiple file names are given + deletes the named files + when the entry is a directory + raises an exception #truncate - truncates the content to length characters - #to_s - when the content is empty - returns an empty string - when the content is not empty - returns the content's string - #write - writes the given string in content - returns the number of bytes written - when the argument is not a string - converts it to a string - when the argument is a non-ascii string - returns the correct number of bytes written - #<< - writes the given string to the contained string - #puts - appends the given string to the contained string - appends all given strings to the contained string - when a line break is present at the end of the given string - doesn't add any line break - #initialize - when an argument is given - when the argument is a string - duplicates the original string to prevent modifications on it - initialize the contained string with the given one - when the argument is not a string - converts it to a string - when no argument is given - initialize the contained string to an empty one - when initialized with a string argument - #read - reads +length+ bytes from the contained string - when the optional +buffer+ argument is provided - inserts the output in the buffer - when there is nothing else to read - returns nil - #close - responds to close - #pos - when the string has been read - returns the current offset - when the string has not been read - returns 0 - -MemFs::File - implements Enumerable + truncates the given file to be at most integer bytes long + returns zero + #stat + returns the +Stat+ object of the file + .readlink + returns the name of the file referenced by the given link + constants + expose ALT_SEPARATOR + expose SEPARATOR .extname returns the extension of the given path when the period is the last character in path @@ -1407,57 +2206,33 @@ does not expanded when +dir_string+ is given uses it as the starting point - .chmod - changes permission bits on the named files (in list) - changes permission bits on the named file - .size? + #lstat + returns the File::Stat object of the file + when the given file is a symlink + does not follow the last symbolic link + .setgid? when the named file does not exist returns false when the named file exists - and it is empty + and the named file does not have the setgid bit set returns false - and it is not empty - returns the size of the file - .realpath - when a part of the given path does not exist - raises an exception - when the path contains useless dots - returns the path with the useless dots interpolated - when the given path is relative - and +dir_string+ is not provided - uses the current working directory has base directory - and +dir_string+ is provided - uses the given directory has base directory - when the path contains a symlink - and the symlink is the last part - returns the path with the symlink dereferrenced - and the symlink is a middle part - returns the path with the symlink dereferrenced - when the path does not contain any symlink or useless dots - returns the path itself - #binmode? - returns false by default - when the file is in binmode - returns true - #each - calls the block for every line in the file - returns the file itself - when the file is not open for reading + and the named file has the setgid bit set + returns true + #<< + can be chained + writes the given string in the file + when the file is not opened for writing raises an exception - when no block is given - does not raise an exception - when no block is given - returns an enumerator - when a separator is given - uses this separator to split lines - .fnmatch? - behaves like aliased method - #fnmatch - #ctime - returns a Time object - .rename - renames the given file to the new name - returns zero + when the given object is not a string + converts the object to a string with to_s + .grpowned? + when the named file exists + and the effective user group owns of the file + returns true + and the effective user group does not own of the file + returns false (PENDING: Temporarily skipped with xit) + when the named file does not exist + returns false .truncate returns zero truncates the named file to the given size @@ -1465,466 +2240,308 @@ raises an exception when the given size is negative it raises an exception - #eof? - when the file is not empty - and the file is read - returns true - and the file is not yet read - returns true - when the file is not empty - and the file is not yet read - returns false - and the file is read + .symlink + creates a symbolic link named new_name + creates a symbolic link that points to an entry named old_name + returns 0 + when the target does not exist + creates a symbolic link + .sticky? + when the named file does not exist + returns false + when the named file exists + returns true if the named file has the sticky bit set + returns false if the named file hasn’t the sticky bit set + #external_encoding + returns the Encoding object representing the file encoding + when the file is open in write mode + and no encoding has been specified + returns nil + and an encoding has been specified + returns the Encoding + .chardev? + when the name file exists + and it is a character device returns true - and the file is partly read + and it is not a character device returns false - .world_readable? - when file_name is not readable by others - returns nil - when file_name is readable by others - returns an integer representing the file permission bits - #lstat - returns the File::Stat object of the file - when the given file is a symlink - does not follow the last symbolic link + when the name file does not exist + returns false + .pipe? + when the named file is not a pipe + returns false + .utime + raises en error if the entry does not exist + sets the modification time of each named file to the second argument + sets the access time of each named file to the first argument + returns the number of file names in the argument list + .exist? + behaves like aliased method + #exists? + #write + returns the number of bytes written + writes the given string to file + when the file is not opened for writing + raises an exception + when the argument is not a string + will be converted to a string using to_s + .directory? + when the named entry is a directory + returns true + when the named entry is not a directory + returns false .atime raises an error if the entry does not exist returns the last access time for the named file as a Time object when the entry is a symlink returns the last access time of the last target of the link chain - .realdirpath - when the last part of the given path does not exist - uses its name in the resulting path - when a middle part of the given path does not exist + .new + resets the file position to the beginning + when no argument is given + raises an exception + when only the filename is provided + and the file exists + returns the open file + and the file does not exist + raises an exception + when the file is a symlink and its target does not exist + raises an exception + when too many arguments are given + raises an exception + when the mode is provided + and it specifies that the file must be truncated + and the file already exists + truncates its content + and it is an integer + sets the mode to the integer value + and it is a string + sets the read+write+create+truncate mode for "w+" + handles the |utf-8 option + handles the :bom option + handles the :bom|utf-8 option + sets the read+write+create+append mode for "a+" + sets the read mode for "r" + sets the write+create+truncate mode for "w" + sets the write+create+append mode for "a" + sets the read+write mode for "r+" + and it specifies that the file must be created + and the file already exists + changes the mtime of the file + .fnmatch? + behaves like aliased method + #fnmatch + #flock + returns zero + .path + when the path is a string + returns the string representation of the path + when the path is a Pathname + returns the string representation of the path + .realpath + when a part of the given path does not exist raises an exception - when the path does not contain any symlink or useless dots - returns the path itself when the given path is relative - and +dir_string+ is provided - uses the given directory has base directory and +dir_string+ is not provided uses the current working directory has base directory + and +dir_string+ is provided + uses the given directory has base directory + when the path does not contain any symlink or useless dots + returns the path itself + when the path contains useless dots + returns the path with the useless dots interpolated when the path contains a symlink and the symlink is a middle part returns the path with the symlink dereferrenced and the symlink is the last part returns the path with the symlink dereferrenced - when the path contains useless dots - returns the path with the useless dots interpolated - when the last part of the given path is a symlink - and its target does not exist - uses the name of the target in the resulting path - .exist? - behaves like aliased method - #exists? - .size - returns the size of the file - #flock - returns zero - .dirname - returns all components of the filename given in +file_name+ except the last one - returns / if file_name is / - .stat - follows the last symbolic link - returns a File::Stat object for the named file - always returns a new object - when the named file does not exist - raises an exception - when the named file is a symlink - and its target does not exist - raises an exception - .file? - when the named file exists - and it is not a regular file - returns false - and it is a regular file + .executable? + when the file is group executable + and the current user is part of the owner group returns true - when the named file does not exist - returns false - #closed? - returns false when the file is open - returns true when the file is closed - #bytes - behaves like aliased method - #each_byte - .umask - returns the current umask value for this process - when the optional argument is given - sets the umask to that value - return the previous value - .symlink? - when the named entry is not a symlink - returns false - when the named entry does not exist + when the file does not exist returns false - when the named entry is a symlink - returns true - #pos - returns zero when the file was just opened - returns the reading offset when some of the file has been read - .unlink - deletes the named file - returns the number of names passed as arguments - when multiple file names are given - deletes the named files - when the entry is a directory - raises an exception + when the file is user executable + and the current user owns the file + returns true + when the file is executable by anyone + and the user has no specific right on it + returns true + when the file is not executable by anyone + return false #advise returns nil - when a wrong advise type is given - raises an exception behaves like advise working - when the :willneed advise type is given + when the :random advise type is given does not raise an error behaves like advise working - when the :sequential advise type is given + when the :normal advise type is given does not raise an error behaves like advise working - when the :random advise type is given + when the :sequential advise type is given does not raise an error behaves like advise working when the :noreuse advise type is given does not raise an error behaves like advise working - when the :normal advise type is given + when the :dontneed advise type is given does not raise an error behaves like advise working - when the :dontneed advise type is given + when the :willneed advise type is given does not raise an error + when a wrong advise type is given + raises an exception .executable_real? when the file is group executable and the current user is part of the owner group returns true - when the file is not executable by anyone - return false - when the file is user executable - and the current user owns the file - returns true - when the file does not exist - returns false when the file is executable by anyone and the user has no specific right on it returns true - .utime - sets the modification time of each named file to the second argument - sets the access time of each named file to the first argument - raises en error if the entry does not exist - returns the number of file names in the argument list - .join - returns a new string formed by joining the strings using File::SEPARATOR - .readable_real? - when the file is group readable - and the current user is part of the owner group - returns true - when the file is not readable by anyone - return false - when the file is user readable - and the current user owns the file - returns true - when the file is readable by anyone - and the user has no specific right on it - returns true when the file does not exist returns false - #seek - returns zero - when +whence+ is invalid - raises an exception - when +whence+ is IO::SEEK_CUR - seeks to +amount+ plus current position - when +whence+ is not provided - seeks to the absolute location given by +amount+ - when +whence+ is IO::SEEK_SET - seeks to the absolute location given by +amount+ - when +whence+ is IO::SEEK_END - seeks to +amount+ plus end of stream - if the position ends up to be less than zero - raises an exception - .basename - returns the last component of the filename given in +file_name+ - when +suffix+ is given - when it is present at the end of +file_name+ - removes the +suffix+ from the filename basename - #printf - returns nil - converts parameters under control of the format string - appends the string in the file - .executable? when the file is not executable by anyone return false - when the file does not exist - returns false - when the file is group executable - and the current user is part of the owner group - returns true when the file is user executable and the current user owns the file returns true - when the file is executable by anyone - and the user has no specific right on it - returns true - .split - splits the given string into a directory and a file component - #autoclose= - sets the autoclose flag - .fnmatch - when the given path matches against the given pattern - returns true - when the given path does not match against the given pattern - returns false - .readable? - when the file does not exist - returns false - when the file is group readable - and the current user is part of the owner group - returns true - when the file is not readable by anyone - return false - when the file is readable by anyone - and the user has no specific right on it - returns true - when the file is user readable - and the current user owns the file - returns true - .new - resets the file position to the beginning - when too many arguments are given - raises an exception - when only the filename is provided - and the file exists - returns the open file - and the file does not exist - raises an exception - when the file is a symlink and its target does not exist - raises an exception - when no argument is given - raises an exception - when the mode is provided - and it is a string - sets the write+create+truncate mode for "w" - sets the read mode for "r" - sets the read+write+create+append mode for "a+" - sets the read+write+create+truncate mode for "w+" - sets the write+create+append mode for "a" - handles the |utf-8 option - handles the :bom option - handles the :bom|utf-8 option - sets the read+write mode for "r+" - and it specifies that the file must be created - and the file already exists - changes the mtime of the file - and it specifies that the file must be truncated - and the file already exists - truncates its content - and it is an integer - sets the mode to the integer value - #<< - can be chained - writes the given string in the file - when the file is not opened for writing + .lstat + returns a File::Stat object for the named file + when the named file is a symlink + does not follow the last symbolic link + when the named file does not exist raises an exception - when the given object is not a string - converts the object to a string with to_s - .identical? - when the two paths are symlinks - and both links point to the same file - returns true - and both links do not point to the same file - returns false - when a path is a symlink - and the linked file is different from the other path - returns false - and the linked file is the same as the other path - returns true - when two paths do not represent the same file - returns false - when two paths represent the same path - returns true - when one of the paths does not exist - returns false - .chown + #chown + ignores -1 user id + changes the owner of the named file to the given numeric owner id changes owner on the named files (in list) - returns the number of files - ignores nil group id - changes the group of the named file to the given numeric group id ignores nil user id - changes the owner of the named file to the given numeric owner id - ignores -1 user id + ignores nil group id ignores -1 group id + returns zero + changes the group of the named file to the given numeric group id when the named entry is a symlink - does not change the group of the symlink changes the group on the last target of the link chain - does not change the owner of the symlink changes the owner on the last target of the link chain - .symlink - creates a symbolic link named new_name - returns 0 - creates a symbolic link that points to an entry named old_name - when the target does not exist - creates a symbolic link - .readlink - returns the name of the file referenced by the given link + does not change the owner of the symlink + does not change the group of the symlink + #chars + behaves like aliased method + #each_char .delete behaves like aliased method #unlink #binmode sets the file encoding to ASCII-8BIT - returns the file itself sets the binmode flag for the file - #print - converts any given object to string with to_s - appends the given object to the file - returns nil - when the output field separator is nil - inserts nothing between the objects - when no argument is given - prints $_ (PENDING: I don't know how to test with $_) - when the output record separator is not nil - inserts it at the end of the output - when the output record separator is nil - inserts nothing at the end of the output - when multiple objects are given - appends the given objects to the file - when the output field separator is not nil - inserts it between the objects - when the is not opened for writing - raises an exception - .sticky? - when the named file exists - returns false if the named file hasn’t the sticky bit set - returns true if the named file has the sticky bit set - when the named file does not exist - returns false - .setgid? - when the named file does not exist + returns the file itself + #bytes + behaves like aliased method + #each_byte + .dirname + returns all components of the filename given in +file_name+ except the last one + returns / if file_name is / + #autoclose? + returns true by default + when the file will not be automatically closed returns false + when the file will be automatically closed + returns true + #eof + behaves like aliased method + #eof? + .owned? when the named file exists - and the named file has the setgid bit set + and the effective user owns of the file returns true - and the named file does not have the setgid bit set - returns false - #atime - returns a Time object - .setuid? + and the effective user does not own of the file + returns false (PENDING: Temporarily skipped with xit) when the named file does not exist returns false - when the named file exists - and the named file has the setuid bit set - returns true - and the named file does not have the setuid bit set - returns false - #chown - changes the group of the named file to the given numeric group id - changes the owner of the named file to the given numeric owner id - ignores nil user id - changes owner on the named files (in list) - ignores nil group id - ignores -1 group id - ignores -1 user id - returns zero - when the named entry is a symlink - does not change the owner of the symlink - changes the owner on the last target of the link chain - does not change the group of the symlink - changes the group on the last target of the link chain - #puts - appends content to the file - does not override the file’s content - when the file is not writable - raises an exception - #size - returns the size of the file - .link - returns zero - creates a new name for an existing file using a hard link - when +new_name+ already exists - raises an exception - when +old_name+ does not exist - raises an exception - .socket? - when the named file is not a socket - returns false - .world_writable? - when file_name is writable by others + .world_readable? + when file_name is readable by others returns an integer representing the file permission bits - when file_name is not writable by others + when file_name is not readable by others returns nil + #autoclose= + sets the autoclose flag + #binmode? + returns false by default + when the file is in binmode + returns true + .chmod + changes permission bits on the named file + changes permission bits on the named files (in list) + .size? + when the named file does not exist + returns false + when the named file exists + and it is not empty + returns the size of the file + and it is empty + returns false .lchmod when the named file is a symlink - does not change permission bits on the link’s target changes permission bits on the symlink + does not change permission bits on the link’s target when the named file is a regular file acts like chmod - .writable_real? - when the file does not exist - returns false - when the file is group writable - and the current user is part of the owner group - returns true - when the file is not writable by anyone - return false - when the file is writable by anyone - and the user has no specific right on it - returns true - when the file is user writable - and the current user owns the file - returns true - #read - when a buffer is given - fills the buffer with the read content - when no length is given - returns an empty string if called a second time - returns the content of the named file - when a length is given - returns a string of the given length - returns nil when there is nothing more to read - #stat - returns the +Stat+ object of the file #each_char - returns the file itself calls the given block once for each byte of the file + returns the file itself when the file is not open for reading raises an exception when no block is given does not raise an exception when no block is given returns an enumerator - constants - expose SEPARATOR - expose ALT_SEPARATOR - #chmod - returns zero - changes permission bits on the file - .write - writes the string to the given file - when +offset+ is provided - starts writing from the offset (PENDING: Offsets not yet implemented in IO.write) - writes the string to the given file when offset is nil - raises an error if offset is a string - writes the string to the given file when offset is 0 - raises an error if offset is negative - raises an error if offset is a boolean - .zero? - when the named file does not exist + #closed? + returns false when the file is open + returns true when the file is closed + .exists? + when the file does not exist returns false - when the named file exists - and has a zero size + when the file exists + returns true + #puts + does not override the file’s content + appends content to the file + when the file is not writable + raises an exception + .realdirpath + when the path contains a symlink + and the symlink is the last part + returns the path with the symlink dereferrenced + and the symlink is a middle part + returns the path with the symlink dereferrenced + when the path contains useless dots + returns the path with the useless dots interpolated + when the last part of the given path does not exist + uses its name in the resulting path + when a middle part of the given path does not exist + raises an exception + when the given path is relative + and +dir_string+ is not provided + uses the current working directory has base directory + and +dir_string+ is provided + uses the given directory has base directory + when the last part of the given path is a symlink + and its target does not exist + uses the name of the target in the resulting path + when the path does not contain any symlink or useless dots + returns the path itself + #eof? + when the file is not empty + and the file is read returns true - and does not have a zero size + and the file is not yet read returns false - #close - closes the file stream - #autoclose? - returns true by default - when the file will not be automatically closed - returns false - when the file will be automatically closed - returns true - .ctime - returns the change time for the named file as a Time object - raises an error if the entry does not exist - when the entry is a symlink - returns the last access time of the last target of the link chain + and the file is partly read + returns false + when the file is not empty + and the file is read + returns true + and the file is not yet read + returns true .read reads the content of the given file when +offset+ is provided @@ -1938,558 +2555,123 @@ reads only +length+ characters when +length+ is bigger than the file size reads until the end of the file - #write - writes the given string to file - returns the number of bytes written - when the argument is not a string - will be converted to a string using to_s - when the file is not opened for writing - raises an exception - .grpowned? - when the named file does not exist - returns false - when the named file exists - and the effective user group does not own of the file - returns false (PENDING: Temporarily skipped with xit) - and the effective user group owns of the file - returns true - #external_encoding - returns the Encoding object representing the file encoding - when the file is open in write mode - and no encoding has been specified - returns nil - and an encoding has been specified - returns the Encoding - #each_byte - returns the file itself - calls the given block once for each byte of the file - when the file is not open for reading - raises an exception - when no block is given - does not raise an exception - when no block is given - returns an enumerator - #mtime - returns a Time object - #close_on_exec? - returns true by default - when the close-on-exec flag is set to false - returns false - .chardev? - when the name file does not exist - returns false - when the name file exists - and it is not a character device - returns false - and it is a character device - returns true .ftype - when the named entry has no specific type - returns "unknown" + when the named entry is a block device + returns "blockSpecial" when the named entry is a directory returns "directory" + when the named entry has no specific type + returns "unknown" + when the named entry is a regular file + returns "file" when the named entry is a symlink returns "link" when the named entry is a character device returns "characterSpecial" - when the named entry is a block device - returns "blockSpecial" - when the named entry is a regular file - returns "file" - .writable? - when the file is writable by anyone - and the user has no specific right on it - returns true - when the file is user writable - and the current user owns the file + .file? + when the named file does not exist + returns false + when the named file exists + and it is a regular file returns true - when the file is group writable - and the current user is part of the owner group + and it is not a regular file + returns false + .identical? + when a path is a symlink + and the linked file is the same as the other path returns true - when the file does not exist - returns false - when the file is not writable by anyone - return false - .blockdev? - when the name file exists - and it is not a block device + and the linked file is different from the other path returns false - and it is a block device + when one of the paths does not exist + returns false + when two paths represent the same path + returns true + when the two paths are symlinks + and both links point to the same file returns true - when the name file does not exist + and both links do not point to the same file + returns false + when two paths do not represent the same file returns false - .expand_path - references path from the current working directory - converts a pathname to an absolute pathname - when +dir_string+ is provided - uses +dir_string+ as the stating point #close_on_exec= sets the close-on-exec flag on the file - #path - returns the path of the file - #truncate - returns zero - truncates the given file to be at most integer bytes long - #eof - behaves like aliased method - #eof? - .exists? + .readable? + when the file is not readable by anyone + return false + when the file is group readable + and the current user is part of the owner group + returns true + when the file is user readable + and the current user owns the file + returns true when the file does not exist returns false - when the file exists - returns true - .lstat - returns a File::Stat object for the named file - when the named file does not exist - raises an exception - when the named file is a symlink - does not follow the last symbolic link - .directory? - when the named entry is not a directory - returns false - when the named entry is a directory - returns true - .owned? - when the named file exists - and the effective user owns of the file + when the file is readable by anyone + and the user has no specific right on it returns true - and the effective user does not own of the file - returns false (PENDING: Temporarily skipped with xit) - when the named file does not exist - returns false - .pipe? - when the named file is not a pipe + .fnmatch + when the given path does not match against the given pattern returns false - .path - when the path is a Pathname - returns the string representation of the path - when the path is a string - returns the string representation of the path - #chars - behaves like aliased method - #each_char - -MemFs - .touch - creates the specified file - when several files are specified - creates every file - when the parent folder do not exist - creates them all - .halt - switches back to the original Ruby Dir & File classes - switches back to the faked Dir & File classes no matter what - maintains the state of the faked fs - switches back to the faked Dir & File classes - .activate! - replaces Ruby Dir class with a fake one - replaces Ruby File class with a fake one - .deactivate! - sets back the Ruby Dir class to the original one - sets back the Ruby File class to the original one - .activate - calls the given block with MemFs activated - resets the original classes once finished - deactivates MemFs even when an exception occurs + when the given path matches against the given pattern + returns true -FileUtils - .rm_rf - calls rm with +:force+ set to true - .uptodate? - returns true if +newer+ is newer than all +old_list+ - when a item of +old_list+ does not exist - consideres it as older than +newer+ - when +newer+ does not exist - consideres it as older - .remove_entry_secure - removes a file system entry +path+ - when +path+ is a directory - removes it recursively - and is word writable - calls chown(2) on it - calls chmod(2) on all sub directories - .remove_dir - removes the given directory +dir+ - removes the contents of the given directory +dir+ - when +force+ is set - ignores standard errors - .chmod - raises an error if an entry does not exist - returns an array containing the file names - changes permission bits on the named files (in list) to the bit pattern represented by mode - changes permission bits on the named file to the bit pattern represented by mode - when the named file is a symlink - when File doesn't respond to lchmod - does nothing - when File responds to lchmod - doesn't change the mode of the link's target - changes the mode on the link - .compare_stream - returns true if the contents of a stream A and stream B are identical - returns false if the contents of a stream A and stream B are not identical - .copy_file - copies file contents of src to dest - .copy - behaves like aliased method - #cp - .install - copies +src+ to +dest+ - when +dest+ already exists - removes destination before copy - and +dest+ is a directory - installs +src+ in dest/src - when +:mode+ is set - changes the permission mode to +mode+ - when +src+ and +dest+ are the same file - raises an exception - .remove - behaves like aliased method - #rm - .ln - creates a hard link +dest+ which points to +src+ - creates a hard link, not a symlink - when +dest+ already exists - and it is not a directory - raises an exception - and +:force+ is set - overwrites +dest+ - and is a directory - creates a link dest/src - when passing a list of paths - creates a link for each path in +destdir+ - and +destdir+ is not a directory - raises an exception - .touch - creates a list of files if they don't exist - creates a file if it doesn't exist - .remove_file - removes a file path - when +force+ is set - ignores StandardError - .ln_s - creates a symbolic link which points to +old+ - creates a symbolic link +new+ - when +new+ already exists - and it is a directory - creates a symbolic link +new/old+ - and it is not a directory - raises an exeption - and +:force+ is set - overwrites +new+ - when passing a list of paths - creates symbolic links pointing to each item in the list - creates several symbolic links in +destdir+ - when +destdir+ is not a directory - raises an error - .cmp - behaves like aliased method - #compare_file - .remove_entry - removes a file system entry +path+ - when +path+ is a directory - removes it recursively - .rm_r - removes a list of files - when +:force+ is set - ignores StandardError - when an item of the list is a directory - removes all its contents recursively - .cp_r - copies +src+ to +dest+ - when +src+ is a list of files - copies each of them in +dest+ - when +dest+ is a directory - copies +src+ to +dest/src+ - when +src+ is a directory - copies all its contents recursively - .symlink - behaves like aliased method - #ln_s - .rm - cannot remove a directory - removes files specified in list - removes the specified file - when +:force+ is set - ignores StandardError - .move - behaves like aliased method - #mv - .cd - raises an error when the given path is not a directory - returns nil - raises an error when the given path doesn't exist +MemFs::FileSystem + #find_directory! + returns the named directory + raises an error if the named entry is not a directory + #chdir + raises an error if directory does not exist + raises an error if the destination is not a directory changes the current working directory + when a block is given + gets back to previous directory once the block is finished + changes current working directory for the block when the destination is a symlink - raises an error if the last target of the link chain doesn't exist - changes directory to the last target of the link chain - when called with a block - changes current working directory for the block execution - resumes to the old working directory after the block execution finished - .mkdir - creates one directory - when passing a list of paths - creates several directories - when passing options - when passing noop parameter - does not create any directories - when passing mode parameter - creates directory with specified permissions - .compare_file - returns false if the contents of a file A and a file B are not identical - returns true if the contents of a file A and a file B are identical - .chown_R - changes the group on any sub-directory of the named entry - changes the group on any descendant file of the named entry - changes the group on the named entry - changes the owner on the named entry - changes the owner on any sub-directory of the named entry - changes the owner on any descendant file of the named entry - .mv - removes +src+ - moves +src+ to +dest+ - when +dest+ already exists - and +dest+ is not a directory - it overwrites +dest+ - and is a directory - moves +src+ to dest/src - .chmod_R - changes the permission bits on the named entry - changes the permission bits on any sub-directory of the named entry - changes the permission bits on any descendant file of the named entry - .ln_sf - calls ln_s with +:force+ set to true - .copy_entry - preserves file types - copies a file system entry +src+ to +dest+ - when +preserve+ is true - preserves permissions - preserves group - preserves owner - preserves modified time - when +remove_destination+ is true - removes each destination file before copy - when +src+ is a directory - copies its contents recursively - when +dest+ already exists - overwrite it - when +src+ does not exist - raises an exception - .rmtree - behaves like aliased method - #rm_rf - .safe_unlink - behaves like aliased method - #rm_f - .mkpath - behaves like aliased method - #mkdir_p - .makedirs - behaves like aliased method - #mkdir_p - .chown - changes group on the named entry - changes group on the named entries in list - changes owner on the named files (in list) - doesn't change group if group is nil - doesn't change user if user is nil - changes owner on the named file - when the name entry is a symlink - doesn't change the group of the symlink - changes the group on the last target of the link chain - doesn't change the owner of the symlink - changes the owner on the last target of the link chain - .mkdir_p - creates a directory - creates all the parent directories - when passing a list of paths - creates each directory's parents - creates each directory - when passing options - when passing noop parameter - does not create any directories - when passing mode parameter - creates directory with specified permissions - .pwd - returns the name of the current directory - .cp - copies a file content +src+ to +dest+ - when +src+ and +dest+ are the same file - raises an error - when src is a list of files - when +dest+ is not a directory - raises an error - when +dest+ is a directory - copies +src+ to +dest/src+ - .getwd - behaves like aliased method - #pwd - .rmdir - Removes a list of directories - Removes a directory - when a directory is not empty - doesn’t remove the directory - raises an error - .link - behaves like aliased method - #ln - .identical? - behaves like aliased method - #compare_file - .rm_f - calls rm with +:force+ set to true - -MemFs::Fake::Entry - behaves like it has accessors for - mode - behaves like it has accessors for - parent - #dev - returns an integer representing the device on which the entry resides - #find - raises an error - #delete - removes the entry from its parent - behaves like it has accessors for - ctime - behaves like it has accessors for - block_device - .new - sets an empty string as name if none is given - sets its default uid to the current user's uid - sets its default gid to the current user's gid - sets atime and mtime to the same value - sets the access time - extract its name from the path passed as argument - sets the modification time - behaves like it has accessors for - atime - #touch - sets the modification time to now - sets the access time to now - behaves like it has accessors for - mtime - behaves like it has accessors for - character_device - #path - returns the complete path of the entry - #ino - Returns the inode number for the entry - #type - returns 'unknown - #dereferenced_name - returns the entry name - behaves like it has accessors for - uid - behaves like it has accessors for - name - #dereferenced - returns the entry itself - paths - returns an array containing the entry path - behaves like it has accessors for - gid - #dereferenced_path - returns the entry path - -MemFs::Fake::Directory - #find - should remove any leading / in the path - calls find on the next directory in the search chain - returns the named entry if it is one of the entries - should remove any trailing / in the path - empty? - returns true if the directory is empty - returns false if the directory is not empty - #entry_names - returns the list of the names of the entries in the directory - #path - returns the directory path - when the directory is / - returns / - #type - returns 'directory' - #parent= - sets the parent directory - sets the .. entry in entries list - #paths - returns the path of the directory and its entries recursively - #remove_entry - removes an entry from the entries list - .new - sets . in the entries list - sets .. in the entries list - #add_entry - sets the parent of the added entry - adds the entry to the entries list - -MemFs::Fake::Symlink - #target - returns the target of the symlink - #dereferenced_path - when the symlink's target does not exist + sets current directory as the last link chain target + #rmdir + removes the given directory + when the directory is not empty raises an exception - when the symlink's target exists - returns its target path - #find - when the symlink's target exists - forwards the search to it - when the symlink's target does not exist - returns nil - #dereferenced - returns the last target of the chain - returns the target if it's not a symlink - #dereferenced_name - when the symlink's target exists - returns its target name - when the symlink's target does not exist - returns its target name - #type - returns 'link' - #content - returns the target's content - -MemFs::FileSystem - #find_parent! - returns the parent directory of the named entry - raises an error if the parent directory does not exist - raises an error if the parent is not a directory - #new - creates the root directory - #pwd - behaves like aliased method - #getwd - #entries - returns an array containing all of the filenames in the given directory + #rename + removes the old file + renames the given file to the new name + can move a file in another directory #find! when a part of the given path is a symlink and the symlink's target exists returns the entry and the symlink's target does not exist raises an exception - when there is no entry for the given path - raises an exception when the entry for the given path exists returns the entry + when there is no entry for the given path + raises an exception + #unlink + deletes the named file + when the entry is a directory + raises an exception + #symlink + creates a symbolic link + when +new_name+ already exists + raises an exception #link creates a hard link +dest+ that points to +src+ does not create a symbolic link when +new_name+ already exists raises an exception - #chmod - changes permission bits on the named file - when the named file is a symlink - changes the permission bits on the symlink itself - #getwd - returns the current working directory - #chdir - raises an error if the destination is not a directory - changes the current working directory - raises an error if directory does not exist - when the destination is a symlink - sets current directory as the last link chain target - when a block is given - changes current working directory for the block - gets back to previous directory once the block is finished + #find_parent! + raises an error if the parent is not a directory + returns the parent directory of the named entry + raises an error if the parent directory does not exist + #touch + creates a regular file + creates an entry only if it doesn't exist + creates a regular file for each named filed + when the named file already exists + sets the access time of the touched file + sets the modification time of the touched file + #new + creates the root directory #find when a part of the given path is a symlink and the symlink's target exists @@ -2500,276 +2682,128 @@ returns nil when the entry for the given path exists returns the entry - #paths - returns the list of all the existing paths - #find_directory! - raises an error if the named entry is not a directory - returns the named directory - #rmdir - removes the given directory - when the directory is not empty - raises an exception - #unlink - deletes the named file - when the entry is a directory - raises an exception - #rename - removes the old file - renames the given file to the new name - can move a file in another directory - #touch - creates a regular file - creates an entry only if it doesn't exist - creates a regular file for each named filed - when the named file already exists - sets the modification time of the touched file - sets the access time of the touched file - #clear! - clear the registred entries - sets the current directory to / + #entries + returns an array containing all of the filenames in the given directory + #getwd + returns the current working directory #chown + ignores -1 group id ignores nil group id - ignores -1 user id ignores nil user id - changes the owner of the named file to the given numeric owner id changes the group of the named file to the given numeric group id - ignores -1 group id + changes the owner of the named file to the given numeric owner id + ignores -1 user id when the named entry is a symlink - doesn't change the group of the symlink - changes the group on the last target of the link chain changes the owner on the last target of the link chain doesn't change the owner of the symlink + changes the group on the last target of the link chain + doesn't change the group of the symlink + #clear! + sets the current directory to / + clear the registred entries + #chmod + changes permission bits on the named file + when the named file is a symlink + changes the permission bits on the symlink itself #mkdir - sets directory permissions to default 0777 creates a directory - when permissions are specified - sets directory permission to specified value + sets directory permissions to default 0777 when a relative path is given creates a directory in current directory - when the directory already exists - raises an exception - #symlink - creates a symbolic link - when +new_name+ already exists - raises an exception - -MemFs::Dir - is Enumerable - .chdir - raises an error when the folder does not exist - changes the current working directory - returns zero - when a block is given - changes current working directory for the block - gets back to previous directory once the block is finished - .getwd - returns the path to the current working directory - .foreach - when no block is given - returns an enumerator - and the directory doesn't exist - returns an enumerator - and the given path is not a directory - returns an enumerator - when a block is given - calls the block once for each entry in the named directory - passes each entry as a parameter to the block - and the given path is not a directory - raises an exception - and the directory doesn't exist - raises an exception - .open - when the given path is not a directory - raises an exception - when no block is given - returns the opened directory - when the given directory doesn't exist - raises an exception - when a block is given - calls the block with the opened directory as argument - ensures the directory is closed - returns nil - #read - reads the next entry from dir and returns it - when there are no entries left - returns nil - when calling several times - returns the next entry each time - #to_path - returns the path parameter passed to dir's constructor - #tell - returns the current position in dir - [] - when a list of strings is given - acts like calling glob - when a string is given - acts like calling glob - .rmdir - deletes the named directory - when the directory is not empty - raises an exception - .new - when the given directory doesn't exist - raises an exception - when the given path is not a directory - raises an exception - .tmpdir - returns /tmp - #close - closes the directory - .mkdir - sets directory permissions to default 0777 - creates a directory when permissions are specified - sets directory permissions to specified value - when the directory already exist + sets directory permission to specified value + when the directory already exists raises an exception - .exist? - behaves like aliased method - #exists? - #pos= - seeks to a particular location in dir - returns the given position - when the location has not been seeked yet - doesn't change the location - when the location is negative - doesn't change the location - #rewind - repositions dir to the first entry - returns the dir itself - .pwd + #pwd behaves like aliased method #getwd - .glob - behaves like returning matching filenames - with / - behaves like returning matching filenames - with / - behaves like returning matching filenames - with /test? - behaves like returning matching filenames - with /test* - behaves like returning matching filenames - with /test[01] - behaves like returning matching filenames - with /test0 - behaves like returning matching filenames - with /**/file0 - behaves like returning matching filenames - with /test{1,2} - when a block is given - returns nil - calls the block with every matching filenames - behaves like returning matching filenames - with /*es* - when a flag is given - uses it to compare filenames - behaves like returning matching filenames - with /test[^2] - when pattern is an array of patterns - returns the list of files matching any pattern - behaves like returning matching filenames - with /*0 - behaves like returning matching filenames - with /* - behaves like returning matching filenames - with /* - .chroot - changes the process's idea of the file system root - returns zero - when the user is not root - raises an exception - when the given path doesn't exist - raises an exception - when the given path is a file - raises an exception - #path - returns the path parameter passed to dir's constructor - #each - passes the filename of each entry as a parameter to the block - calls the block once for each entry in this directory - when no block is given - returns an enumerator - .entries - returns an array containing all of the filenames in the given directory - .unlink - behaves like aliased method - #rmdir - .delete - behaves like aliased method - #rmdir - #seek - seeks to a particular location in dir - returns the dir itself - when the location has not been seeked yet - doesn't change the location - when the location is negative - doesn't change the location - .home - returns the home directory of the current user (PENDING: Temporarily skipped with xit) - when a username is given - returns the home directory of the given user (PENDING: Temporarily skipped with xit) - .exists? - returns false if the given +path+ does not exist - returns true if the given +path+ exists and is a directory - returns false if the given +path+ is not a directory - #pos - returns the current position in dir + #paths + returns the list of all the existing paths -MemFs::Fake::File - stores the modification made on its content - #content - returns the file content - when the file is empty - returns an empty string container - #type - when the file is a regular file - returns 'file' - when the file is a block device - returns 'blockSpecial' - when the file is a character device - returns 'characterSpecial' - #close - sets the file as closed? +MemFs::Fake::File::Content + #initialize + when no argument is given + initialize the contained string to an empty one + when an argument is given + when the argument is a string + duplicates the original string to prevent modifications on it + initialize the contained string with the given one + when the argument is not a string + converts it to a string + when initialized with a string argument + #read + reads +length+ bytes from the contained string + when the optional +buffer+ argument is provided + inserts the output in the buffer + when there is nothing else to read + returns nil + #close + responds to close + #pos + when the string has been read + returns the current offset + when the string has not been read + returns 0 + #<< + writes the given string to the contained string + #to_s + when the content is empty + returns an empty string + when the content is not empty + returns the content's string + #puts + appends all given strings to the contained string + appends the given string to the contained string + when a line break is present at the end of the given string + doesn't add any line break + #write + writes the given string in content + returns the number of bytes written + when the argument is a non-ascii string + returns the correct number of bytes written + when the argument is not a string + converts it to a string + #truncate + truncates the content to length characters Pending: (Failures listed here are expected and do not affect your suite's status) - 1) MemFs::File::Stat#grpowned? when the effective user group does not own of the file returns false + 1) MemFs::File::Stat#owned? when the effective user does not own of the file returns false + # Temporarily skipped with xit + # ./spec/memfs/file/stat_spec.rb:472 + + 2) MemFs::File::Stat#grpowned? when the effective user group does not own of the file returns false # Temporarily skipped with xit # ./spec/memfs/file/stat_spec.rb:443 - 2) MemFs::File::Stat#owned? when the effective user does not own of the file returns false + 3) MemFs::Dir.home returns the home directory of the current user # Temporarily skipped with xit - # ./spec/memfs/file/stat_spec.rb:472 + # ./spec/memfs/dir_spec.rb:252 - 3) MemFs::File#print when no argument is given prints $_ + 4) MemFs::Dir.home when a username is given returns the home directory of the given user + # Temporarily skipped with xit + # ./spec/memfs/dir_spec.rb:257 + + 5) MemFs::File#print when no argument is given prints $_ # I don't know how to test with $_ # ./spec/memfs/file_spec.rb:2550 - 4) MemFs::File.write when +offset+ is provided starts writing from the offset + 6) MemFs::File.write when +offset+ is provided starts writing from the offset # Offsets not yet implemented in IO.write # ./spec/memfs/file_spec.rb:1869 - 5) MemFs::File.grpowned? when the named file exists and the effective user group does not own of the file returns false + 7) MemFs::File.grpowned? when the named file exists and the effective user group does not own of the file returns false # Temporarily skipped with xit # ./spec/memfs/file_spec.rb:626 - 6) MemFs::File.owned? when the named file exists and the effective user does not own of the file returns false + 8) MemFs::File.owned? when the named file exists and the effective user does not own of the file returns false # Temporarily skipped with xit # ./spec/memfs/file_spec.rb:943 - 7) MemFs::Dir.home returns the home directory of the current user - # Temporarily skipped with xit - # ./spec/memfs/dir_spec.rb:252 - - 8) MemFs::Dir.home when a username is given returns the home directory of the given user - # Temporarily skipped with xit - # ./spec/memfs/dir_spec.rb:257 - -Finished in 0.51936 seconds (files took 0.73436 seconds to load) +Finished in 1.2 seconds (files took 2.49 seconds to load) 800 examples, 0 failures, 8 pending -Randomized with seed 36971 +Randomized with seed 53625 [Coveralls] Outside the CI environment, not sending data. @@ -2801,12 +2835,14 @@ dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) I: copying local configuration +I: user script /srv/workspace/pbuilder/9967/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/9967/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/65218 and its subdirectories -I: Current time: Mon Jan 24 11:25:38 -12 2022 -I: pbuilder-time-stamp: 1643066738 +I: removing directory /srv/workspace/pbuilder/9967 and its subdirectories +I: Current time: Wed Dec 23 07:05:57 +14 2020 +I: pbuilder-time-stamp: 1608656757