Diff of the two buildlogs: -- --- b1/build.log 2025-01-20 13:34:38.772764983 +0000 +++ b2/build.log 2025-01-20 13:42:15.780230083 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Jan 20 01:32:19 -12 2025 -I: pbuilder-time-stamp: 1737379939 +I: Current time: Tue Jan 21 03:34:53 +14 2025 +I: pbuilder-time-stamp: 1737380093 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -29,52 +29,84 @@ dpkg-source: info: applying set-env-home.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/20263/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/D01_modify_environment starting +debug: Running on ff64a. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Jan 20 13:35 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=6 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='d0634f4c05bb48358755edea289bde7a' - 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='20263' - PS1='# ' - PS2='> ' + INVOCATION_ID=d8c2536861eb4dc8ad9cc364d55f5d7c + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + 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=3314 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.jtpiXmVI/pbuilderrc_u4n5 --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.jtpiXmVI/b1 --logfile b1/build.log pry_0.14.2-1.dsc' - SUDO_GID='110' - SUDO_UID='103' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.jtpiXmVI/pbuilderrc_HetL --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.jtpiXmVI/b2 --logfile b2/build.log pry_0.14.2-1.dsc' + SUDO_GID=114 + SUDO_UID=109 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux virt32z 6.1.0-30-armmp-lpae #1 SMP Debian 6.1.124-1 (2025-01-12) armv7l GNU/Linux + Linux i-capture-the-hostname 6.1.0-30-arm64 #1 SMP Debian 6.1.124-1 (2025-01-12) aarch64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/20263/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -270,7 +302,7 @@ Get: 148 http://deb.debian.org/debian trixie/main armhf ruby-rspec-expectations all 3.13.0c0e0m0s1-2 [90.2 kB] Get: 149 http://deb.debian.org/debian trixie/main armhf ruby-rspec-mocks all 3.13.0c0e0m0s1-2 [81.3 kB] Get: 150 http://deb.debian.org/debian trixie/main armhf ruby-rspec all 3.13.0c0e0m0s1-2 [5184 B] -Fetched 53.4 MB in 6s (8900 kB/s) +Fetched 53.4 MB in 2s (25.6 MB/s) Preconfiguring packages ... Selecting previously unselected package libpython3.12-minimal:armhf. (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 ... 19569 files and directories currently installed.) @@ -771,8 +803,8 @@ Setting up tzdata (2024b-6) ... Current default time zone: 'Etc/UTC' -Local time is now: Mon Jan 20 13:33:13 UTC 2025. -Universal Time is now: Mon Jan 20 13:33:13 UTC 2025. +Local time is now: Mon Jan 20 13:37:50 UTC 2025. +Universal Time is now: Mon Jan 20 13:37:50 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up ruby-method-source (1.0.0-3) ... @@ -907,7 +939,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/pry-0.14.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../pry_0.14.2-1_source.changes +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/pry-0.14.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../pry_0.14.2-1_source.changes dpkg-buildpackage: info: source package pry dpkg-buildpackage: info: source version 0.14.2-1 dpkg-buildpackage: info: source distribution unstable @@ -947,13 +983,13 @@ │ pry: Installing files and building extensions for ruby3.1 │ └──────────────────────────────────────────────────────────────────────────────┘ -/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20250120-25243-9851po/gemspec +/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20250121-23495-5hspib/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash Successfully built RubyGem Name: pry Version: 0.14.2 File: pry-0.14.2.gem -/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/pry/usr/share/rubygems-integration/all /tmp/d20250120-25243-9851po/pry-0.14.2.gem +/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/pry/usr/share/rubygems-integration/all /tmp/d20250121-23495-5hspib/pry-0.14.2.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/reproducible-path/pry-0.14.2/debian/pry/usr/share/rubygems-integration/all/gems/pry-0.14.2/bin/pry /build/reproducible-path/pry-0.14.2/debian/pry/usr/share/rubygems-integration/all/gems/pry-0.14.2/lib/pry.rb @@ -1125,629 +1161,302 @@ RUBYLIB=. GEM_PATH=/build/reproducible-path/pry-0.14.2/debian/pry/usr/share/rubygems-integration/all:/build/reproducible-path/pry-0.14.2/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.1.0:/var/lib/gems/3.1.0:/usr/local/lib/ruby/gems/3.1.0:/usr/lib/ruby/gems/3.1.0:/usr/lib/arm-linux-gnueabihf/ruby/gems/3.1.0:/usr/share/rubygems-integration/3.1.0:/usr/share/rubygems-integration/all:/usr/lib/arm-linux-gnueabihf/rubygems-integration/3.1.0 ruby3.1 -S rake --rakelibdir /gem2deb-nonexistent -f debian/ruby-tests.rake /usr/bin/ruby3.1 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 3532 +Randomized with seed 52519 -Readline - is not loaded on requiring 'pry' - is not loaded on invoking 'pry' if Pry.input is set - is loaded on invoking 'pry' - -Pry::Config::LazyValue - #call - doesn't memoize the result of call +reload_code + reload_current_file + raises an error source code not found + reloads pry commmand + raises an error when pry command not found + raises an error when class not found -Pry::BlockCommand - #help - returns help output +Pry::Config::Value #call - when #process accepts no arguments - calls the block despite passed arguments - when #process accepts some arguments - calls the block even if there are more arguments than needed - calls the block even if there's not enough arguments - when passed a variable-length array - calls the block without arguments - calls the block with some arguments - -Pry::Hooks - adding a new hook - should create a new hook with a callable - should use block if given both block and callable - should not execute hook while adding it - should raise if not given a block or any other object - should return a count of 0 for an empty hook - should create multiple hooks for an event - should create a new hook with a block - should not allow adding of a hook with a duplicate name - anonymous hooks - should execute most recently added anonymous hook - should allow adding of hook without a name - should only allow one anonymous hook to exist - executing a hook - should return the last exception raised as the return value - should execute all hooks for an event if more than one is defined - should execute block hook - should execute proc hook - return value of exec_hook should be that of last executed hook - should add exceptions to the errors array - should execute hooks in order - should execute a general callable hook - clearing all hooks for an event - should clear all hooks - getting hooks - get_hooks - should return a hash of hook names/hook functions for an event - should return an empty hash if no hooks defined - get_hook - should return the correct requested hook - should return nil if hook does not exist - integration tests - after_session hook - should always run, even if uncaught exception bubbles out of repl - exceptions - should not raise exceptions - should print out a notice for each exception raised - before_eval hook - modifying input code - should replace input code with code determined by hook - should not interfere with command processing when replacing input code - when_started hook - should yield options to the hook - should allow overriding of target (and binding_stack) - target - should yield the target, as a binding - should yield the target to the hook - dupping a Pry::Hooks instance - adding a new event to dupped instance should not affect original - adding a new hook to dupped instance should not affect original - should share hooks with original - .default - returns hooks with default before_session hook - when pry instance is not quiet - runs the whereami command - when pry instance is quiet - doesn't run the whereami command - deleting a hook - should return nil if hook does not exist - should successfully delete a hook - should return the deleted hook - Pry::Hooks#merge - merge! - should not share merged elements with original - should merge in the Pry::Hooks - should overwrite identical hook in receiver - should NOT overwrite hooks belonging to shared event in receiver - should preserve hook order - merge - should return a fresh, independent instance - should not affect original instances when new hooks are added - should contain hooks from original instance - -Pry::Indent - should indent a function - should not indent inside strings - should indent separate lines - should properly indent nested code - should indent statements such as if, else, etc - should not indent inside HEREDOCs - should not indent single-line rescue - should indent begin rescue end - should not indent single/multi-line until - should indent a module and class - should not raise error, if MIDWAY_TOKENS are used without indentation - should differentiate single/multi-line unless - should not indent nested HEREDOCs - should indent a hash - should handle multiple open and closing tokens on a line - should indent cunningly disguised ifs - should correctly handle while do - should indent an array - should ident case statements - should indent correctly with nesting - should not indent single line statements - should not indent single-line ifs - nesting - should parse nesting on line 9 of example_nesting.rb - should parse nesting on line 1 of example_nesting.rb - should parse nesting on line 31 of example_nesting.rb - should parse nesting on line 8 of example_nesting.rb - should parse nesting on line 7 of example_nesting.rb - should parse nesting on line 12 of example_nesting.rb - should fail to parse nesting on line 20 of example_nesting.rb - should parse nesting on line 6 of example_nesting.rb - should parse nesting on line 26 of example_nesting.rb - should fail to parse nesting on line 21 of example_nesting.rb - should parse nesting on line 28 of example_nesting.rb - should parse nesting on line 24 of example_nesting.rb - should fail to parse nesting on line 18 of example_nesting.rb - should parse nesting on line 29 of example_nesting.rb - should parse nesting on line 10 of example_nesting.rb - should parse nesting on line 25 of example_nesting.rb - should parse nesting on line 33 of example_nesting.rb - should fail to parse nesting on line 17 of example_nesting.rb - should parse nesting on line 14 of example_nesting.rb - should parse nesting on line 22 of example_nesting.rb - should parse nesting on line 5 of example_nesting.rb - should parse nesting on line 23 of example_nesting.rb - should parse nesting on line 32 of example_nesting.rb - should fail to parse nesting on line 19 of example_nesting.rb - should parse nesting on line 27 of example_nesting.rb - should parse nesting on line 15 of example_nesting.rb - should parse nesting on line 4 of example_nesting.rb - should parse nesting on line 3 of example_nesting.rb - should parse nesting on line 11 of example_nesting.rb - should parse nesting on line 2 of example_nesting.rb - should fail to parse nesting on line 30 of example_nesting.rb - should parse nesting on line 13 of example_nesting.rb - should parse nesting on line 16 of example_nesting.rb + when given value is a MemoizedValue + calls the MemoizedLazy object + when given value is a LazyValue + calls the LazyValue object + when given value is a Proc + returns the value as is + when given value is a non-callable object + returns the value as is -exit - should break out of the repl when binding_stack has only one binding - should break out of the repl and return user-given value - should break out of the repl even after an exception - should pop a binding +exit-all + should break out of the repl and return nil + should break out of the repl even if multiple bindings still on stack + should break out of the repl wth a user specified value + should have empty binding_stack after breaking out of the repl find-method - should escape regexes correctly should work with badly behaved constants - find matching methods by name regex (-n option) - should find a method by regex - should NOT match a method that does not match the regex + should escape regexes correctly find matching methods by content regex (-c option) should NOT match a method that does not match the regex should find a method by regex + find matching methods by name regex (-n option) + should NOT match a method that does not match the regex + should find a method by regex -raise-up - should raise the most recently raised exception - should raise an unamed exception with raise-up - should allow you to cd up and (eventually) out - should jump immediately out of nested contexts with ! - should raise the exception with raise-up - should eat the exception at the last new pry instance on raise-up - -Pry::Command::Cat::FileFormatter - #file_and_line - parses relative path without line_num - parses relative path with line_num - UNIX-like filesystem - parses absolute path without line_num - parses absolute path with line_num - windows filesystem - parses '\'style absolute path without line_num - parses '/'style absolute path without line_num - parses '\'style absolute path with line_num - parses '/'style absolute path with line_num - #format - formats given files with line number - formats given files - -Pry - .configure - yields a block with Pry.config as its argument - Pry.critical_section - should prevent Pry being called - a fresh instance - should use `caller` as its backtrace - Exotic object support - Should not error when return value is a BasicObject instance - FAIL_PRY - should raise an error for Pry.start - should raise an error for binding.pry - Pry.binding_for - should not leak local variables - Should not error when object doesn't have a valid == method - should work on frozen objects - DISABLE_PRY - should not binding.pry - should not Pry.start - #last_exception= - returns a frozen exception - returns an instance of Pry::LastException - returns an object who mirrors itself as the wrapped exception - setting custom options - does not raise for unrecognized options - correctly handles the :quiet option (#1261) - open a Pry session on an object - repl - defining methods - defines a method on the class of an object when performing "def meth;end" inside an immediate value or Numeric - defines an instance method on the class when performing "def meth;end" inside the class - defines an instance method on the module when performing "def meth;end" inside the module - defines a method on the singleton class of an object when performing "def meth;end" inside the object - nesting - should nest properly - Object#pry - should start a pry session on the receiver (second form) - should raise if more than two arguments are passed to Object#pry - should start a pry session on the receiver (first form) - complete_expression? - should not mutate the input! - basic functionality - should set an ivar on an object and exit the repl - last_result - should be set to the most recent value - should be preserved over an empty line - should be preserved when evalling a command without :keep_retval - should be set to the result of a command with :keep_retval - Pry.binding_for - should return TOPLEVEL_BINDING if parameter self is main - history arrays - sets _in_ to an array with the entered lines - sets out to an array with the result - sets _ to the last result - can change the size of the history arrays - store exceptions - uses 100 as the size of _in_ and _out_ - rep - should notice when exceptions are raised - should make self evaluate to the receiver of the rep session - should not try to catch intended exceptions - should set an ivar on an object - should define a nested class under Hello and not on top-level or Pry - should suppress output if input ends in a ";" and is an Exception object (single line) - should suppress output if input ends in a ";" (single line) - should not leak pry constants into Object namespace - should display error if Pry instance runs out of input - should be able to operate inside the BasicObject class - should be able to evaluate exceptions normally - multi-line input - works - should suppress output if input ends in a ";" (multi-line) - newline from an empty heredoc - works - newline stripping from an empty string - with single quotes - with fancy delimiters - with double quotes - newline stripping from an empty regexp - with fancy delimiters - with regular regexp delimiters - inside signal handler - should return with error message - -jump-to - jumps to the proper binding index in the stack - prints error when trying to jump to a non-existent binding index - prints an error when trying to jump to the same binding index - -hist - should store a call with `--replay` flag - should grep for correct lines in history - should show lines between lines A and B with the --show switch - should return last N lines in history with --tail switch - should return first N lines in history with --head switch - raises CommandError when index of `--replay` points out to another `hist --replay` - should disallow execution of `--replay ` when CommandError raised - should replay history correctly (single item) - should not contain lines produced by `--replay` flag - should apply --head after --grep - should start from beginning if tail number is longer than history - should replay a range of history correctly (range of items) - should apply --tail after --grep - should replay a range of history correctly (range of commands) - excludes Pry commands from the history with `-e` switch - should show lines between offsets A and B with the --show switch - sessions - displays history only for current session - should not display histignore words in history - displays all history (including the current sesion) with `--all` switch - -test Pry defaults - should set the print default, and the default should be overridable - should set the hooks default, and the default should be overridable - should set the output default, and the default should be overridable - prompts - sets the prompt default, and the default should be overridable (single prompt) - sets the prompt default, and the default should be overridable (multi prompt) - storing and restoring the prompt - should not pop the last prompt - should restore overridden prompts when returning from shell-mode - should have a prompt stack - #pop_prompt should return the popped prompt - #prompt= should replace the current prompt with the new prompt - when only one prompt on the stack - when several prompts on the stack - pry return values - should return the parameter (multi word string) given to exit-all - should return the parameter given to exit-all - should return the parameter (self) given to exit-all - should return the parameter (function call) given to exit-all - should return nil - toplevel_binding - should be devoid of local variables - should have self the same as TOPLEVEL_BINDING - should define private methods on Object - quiet - should show whereami by default - should hide whereami if quiet is set - view_clip used for displaying an object in a truncated format - given the 'main' object - returns the #to_s of main (special case) - given an object with an #inspect string as long as the maximum specified - returns the #<> format of the object (never use inspect) - the list of prompt safe objects - returns the #inspect of the special-cased immediate object: 2.0 - returns the #inspect of the custom prompt safe objects - returns the #inspect of the special-cased immediate object: test - returns the #inspect of the special-cased immediate object: hello - returns #<> format of the special-cased immediate object if #inspect is longer than maximum - returns the #inspect of the special-cased immediate object: -5 - returns the #inspect of the special-cased immediate object: 1 - given an object with an #inspect string - returns the #<> format of the object (never use inspect) - given a regular object with an #inspect string longer than the maximum specified - when the object is a regular one - returns a string of the # format - when the object is a Class or a Module - with a #name longer than the maximum specified - returns a string of the # format - without a name (usually a c = Class.new) - returns a string of the # format - with a #name shorter than or equal to the maximum specified - returns a string of the # format - input - should not pass in the prompt if the arity is -1 - should pass in the prompt if readline arity is 1 - should set the input default, and the default should be overridable - should not pass in the prompt if the arity is 0 - -Pry.run_command - performs a simple ls - can perform a show-source +Pry::Method + should use String names for compatibility + all_from_obj + on classes + should find methods defined on the singleton class of super-classes + attributes overridden methods to the relevant singleton class in preference to Class + should find methods defined on modules extended into the class + should find methods defined on Kernel + should attrbute overridden methods to the class not the module + should attribute overridden methods to the sub-class' singleton class + should find methods defined on Class + should find methods defined in the class' singleton class + should not find methods defined within the class + on normal objects + should find methods all the way up to Kernel + should find methods in modules included into the object's singleton class + should find methods defined in the object's class + should find methods defined in modules included into the object's class + should find methods defined in the object's singleton class + should not find methods defined on the classes singleton class + should work in the face of an overridden send + method resolution order + should include the singleton class of objects + should include included modules for Modules + should include modules at the point which they would be reached + should include modules at most once + should include the included modules between a class and its superclass + should not include modules extended into the class + includes the Pry::Method.instance_resolution_order of Class after the singleton classes + should look at a class and then its superclass + should include modules included into singleton classes + should not include singleton classes of numbers + should include singleton classes for classes + #receiver + when it is overriden in Object + correctly reports the receiver + #parameters + when it is overriden in Object + correctly reports the parameters + .signature + should print the name of keyword args, with :? after the arg name + should print the name of optional args, with =? after the arg name + should print the name of additional args, with an * label + should print the name of keyword args, with : after the arg name + should print the name of block args, with an & label + should print the name of regular args + .from_str + should NOT look up methods using the object.method syntax if no methods defined + looks up instance methods if no methods available and no options provided + looks up methods if no instance methods available and no options provided + should look up methods if :methods option provided + looks up instance methods first even if methods available and no options provided + should look up instance methods using klass.meth#method syntax + should look up instance methods if "instance-methods" option provided + should NOT look up instance methods using the Class#method syntax if no instance methods defined + should look up methods using klass.new.method syntax + should take care of cases like $ mongo[] - issue 998 + should look up instance methods using the Class#method syntax + should look up methods using instance::bar syntax + should look up methods using the object.method syntax + should take care of corner cases like mongo[] e.g Foo::Bar.new[]- issue 998 + should not raise an exception if receiver does not exist + all_from_class + should be able to find methods defined on a singleton class + finds private and protected instance methods defined in a class + should be able to find public instance methods defined in a class + should be able to find methods on super-classes when given a singleton class + should be able to find instance methods defined in a super-class + should find methods all the way up to Kernel + finds instance methods defined in modules included into this class + finds instance methods defined in modules included into super-classes + should attribute overridden methods to the sub-class + #owner + when it is overriden in Object + correctly reports the owner + method_name_from_first_line + should work in all simple cases + super + jumps up multiple levels of bound method, even through modules + should be able to find super methods defined on modules + should be able to find the super method of an unbound method + should return nil if no super method exists + should be able to find the super method on a bound method + should be able to find super methods defined on super-classes when there are modules in the way + method aliases + should not include the own name in the list of aliases + should return an empty Array if cannot find aliases + should be able to find aliases for methods implemented in C + should find aliases for top-level methods + should be able to find method aliases + .from_binding + should NOT find a method from the toplevel binding + should find the right method if a super method exists + should not find a wrong method by matching on nil source location + should find the right method even if it was renamed and replaced + should find the right method from a BasicObject + should be able to pick a method out of a binding + should find methods that have been undef'd + should find the super method correctly -Pry::Pager - PageTracker - records short lines that don't add up to a page - treats a long line as taking up more than one row - doesn't count ansi color codes towards length - doesn't count a line until it ends - records short lines that do add up to a page - records a string with an embedded newline +Pry::History + #session_line_count + returns the number of lines in history from just this session + #clear + clears this session's history + doesn't affect the contents of the history file + expanding the history file path + recognizes ~ (#1262) + .load_history + reads the contents of the file + .default_file + returns ~/.local/share/pry/pry_history + when ~/.pry_history exists + returns ~/.pry_history + when $XDG_DATA_HOME is defined + returns config location relative to $XDG_DATA_HOME + returns config location relative to $XDG_DATA_HOME when ~/.pryrc exists + file io errors + handles Errno::EACCES failure to write history + handles Errno::EACCES failure to read from history + handles Errno::ENOENT failure to read from history + handles Errno::ENOENT failure to write history + #push + does not record duplicated lines + does not record empty lines + does not record lines that contain a NULL byte + saving to a file + interleaves lines from many places + should not write histignore words to the history file + saves lines to a file as they are written + #history_line_count + counts entries in history -reload_code - reload_current_file - raises an error when class not found - reloads pry commmand - raises an error when pry command not found - raises an error source code not found +Pry::CLI + .start + sets Pry.cli to true + when there are some input args + loads files through repl and exits + when the context option is provided + initializes session setup + finalizes session setup + starts Pry in the provided context + when the context option is not provided + starts Pry in the top level + when the help option is provided + exits + when 'pry' is passed as an input arg + does not load files through repl + .parse_options + when argv is passed with a dash (-) + sets everything after the dash as input args + when multiple options exist + processes only called options + when option exists + finalizes session setup + removes the existing option from ARGV + initializes session setup + when invalid option is provided + exits program + when argv is passed with a double dash (--) + sets everything after the double dash as input args + when option doesn't exist + raises error + .add_option_processor + returns self + adds an option processor + .add_options + returns self + when options is nil and a block is provided + sets the block as options + when options were previously set + overwrites the options proc that executes original options + overwrites the options proc that executes the provided block -cat +edit + without FILE + should evaluate the expression + should ignore -n for tempfiles + should edit the current expression if it's incomplete + should use a blank file if -t given, even during an expression + should edit the previous expression if the current is empty + should not evaluate a file with -n + should write the evaluated command to history + should use a blank file if -t is specified + should position the cursor at the end of the expression with --ex - cat --ex should display repl code that generated exception - cat --ex should correctly display code that generated exception - with --in 1 - should display the first expression with no index - on receiving a file that does not exist - should display an error message - with --in 1..2 - should display the given range with indices, omitting nils - when invoked without arguments - should display an error message + with --ex NUM + should start editor on first level of backtrace with --ex 0 + should start editor on second level of backtrace with --ex 1 + should display error message when backtrace level is invalid + should start editor on third level of backtrace with --ex 2 + should start on first level of backtrace with just --ex + with a real file + should not reload the file if -n is passed + should reload the file + edits the exception even when in a patched method context + with --patch + should apply changes only in memory (monkey patching) + --method flag + errors when a filename arg is passed with --method + should edit method context + errors when cannot find method context with --in - should display the last few expressions with indices - with --in -1 - should display the last expression with no index - with --ex N - each successive cat --ex should show the next level of backtrace, and going past the final level should return to the first - should cat third level of backtrace when --ex 2 used - should cat first level of backtrace when --ex used with no argument - should show error when backtrace level out of bounds - should cat second level of backtrace when --ex 1 used - should cat first level of backtrace when --ex 0 used - -Pry.config.unrescued_exceptions - should rescue all exceptions NOT specified on unrescued_exceptions - should NOT rescue exceptions specified on unrescued_exceptions - -Pry::Command::ShellCommand - cd - .cd - saves the current working directory - given an empty string - sends ~ to File.expand_path - with CDPATH - when it is defined - simple cdpath - cd's into the dir - complex cdpath - cd's into the dir - given a dash - given a prior directory - sends the user's last pry working directory to File.expand_path - given no prior directory - raises the correct error - given a path - sends the path to File.expand_path - -Pry::ClassCommand - #slop - returns a Slop instance - makes Slop's banner unindented - defines the help option - when there are options - adds subcommands to Slop - when there are subcommands - adds subcommands to Slop - .inherited - when match is defined - sets match on the subclass - when command_options is defined - sets command_options on the subclass - when description is defined - sets description on the subclass - #complete - generates option completions - #call - sets command's opts - invokes setup - sets command's args - when help is invoked - returns void value - outputs help info - when help is not invloved - when #process accepts no arguments - calls the command despite passed arguments - when passed a variable-length array - calls the command without arguments - calls the command with some arguments - when #process accepts some arguments - calls the command even if there are more arguments than needed - calls the command even if there's not enough arguments - .source_line - returns source file - .source_location - returns source location - .source_file - returns source file - .doc - returns source code for the process method - .source - returns source code for the process method - #help - returns help output - #process - raises CommandError - -Pry::Output - #<< - is expected to eq # - #height - returns the number of rows - #tty? - when the output responds to #tty? and is a TTY - returns true - when the output responds to #tty? and is not a TTY - returns false - when the output doesn't respond to #tty? - returns false - #respond_to_missing? - when the output responds to the given method name - finds the method that is not defined on self - when the output doesn't respond to the given method name - doesn't find the method - #width - returns the number of columns - #write - is expected to eq # - #size - when the output is not a tty and no info in ENV - when Readline's size has zero column - returns the default size - when Readline's size has no zeroes - returns the Readline winsize - when the output is not a tty, and no info in ENV and no Readline info - and when there's ANSICON ENV variable - and when it cannot be matched - returns the default winsize - and when it can be matched - and when the size has a zero column - returns the default winsize - and when the size consists of positive integers - returns the ansicon winsize - and when there's no ANSICON ENV variable - returns the default winsize - when the output is not a tty - and ENV has size info in ROWS and COLUMNS - returns the ENV variable winsize - and ENV has size info in LINES and COLUMNS - returns ENV variable winsize - when the output is a tty and responds to winsize - returns the io/console winsize - #print - returns nil - when the given pry instance has 'color' disabled - decolorizes output - when the given pry instance has 'color' enabled - doesn't decolorize output - #decolorize_maybe - when the given pry instance has 'color' disabled - returns decolorized string - when the given pry instance has 'color' enabled - returns the given string without modifications - #puts - returns nil - when given non-convertible to array objects - prints the non-converted objects in its string form - and when the object's #to_s has a newline - doesn't print a double newline - when given an empty array - prints a newline - when the given pry instance has 'color' enabled - doesn't decolorize output - when the given pry instance has 'color' disabled - decolorizes output - when given convertible to array objects - prints the converted objects - when given multiple empty arrays - prints multiple newline - #method_missing - when the output responds to the given method name - forwards the method to the output - when the output doesn't respond to the given method name - raises NoMethodError - -Pry::CodeObject - .lookup - when looking up instance methods - finds instance methods via the . notation - finds instance methods via the # notation - when looking up classes - finds classes - when looking up 'nil' while being inside a class instance - infers the module - when looking up 'nil' while being inside a module - infers the module - when looking up Pry commands by listing - finds Pry::WrappedModule - when looking up method - finds methods defined on objects - when looking up 'nil' while being inside a method - infers the method - when looking up instance methods of a class - finds instance methods - when looking up class methods of a named class - finds instance methods via the # notation - when looking up anonymous class methods - finds instance methods via the # notation - when looking up classes with 'super: 1' - finds the parent class - when looking up empty string while being inside a class instance - infers the module - when looking up classes with 'super: 0' - finds the child class - when looking up Pry commands by class - finds Pry::WrappedModule - when looking up 'nil' - returns nil - when looking up procs - finds classes - when looking up empty string while being inside a method - infers the method - when looking up modules - finds modules - when looking up Pry::BlockCommand - finds Pry:BlockCommand - when there is a class and a method who is a namesake - finds the class before the method - finds the class before the method when it's namespaced - finds the method when the look up ends with () - when looking up commands with the super option - finds the command ignoring the super option - when looking up classes by names of variables - finds instance methods via the # notation - when looking up empty string while being inside a module - infers the module - when looking up Pry::ClassCommand - finds Pry:BlockCommand - -exit-program - should exit the program with the provided value - should raise SystemExit + should not work with a filename + should edit a multi-line expression as it occupies one line of _in_ + should edit a range of lines if a range is given + should edit the last line if no argument is given + should edit the nth line of _in_ + should not work with nonsense + with FILE + works with files that contain blanks in their names + should not allow patching any known kind of file + should invoke Pry.config.editor with absolutified filenames + should guess the line number from a colon + should use the line number from -l + should not delete the file! + should work with require relative + + should not reload the file if it is not a ruby file + should not reload a ruby file if -n is given + should reload the file if it is a ruby file + should reload a non-ruby file if -r is given + + should pass the editor a reloading arg + old edit-method tests now migrated to edit + on a method defined in a file + with -p + should successfully replace a method with a question mark + should successfully replace a method from a module + should successfully replace an instance method + should successfully replace a class method + should preserve module nesting + should successfully replace a method on an instance + monkey-patching + should work for a method with a question mark + should work for a class method + should work for a method on an instance + should work for a method from a module + should work for an instance method + should work with nesting + on an aliased method + should change the alias, but not the original, without breaking super + without -p + should correctly find a method from a module + should correctly find an aliased method + should correctly find an instance method + should correctly find a class method + should correctly find a method on an instance + with three-arg editor + should pass the editor a reloading arg + when editing a method by name + uses patch editing on methods that were previously patched + can repeatedly edit methods that were defined in the console + pretty error messages + should display a nice error message when cannot open a file Pry::CommandState #reset - doesn't reset command state for other commands resets the command state for the given command + doesn't reset command state for other commands #state_for returns a state for the matching command returns new state for new command @@ -1757,515 +1466,37 @@ when called multiple times returns the same command state -Pry::Ring - #[] - when the ring is empty - returns nil - when the ring is full - reads elements via inclusive range - returns the first element when accessed through 0..0 - reads elements via exclusive range - reads elements - when the ring is not full - reads elements - reads elements via range - #<< - overwrites elements when the ring is full - keeps duplicate elements - adds elements as is when the ring is not full - #to_a - returns a duplicate of internal buffer - #clear - resets ring to initial state - -Pry::REPL - should rescue exceptions - should let you run commands in the middle of multiline expressions - autoindent - should raise no exception when indented with a tab (PENDING: Temporarily skipped with xit) - eval_string and binding_stack - shouldn't break if we start a nested REPL - should immediately evaluate eval_string after cmd if complete - shouldn't break if we pop bindings in Ruby - shouldn't break if we start a nested instance - space prefix - with 1 space - it prioritizes variables over commands - with more than 1 space - prioritizes commands over variables - #piping? - returns false when $stdout is a non-IO object - -Pry::Code - #grep - when pattern is nil - returns self - when pattern is specified - returns lines matching the pattern - #select - selects lines matching a condition - returns a code object - #reject - rejects lines matching a condition - returns a code object - #with_marker - shows a marker in the right place - #before - when line number is nil - returns self - when line number is an integer - selects one line before the specified line number - and we specify how many lines to select - selects more than 1 line before - #with_line_numbers - appends line numbers to code - .from_module - sets code type to :ruby - reads line from a class - #between - when a negative end_line is specified - returns a range of lines from the end - when start_line is nil - returns self - when a negative start_line is specified - returns a line from the end - when only start_line is specified - returns a code object - removes leaves only the specified line - when start_line is a Range - returns a range fo lines corresponding to the given Range - when both start_line and end_line are specified - removes all lines that aren't in the given range - returns a code object - #respond_to_missing? - when a String does not respond to the given method - doesn't find the method - when a String responds to the given method - finds the method that is not defined on self - .from_file - reads lines from a file relative to origin pwd with '.rb' omitted - reads lines from a file relative to origin pwd - reads lines from a file on disk - reads lines from a file relative to current pwd - raises error when file doesn't exist - sets code type according to the file - when reading lines from a file without an extension - sets code type to :unknown - when reading files from $LOAD_PATH - finds files with '.rb' extensions - doesn't confuse files with the same name, but without an extension - finds files in a relative directory with '.rb' omitted - finds files in a relative directory with '.rb' extension - finds Ruby files with omitted '.rb' extension - doesn't confuse files with the same name, but with an extension - recognizes Gemfile as a Ruby file - when readling lines from Pry's line buffer - can specify file type manually - reads entered lines - #to_s - returns a string representation of code - #take_lines - takes N lines from start_line - #length - returns how many lines the code object has - Pry::Code() - when given an Array - reads lines from the array - when given a Proc - reads lines from proc - when given a Pry::Method - reads lines from Pry::Method - when given a Method - reads lines from bound method - when given a Code object - returns the passed parameter unchanged - when given an UnboundMethod - reads lines from unbound methods - #with_indentation - indents lines - #max_lineno_width - when there are less than 10 lines - returns 1 - when there are less than 100 lines - returns 2 - when there are less than 1000 lines - returns 3 - #highlighted - returns a highlighted for terminal string representation of code - #expression_at - returns a multiline expressiong starting on the given line number - #raw - when code has a marker - returns an unformatted String of all lines - .from_method - reads lines from a method's definition - #comment_describing - returns a comment describing expression - #method_missing - when a String responds to the given method - forwards the method to a String instance - when a String does not respond to the given method - raises NoMethodError - #nesting_at - returns an Array of open modules - #== - when a code is compared with another code with different lines - returns true - when a code is compared with another code with identical lines - returns true - when an empty code is compared with another empty code - returns true - #around - when line number is nil - returns self - when line number is an integer - selects one line around the specified line number - and we specify how many lines to select - selects more than 1 line around - #push - is an alias of #<< - appends lines to the code - #after - when line number is an integer - selects one line around the specified line number - and we specify how many lines to select - selects more than 1 line around - when line number is nil - returns self - -The bin/pry CLI - -I path - adds multiple additional paths to $LOAD_PATH - adds an additional path to $LOAD_PATH - ARGV forwarding - forwards ARGV as an empty array when - is passed without following arguments - forwards its remaining arguments as ARGV when -- is passed - forwards its remaining arguments as ARGV when - is passed - forwards ARGV as an empty array when -- is passed without following arguments - -Pry::Env - #[] - when ENV contains the passed key but its value is nil - is expected to be nil - when ENV contains the passed key - is expected to eq "val" - when ENV doesn't contain the passed key - is expected to be nil - -Formatting Table - knows about colorized fitting - decide between one-line or indented output - formatting - should order downward and wrap to columns - should handle... another basic case - should handle a tiny case - should handle empty input - should handle colors - should handle the basic case - should handle one-token input - line length is smaller than the length of the longest word - should not raise error - should format output as one column - -Pry - output suppression - should output something if the input ends with a comment - should not output anything if the input ends with a semicolon - should not output something if the input is only a comment - should normally output the result - output_prefix - should be able to change output_prefix - custom non-IO object as $stdout - does not crash pry - color - should colorize strings as though they were ruby - should not colorize strings that already include color - output failsafe - should catch errors serializing exceptions - should catch serialization exceptions - should display serialization exceptions - default print - should output the right thing - should include the => - doesn't leak colour for object literals - should not be phased by un-inspectable things +Pry::BlockCommand + #help + returns help output + #call + when #process accepts some arguments + calls the block even if there are more arguments than needed + calls the block even if there's not enough arguments + when passed a variable-length array + calls the block with some arguments + calls the block without arguments + when #process accepts no arguments + calls the block despite passed arguments Pry::ColorPrinter .default prints output prefix with value .pp - when printing a BasicObject - prints a string - when #inspect raises Pry::Pager::StopPaging - propagates the error when #inspect returns an object literal prints the object inspect - and when SyntaxHighlighter returns a token starting with '' - prints the object as is and when SyntaxHighlighter returns a token that doesn't start with '' prints the object with escape characters - when no exception is raised in #inspect - prints a string with a newline + and when SyntaxHighlighter returns a token starting with '' + prints the object as is when an exception is raised in #inspect still prints a string - -Pry::CLI - .add_option_processor - adds an option processor - returns self - .parse_options - when option exists - finalizes session setup - initializes session setup - removes the existing option from ARGV - when argv is passed with a double dash (--) - sets everything after the double dash as input args - when invalid option is provided - exits program - when argv is passed with a dash (-) - sets everything after the dash as input args - when multiple options exist - processes only called options - when option doesn't exist - raises error - .add_options - returns self - when options is nil and a block is provided - sets the block as options - when options were previously set - overwrites the options proc that executes original options - overwrites the options proc that executes the provided block - .start - sets Pry.cli to true - when 'pry' is passed as an input arg - does not load files through repl - when the help option is provided - exits - when there are some input args - loads files through repl and exits - when the context option is provided - finalizes session setup - initializes session setup - starts Pry in the provided context - when the context option is not provided - starts Pry in the top level - -ri - prints an error message without an argument - -help - should display help for a regex command with a "listing" - should display help for all commands with a description - should display help for a command with a spaces in its name - should display help for a specific command - should sort the output of the 'help' command - -Pry::Command - #void - returns void value - .name - returns the name of the command - when super command name exists - returns the name of the parent command - #run - runs a command from another command - .command_regex - when use_prefix is false - returns a Regexp with a prefix - when use_prefix is true - returns a Regexp without a prefix - .convert_to_regex - when given object is an Object - returns the given object - when given object is a String - escapes the string as a Regexp - .inspect - returns command name - .doc - returns help output - .state - returns a command state - .source_line - returns source line - #check_for_command_collision - when a command collides with a local variable - displays a warning - when a command doesn't collide - doesn't display a warning - when a command collides with a method - displays a warning - .command_options - when no argument is given - and when command options were not defined previously - sets command options to default options - and when command options were defined previously - returns memoized command options - when given an argument - merges the argument with command options - #commands - returns command set as a hash - #complete - returns empty array - .match - when given an argument - and when match is a string - sets command options with listing as match - and when match is an object - sets command options with listing as object's inspect - when no argument is given - and when match was not defined previously - sets match to nil - and when match was defined previously - doesn't overwrite match - .source - returns source code of the method - .match_score - when command regex matches given value - and when the size of last match is 1 or 0 - returns the length of the last match - and when the size of last match is more than 1 - returns the length of the first match - when command regex doesn't match given value - returns -1 - .block - when block exists - returns the block - when block doesn't exist - uses #process method - #state - returns a state object - remembers the state - .banner - when given an argument - merges the argument with command options - when no argument is given - and when banner was defined previously - returns the memoized banner - and when banner was not defined previously - return nil - .description - and when description was defined previously - doesn't overwrite match - when given an argument - sets description - and when description was not defined previously - sets description to nil - .group - when source file matches a pry command - sets group name to command name - when source file doesn't match anything - returns '(other)' - when source file matches a pry plugin - sets group name to plugin name - when name is given - sets group to that name - when source file matches 'pryrc' - sets group name to pryrc - .matches? - when given value doesn't match command regex - returns false - when given value matches command regex - returns true - .default_options - when given an Object argument - returns default options with object's inspect as listing - when given a String argument - returns default options with string listing - #tokenize - when given string uses interpolation - interpolates the string in the target's context - and when interpolation is disabled - doesn't interpolate the string - when shellwords is disabled - doesn't split quotes from the arguments - when given string doesn't match a command - raises CommandError - when target is not set - still returns tokens - when command regex has captures - returns the captures - when shellwords is enabled - strips quotes from the arguments - .source_file - returns source file - .command_name - returns listing - #process_line - sets arg_string - sets captures - collision warnings - when collision warnings are configured - prints a warning when there's a collision - when collision warnings are not set - prints a warning when there's a collision - #target_self - returns the value of self inside the target binding - #interpolate_string - when given string doesn't contain #{ - returns the given string - when given string contains #{ - returns the result of eval within target - .subclass - sets match on the new class - sets block on the new class - sets command options on the new class - returns a new class - includes helpers to the new class - sets description on the new class - -Pry::Helpers::DocumentationHelpers - get_comment_content - should remove shebangs - should unindent past separators - should strip off the hash and unindent - should strip out leading lines of hashes - process_rdoc - should syntax highlight code in - should not remove ++ - should syntax highlight indented code - should syntax highlight things in backticks - should emphasise italic tags - should syntax highlight code in - should highlight words surrounded by +s - should emphasise em tags - should not syntax highlight already highlighted code - should not double-highlight backticks inside indented code - -Pry - should not raise an error on broken lines: pouts(< puts \e[31m\e[1;31m'\e[0m\e[31mhello\e[1;31m'\e[0m\e[31m\e[0m\e[1B\e[0G" +! + should not clear the input buffer for negation + should correctly clear the input buffer + +Pry::Ring + #to_a + returns a duplicate of internal buffer + #clear + resets ring to initial state + #<< + overwrites elements when the ring is full + adds elements as is when the ring is not full + keeps duplicate elements + #[] + when the ring is not full + reads elements + reads elements via range + when the ring is full + reads elements via inclusive range + reads elements via exclusive range + reads elements + returns the first element when accessed through 0..0 + when the ring is empty + returns nil + Pry::InputCompleter - ignores methods from modules that override Object#hash incompatibly - should take parenthesis and other characters into account for symbols - should complete for target symbols should complete for stdlib symbols + should complete for stdlib symbols + should complete instance variables + should not return nil in its output + should complete for target symbols + does not offer methods from restricted modules completes expressions with all available methods + ignores methods from modules that override Object#hash incompatibly + should take parenthesis and other characters into account for symbols should complete for arbitrary scopes - should complete for target symbols - should not return nil in its output should complete for arbitrary scopes - should complete instance variables - does not offer methods from restricted modules + should complete for target symbols should not crash if there's a Module that has a symbolic name. (PENDING: No reason given) - should complete for stdlib symbols - -disable-pry - should set DISABLE_PRY - should quit the current session - -Sticky locals (_file_ and friends) - locals should keep value after cd-ing (_file_ and _dir_) - locals should all exist upon initialization - locals should keep value after cd-ing (pry_instance) - locals should still exist after cd-ing into a new context - locals should return last result (_) - locals should return second last result (__) - User defined sticky locals - should provide different values for successive block invocations - should still exist after cd-ing into new binding - should create a new sticky local - hash option value should override config value - should define a new sticky local for the session (normal value) - setting as Pry.config option - should define a new sticky local for the session (normal value) - should define a new sticky local for the session (proc) - passing in as hash option when creating pry instance - should define multiple sticky locals - should define a new sticky local for the session (normal value) - should define a new sticky local for the session (as Proc) - _ex_ - keeps its value after cd-ing - returns the last exception without wrapping it in a LastException -edit - pretty error messages - should display a nice error message when cannot open a file - with FILE - should guess the line number from a colon - should invoke Pry.config.editor with absolutified filenames - should use the line number from -l - should not delete the file! - works with files that contain blanks in their names - should work with require relative - should not allow patching any known kind of file - - should pass the editor a reloading arg - - should not reload the file if it is not a ruby file - should reload a non-ruby file if -r is given - should not reload a ruby file if -n is given - should reload the file if it is a ruby file - with --in - should edit a multi-line expression as it occupies one line of _in_ - should not work with a filename - should edit the last line if no argument is given - should not work with nonsense - should edit the nth line of _in_ - should edit a range of lines if a range is given - with --ex - with a real file - should not reload the file if -n is passed - should reload the file - edits the exception even when in a patched method context - with --patch - should apply changes only in memory (monkey patching) - with --ex NUM - should start editor on first level of backtrace with --ex 0 - should start editor on third level of backtrace with --ex 2 - should display error message when backtrace level is invalid - should start editor on second level of backtrace with --ex 1 - should start on first level of backtrace with just --ex - --method flag - should edit method context - errors when a filename arg is passed with --method - errors when cannot find method context - when editing a method by name - uses patch editing on methods that were previously patched - can repeatedly edit methods that were defined in the console - old edit-method tests now migrated to edit - on a method defined in a file - with three-arg editor - should pass the editor a reloading arg - without -p - should correctly find an instance method - should correctly find an aliased method - should correctly find a method from a module - should correctly find a class method - should correctly find a method on an instance - on an aliased method - should change the alias, but not the original, without breaking super - with -p - should successfully replace a method on an instance - should successfully replace an instance method - should successfully replace a class method - should preserve module nesting - should successfully replace a method from a module - should successfully replace a method with a question mark - monkey-patching - should work for a method from a module - should work for a class method - should work for an instance method - should work for a method with a question mark - should work with nesting - should work for a method on an instance - without FILE - should edit the previous expression if the current is empty - should use a blank file if -t given, even during an expression - should position the cursor at the end of the expression - should evaluate the expression - should not evaluate a file with -n - should write the evaluated command to history - should use a blank file if -t is specified - should edit the current expression if it's incomplete - should ignore -n for tempfiles +Pry::Warning + #warn + prints message with file and line of the calling frame -Pry::History - saving to a file - interleaves lines from many places - saves lines to a file as they are written - should not write histignore words to the history file - .default_file - returns ~/.local/share/pry/pry_history - when ~/.pry_history exists - returns ~/.pry_history - when $XDG_DATA_HOME is defined - returns config location relative to $XDG_DATA_HOME - returns config location relative to $XDG_DATA_HOME when ~/.pryrc exists - #clear - clears this session's history - doesn't affect the contents of the history file - expanding the history file path - recognizes ~ (#1262) - #push - does not record duplicated lines - does not record lines that contain a NULL byte - does not record empty lines - #history_line_count - counts entries in history - #session_line_count - returns the number of lines in history from just this session - .load_history - reads the contents of the file - file io errors - handles Errno::ENOENT failure to write history - handles Errno::ENOENT failure to read from history - handles Errno::EACCES failure to read from history - handles Errno::EACCES failure to write history +Formatting Table + knows about colorized fitting + decide between one-line or indented output + formatting - should order downward and wrap to columns + should handle the basic case + should handle colors + should handle one-token input + should handle empty input + should handle a tiny case + should handle... another basic case + line length is smaller than the length of the longest word + should format output as one column + should not raise error -! - should correctly clear the input buffer - should not clear the input buffer for negation +Pry + loading rc files + should never run the rc file twice + should not load the pryrc if it cannot expand ENV[HOME] + should not load the rc file twice if it's symlinked differently + should not run the rc file at all if Pry.config.should_load_rc is false + should not load the pryrc if pryrc's directory permissions do not allow this + that raise exceptions + should not raise exceptions + should continue to run pry + should output an error show-source - should output a method's source inside method using the -l switch - should find methods even if the object overrides method method - should find methods even if there are spaces in the arguments - should output the source of a method defined inside Pry - should find normal methods (i.e non-instance methods) by default + should output a method's source + should output a method's source if inside method and no name given should output source for an instance method defined inside pry + should find normal methods (i.e non-instance methods) by default should find normal methods with self.moo - should output a method's source with line numbers starting at 1 - should output a method's source with line numbers - should output help - should output the source of a command defined inside Pry - should raise a CommandError when super method doesn't exist - should output source for a repl method defined using define_method - should find instance methods with self#moo - should find instance_methods if the class overrides instance_method - should output a method's source if inside method and no name given - should not find normal methods with self#moo - should output a method's source - should not find instance methods with self.moo doesn't show the source and deliver an error message without exclamation point - should not show the source when a non-extant method is requested should find instance methods if no normal methods available + should not find instance methods with self.moo + should not find normal methods with self#moo + should not show the source when a non-extant method is requested + should output a method's source inside method using the -l switch + should output the source of a method defined inside Pry + should find instance_methods if the class overrides instance_method + should find instance methods with self#moo + should raise a CommandError when super method doesn't exist + should find methods even if there are spaces in the arguments + should output the source of a command defined inside Pry + should output source for a repl method defined using define_method + should output a method's source with line numbers starting at 1 + should find methods even if the object overrides method method + should output help + should output a method's source with line numbers + on variable or constant + outputs source of its class if variable doesn't respond to source_location + outputs source of its class if constant doesn't respond to source_location + finding super methods with help of `--super` switch + finds super methods without explicit method argument + finds super methods with explicit method argument + finds super methods with multiple --super + on sourcable objects + should output source for procs/lambdas stored in constants + should output source for procs/lambdas stored in variables + should output source for method objects + should output source defined inside pry + on variables that shadow methods + source of method being shadowed should take precedence over variable + if given self.meth_name syntax + source of variable takes precedence over method that is being shadowed + should set _file_ and _dir_ + should set _file_ and _dir_ to file containing method source + with -e option + shows the source code for the returned value as Ruby + can't find class/module code + for modules + shows included module code + errors when module has no included module to show + shows correct warning when reverting to nth level included module + shows warning when reverting to included module code + shows nth level included module code (when no intermediary modules have code either) + for classes + shows warning when reverting to superclass code + shows correct warning when reverting to nth level superclass + shows superclass code + shows nth level superclass code (when no intermediary superclasses have code either) + ignores included modules + errors when class has no superclass to show on commands real class-based commands should show source for a command defined inside pry should show source for a command - create_command commands - should show source for a command - should show source for a command defined inside pry block commands - should output source of commands using special characters - should show source for an ordinary command should show source for a command by listing name + should show source for an ordinary command should show source for a command with spaces in its name - with -e option - shows the source code for the returned value as Ruby - on modules - should lookup module name with respect to current context - should lookup nested modules - in REPL - should find superclass defined in repl - should find class defined in repl - basic functionality, should find top-level module definitions - should show source for a super class when Const = Class.new syntax is used - should show source for a class when Const = Class.new syntax is used - should show source for a module - should show source for a super class - should show source for a class - should show source for a module when Const = Module.new syntax is used - should show source for an ancestor module - show-source -a - when there are class-eval monkeypatches in different files - ignores -a because object is not a module - shows the source for all monkeypatches - when -a is not used and there's only one candidate for the class - doesn't mention anything about monkeypatches - when there are instance-eval monkeypatches in different files - shows the source for all monkeypatches - when there are class method monkeypatches in different files - shows the source for all monkeypatches - when -a is not used and there are multiple monkeypatches - mentions available monkeypatches - when there are instance method monkeypatches in different files - shows the source for all monkeypatches - when show-source is invoked without a method or class argument - inside a module - should be unable to find module source if no methods defined - should display module source by default - displays method code (rather than class) if Pry started inside method binding - should display class source when inside instance - should allow options to be passed - monkey-patched C modules - when current context is a C object - recommends to use the --all switch when other candidates are found - should display a warning, and not monkey-patched definition - when current context is something other than a C object - should display a candidate, not a warning - should skip over broken modules - should return source for first valid module - on sourcable objects - should output source for procs/lambdas stored in variables - should output source defined inside pry - should output source for procs/lambdas stored in constants - should output source for method objects - on variables that shadow methods - source of variable takes precedence over method that is being shadowed - source of method being shadowed should take precedence over variable - if given self.meth_name syntax - when there's no source code but the comment exists - outputs zero line numbers - finding super methods with help of `--super` switch - finds super methods with explicit method argument - finds super methods with multiple --super - finds super methods without explicit method argument - on variable or constant - outputs source of its class if constant doesn't respond to source_location - outputs source of its class if variable doesn't respond to source_location + should output source of commands using special characters + create_command commands + should show source for a command + should show source for a command defined inside pry show-source --doc - when included module has docs and there are intermediary docless modules - shows nth level included module doc - shows a warning about module reversion - when given a class defined in a REPL session + when the module with docs was included in another module + shows the included module's doc + shows a warning about the included module reversion + when the Const = Class.new syntax is used shows documentation for the class - when no class/module arg is given - returns the doc for the current module - when no docs can be found for the given class - raises Pry::CommandError - when the --base-one switch is provided - outputs a method's docs with line numbering starting at 1 - when #call is defined on Symbol - still finds documentation + when the Const = Module.new syntax is used + shows documentation for the module when given a 'broken' module skips over the module - when the --line-numbers switch is provided - outputs a method's docs with line numbers - when given a class with a doc - shows documentation for the code object along with source code + when #call is defined on Symbol + still finds documentation + when provided a class without docs that has a superclass with docs + shows a warning about superclass reversion + shows the docs of the superclass when the current context is a method outputs the method without needing to use its name - when provided a class without docs that has a superclass without docs - raises Pry::CommandError - when both the base mod and the included module have no docs - raises Pry::CommandError - when the module with docs was included in another module - shows the included module's doc - shows a warning about the included module reversion - when no docs can be found for the given method - raises Pry::CommandError code highlighting - when there's code in the docs + when there's inline code in the docs highlights the code when there's inline code with backticks the docs doesn't highlight the backticks - when there's inline code in the docs + when there's code in the docs highlights the code - when given a method with a doc - finds the method's documentation - when the Const = Module.new syntax is used - shows documentation for the module - when given a proc - should show documentation for object - when the current context is a non-nested class + when given a nested class shows docs for the nested classes - the --all switch behavior - when there are monkeypatches in different files - shows them - when --all is not used but there are multiple monkeypatches - mentions available monkeypatches - correctly displays the number of monkeypatches - displays the original definition first - when --all is not used and there's only 1 candidate for the class - doesn't mention anything about monkeypatches - when the Const = Class.new syntax is used - shows documentation for the class + should set _file_ and _dir_ + sets _file_ and _dir_ to file containing method source + when included module has docs and there are intermediary docless modules + shows nth level included module doc + shows a warning about module reversion + when the --super switch is provided + and when it's passed once + finds the super method docs + and when it's passed twice + finds the parent method docs + and when the explicit argument is not provided + finds super method docs without explicit method argument + finds super method docs with multiple `--super` switches + and when it's passed thrice + finds the grandparent method docs + and when the super method doesn't exist + raises Pry::CommandError + when no docs can be found for the given class + raises Pry::CommandError when used against a command - displays help for a command with a spaces in its name - displays help for a regex command with a "listing" displays help for a specific command + displays help for a regex command with a "listing" + displays help for a command with a spaces in its name class commands when class is used (rather than command name) is used for lookup displays actual preceding comment for a class command when looking up by command name displays help + when given a proc + should show documentation for object when given a module with a doc shows documentation for the code object along with source code when provided a class without docs that has nth superclass with docs shows the docs of the superclass shows a warning about superclass reversion - should set _file_ and _dir_ - sets _file_ and _dir_ to file containing method source - when provided a class without docs that has a superclass with docs - shows the docs of the superclass - shows a warning about superclass reversion - when given a nested class + when the --base-one switch is provided + outputs a method's docs with line numbering starting at 1 + when given a method with a doc + finds the method's documentation + when no docs can be found for the given method + raises Pry::CommandError + when the --line-numbers switch is provided + outputs a method's docs with line numbers + when no class/module arg is given + returns the doc for the current module + when the current context is a non-nested class shows docs for the nested classes - when the --super switch is provided - and when the explicit argument is not provided - finds super method docs without explicit method argument - finds super method docs with multiple `--super` switches - and when it's passed twice - finds the parent method docs - and when it's passed once - finds the super method docs - and when it's passed thrice - finds the grandparent method docs - and when the super method doesn't exist - raises Pry::CommandError - can't find class/module code - for classes - ignores included modules - shows warning when reverting to superclass code - shows superclass code - errors when class has no superclass to show - shows nth level superclass code (when no intermediary superclasses have code either) - shows correct warning when reverting to nth level superclass - for modules - shows nth level included module code (when no intermediary modules have code either) - shows warning when reverting to included module code - shows correct warning when reverting to nth level included module - errors when module has no included module to show - shows included module code - should set _file_ and _dir_ - should set _file_ and _dir_ to file containing method source + when given a class with a doc + shows documentation for the code object along with source code + when both the base mod and the included module have no docs + raises Pry::CommandError + when provided a class without docs that has a superclass without docs + raises Pry::CommandError + the --all switch behavior + when --all is not used but there are multiple monkeypatches + displays the original definition first + mentions available monkeypatches + correctly displays the number of monkeypatches + when --all is not used and there's only 1 candidate for the class + doesn't mention anything about monkeypatches + when there are monkeypatches in different files + shows them + when given a class defined in a REPL session + shows documentation for the class + when there's no source code but the comment exists + outputs zero line numbers + on modules + should lookup nested modules + should lookup module name with respect to current context + show-source -a + when -a is not used and there's only one candidate for the class + doesn't mention anything about monkeypatches + when -a is not used and there are multiple monkeypatches + mentions available monkeypatches + when there are instance method monkeypatches in different files + shows the source for all monkeypatches + when there are class-eval monkeypatches in different files + shows the source for all monkeypatches + ignores -a because object is not a module + when there are instance-eval monkeypatches in different files + shows the source for all monkeypatches + when there are class method monkeypatches in different files + shows the source for all monkeypatches + when show-source is invoked without a method or class argument + inside a module + displays method code (rather than class) if Pry started inside method binding + should be unable to find module source if no methods defined + should display module source by default + should allow options to be passed + should display class source when inside instance + monkey-patched C modules + when current context is something other than a C object + should display a candidate, not a warning + when current context is a C object + should display a warning, and not monkey-patched definition + recommends to use the --all switch when other candidates are found + should skip over broken modules + should return source for first valid module + in REPL + should find class defined in repl + should find superclass defined in repl + basic functionality, should find top-level module definitions + should show source for an ancestor module + should show source for a class + should show source for a super class + should show source for a class when Const = Class.new syntax is used + should show source for a super class when Const = Class.new syntax is used + should show source for a module when Const = Module.new syntax is used + should show source for a module -Pry::SystemCommandHandler - .default - when command exists - executes the command without printing the warning - when doesn't exist - executes the command without printing the warning +The bin/pry CLI + ARGV forwarding + forwards ARGV as an empty array when -- is passed without following arguments + forwards ARGV as an empty array when - is passed without following arguments + forwards its remaining arguments as ARGV when -- is passed + forwards its remaining arguments as ARGV when - is passed + -I path + adds an additional path to $LOAD_PATH + adds multiple additional paths to $LOAD_PATH + +Pry::Command + .convert_to_regex + when given object is a String + escapes the string as a Regexp + when given object is an Object + returns the given object + #void + returns void value + .source_line + returns source line + .command_regex + when use_prefix is true + returns a Regexp without a prefix + when use_prefix is false + returns a Regexp with a prefix + #check_for_command_collision + when a command doesn't collide + doesn't display a warning + when a command collides with a method + displays a warning + when a command collides with a local variable + displays a warning + .matches? + when given value matches command regex + returns true + when given value doesn't match command regex + returns false + .command_name + returns listing + .command_options + when given an argument + merges the argument with command options + when no argument is given + and when command options were defined previously + returns memoized command options + and when command options were not defined previously + sets command options to default options + .name + returns the name of the command + when super command name exists + returns the name of the parent command + .match_score + when command regex doesn't match given value + returns -1 + when command regex matches given value + and when the size of last match is 1 or 0 + returns the length of the last match + and when the size of last match is more than 1 + returns the length of the first match + .match + when no argument is given + and when match was not defined previously + sets match to nil + and when match was defined previously + doesn't overwrite match + when given an argument + and when match is an object + sets command options with listing as object's inspect + and when match is a string + sets command options with listing as match + #state + remembers the state + returns a state object + #complete + returns empty array + .block + when block exists + returns the block + when block doesn't exist + uses #process method + #tokenize + when shellwords is disabled + doesn't split quotes from the arguments + when command regex has captures + returns the captures + when given string uses interpolation + interpolates the string in the target's context + and when interpolation is disabled + doesn't interpolate the string + when shellwords is enabled + strips quotes from the arguments + when target is not set + still returns tokens + when given string doesn't match a command + raises CommandError + .doc + returns help output + .banner + when no argument is given + and when banner was not defined previously + return nil + and when banner was defined previously + returns the memoized banner + when given an argument + merges the argument with command options + #process_line + sets arg_string + sets captures + collision warnings + when collision warnings are not set + prints a warning when there's a collision + when collision warnings are configured + prints a warning when there's a collision + .source + returns source code of the method + #interpolate_string + when given string doesn't contain #{ + returns the given string + when given string contains #{ + returns the result of eval within target + .description + and when description was defined previously + doesn't overwrite match + and when description was not defined previously + sets description to nil + when given an argument + sets description + .subclass + sets block on the new class + sets match on the new class + returns a new class + sets description on the new class + sets command options on the new class + includes helpers to the new class + .group + when source file matches a pry plugin + sets group name to plugin name + when name is given + sets group to that name + when source file doesn't match anything + returns '(other)' + when source file matches a pry command + sets group name to command name + when source file matches 'pryrc' + sets group name to pryrc + .state + returns a command state + .inspect + returns command name + #run + runs a command from another command + .source_file + returns source file + #target_self + returns the value of self inside the target binding + .default_options + when given a String argument + returns default options with string listing + when given an Object argument + returns default options with object's inspect as listing + #commands + returns command set as a hash commands a command (with :keep_retval => false) that replaces eval_string with a valid expression doesn't have the expression value suppressed - creates a regex command and passes captures into the args list before regular arguments - should interpolate ruby code into commands + if a regex capture is missing it should be nil + should change description of a command using desc + should define a command that keeps its return value + should import commands from another command object creates a command in a nested context and that command should be accessible from the parent - should define a command that keeps its return value but does not return when value is void should create a command with a space in its name and pass an argument - should create a regex command and interpolate the captures - should define a command that keeps its return value + should delete some inherited commands when using delete method + should define a command that does NOT keep its return value a command that return a value in a multi-line expression clears the expression and return the value - should create a regex command and arg_string should be interpolated - a command (with :keep_retval => true) that replaces eval_string with a valid expression overwrites the eval_string with the return value - if a regex capture is missing it should be nil - should set the commands default, and the default should be overridable - should change description of a command using desc + enables an inherited method to access opts, output and target, due to instance_exec + should override some inherited commands should NOT try to interpolate pure ruby code (no commands) + should create a command with a space in its name zzz + should create a regex command and be able to invoke it + should set the commands default, and the default should be overridable + a command (with :keep_retval => true) that replaces eval_string with a valid expression overwrites the eval_string with the return value + should NOT interpolate ruby code into commands if :interpolate => false should inherit commands from Pry::Commands should run a command with no parameter - should import commands from another command object - should define a command that keeps its return value even when nil - should override some inherited commands + should create a regex command and interpolate the captures + should interpolate ruby code into commands doesn't choke on complex string interpolation when checking if ruby code is a command - should delete some inherited commands when using delete method - should create a command with a space in its name zzz - should define a command that does NOT keep its return value - should NOT interpolate ruby code into commands if :interpolate => false + should define a command that keeps its return value even when nil should run a command with one parameter - enables an inherited method to access opts, output and target, due to instance_exec - should create a regex command and be able to invoke it - Pry#run_command - should run a command in the context of a session - should run a command that modifies the passed in eval_string - alias_command - should be able to alias a regex command - should pass option arguments to original - should make an aliasd command behave like its original - should pass option arguments to original with additional parameters - should be able to make the alias a regex - should pass on arguments to original + should create a regex command and arg_string should be interpolated + creates a regex command and passes captures into the args list before regular arguments + should define a command that keeps its return value but does not return when value is void Pry::Command#run - should allow running of commands with following whitespace - should run a command from within a command with arguments + should run a command from within a command should allow running of cd command when split into array + should run a command from within a command with arguments should allow running of cd command when contained in a single string + should allow running of commands with following whitespace should run a regex command from within a command - should run a command from within a command + alias_command + should be able to make the alias a regex + should pass option arguments to original + should pass on arguments to original + should make an aliasd command behave like its original + should pass option arguments to original with additional parameters + should be able to alias a regex command + Pry#run_command + should run a command in the context of a session + should run a command that modifies the passed in eval_string + +hist + excludes Pry commands from the history with `-e` switch + should return last N lines in history with --tail switch + should grep for correct lines in history + should replay a range of history correctly (range of commands) + should apply --head after --grep + should return first N lines in history with --head switch + should replay a range of history correctly (range of items) + should replay history correctly (single item) + should show lines between lines A and B with the --show switch + should show lines between offsets A and B with the --show switch + should store a call with `--replay` flag + raises CommandError when index of `--replay` points out to another `hist --replay` + should start from beginning if tail number is longer than history + should apply --tail after --grep + should not contain lines produced by `--replay` flag + should disallow execution of `--replay ` when CommandError raised + sessions + should not display histignore words in history + displays history only for current session + displays all history (including the current sesion) with `--all` switch cd - should break out to outer-most session with cd / - should cd into previous object and its local using cd ../local syntax - should break out of session with cd .. - can cd into an expression containing a string with slashes in it cds into an object and its ivar and back and then into another ivar using cd obj/@ivar/../@y syntax + should cd into complex input (with spaces) cds into an object and its ivar using cd obj/@ivar/ syntax (note following /) - should cd into simple input + can cd into objects that redefine #respond_to? to return true + can cd into an expression containing a string with slashes in it + should break out of session with cd .. should not leave the REPL session when given 'cd ..' - can cd into an expression with division in it - should be able to cd into the Object BasicObject + cds into an object and its ivar and back again using cd obj/@ivar/.. syntax + should break out to outer-most session with just cd (no args) should cd into an object and its ivar using cd obj/@ivar syntax - should start a session on TOPLEVEL_BINDING with cd :: + should cd into previous object and its local using cd ../local syntax + should be able to cd into the Object BasicObject should cd back to top-level and then into another ivar using cd /@ivar/ syntax - should cd into complex input (with spaces) + should break out to outer-most session with cd / + should cd into simple input + can cd into an expression with division in it should not cd into complex input when it encounters an exception - can cd into objects that redefine #respond_to? to return true - should break out to outer-most session with just cd (no args) - cds into an object and its ivar and back again using cd obj/@ivar/.. syntax + should start a session on TOPLEVEL_BINDING with cd :: old stack toggling with `cd -` - when an error was raised - should not toggle and should keep correct stacks + when using ^D (Control-D) key press + should keep correct old binding + in fresh pry instance + should not toggle when there is no old stack + when using simple cd syntax + should toggle when using cd :: should toggle - series of cd calls - should toggle with fuzzy `cd -` calls when using complex cd syntax should toggle with a complex path (more complex case) should toggle with a complex path (simple case) when using cd .. - should toggle with a complex path should toggle with a simple path - when using ^D (Control-D) key press - should keep correct old binding - when using simple cd syntax - should toggle - in fresh pry instance - should not toggle when there is no old stack + should toggle with a complex path + series of cd calls + should toggle with fuzzy `cd -` calls + when an error was raised + should not toggle and should keep correct stacks when using cd / should toggle -watch expression - registers the after_eval hook - watches a local variable - prints no watched expressions - doesn't print when an expresison remains the same - continues to work if you start a second pry instance - prints when an expression is mutated - prints when an expression changes - watches an expression - deleting expressions - keeps keeper - deletes delete - -Pry::Prompt - .add - adds a new prompt - raises error on adding a prompt with the same name - raises error when separators.size != 2 - returns nil - #description - returns description - prompt invocation - computes prompt name dynamically - #wait_proc - returns the first proc - #incomplete_proc - returns the second proc - .[] - accesses prompts - #prompt_procs - returns the proc array - .all - returns a duplicate of original prompts - returns a hash with prompts - #name - returns name - -Pry::Editor - invoke_editor with a proc - should not shell-escape files - build_editor_invocation_string on windows - should not shell-escape files - build_editor_invocation_string - should shell-escape files - .default - when no editor is detected - shells out to find 'nano' - shells out to find 'vi' - shells out to find 'editor' - when $EDITOR is defined - returns the value of $EDITOR - when platform is Windows - returns 'notepad' - when $VISUAL is defined - returns the value of $VISUAL - -exit-all - should break out of the repl and return nil - should have empty binding_stack after breaking out of the repl - should break out of the repl wth a user specified value - should break out of the repl even if multiple bindings still on stack - -Pry::Config::MemoizedValue - #call - memoizes the result of call - doesn't conflate falsiness with unmemoizedness - -Pry::CommandSet - #to_hash - doesn't mutate original commands - converts commands to hash - #[] - when there's an unambiguous command - selects the command according to the given pattern - when there's an ambiguous command - prefers a command with a higher score - #list_commands - returns the list of commands - #desc - gets command description - sets command description - #valid_command? - when command can be found - returns true - when command cannot be found - returns false - #find_command_for_help - when the command cannot be found - returns nil - when the command can be found - returns the command - #block_command - configures command options - assings default description - defines a new command - can overwrite default description - when description is a hash - treats description as options - #delete - deletes given commands - #new - merges other set with itself - when block given - instance evals the block - #[]= - rebinds the command with key - when given command is nil - deletes the command matching the pattern - when given command is not a subclass of Pry::Command - raises TypeError - #each - iterates over commands - #add_command - adds a command - #import - includes given sets' helper modules - returns self - imports commands from given sets - #alias_command - sets group for the aliased command automatically - sets aliased command's listing for string alias - sets description for the aliased command automatically - sets aliased command's listing for regex alias - returns the aliased command - when non-string description is provided - uses the string representation of the given object - when command doesn't match - raises RuntimeError - when string description is provided - uses the given description for the aliased command - #import_from - includes other set's helper module - imports matching command from a set - returns self - #process_line - when the given line is not a command - returns not a command - returns a void result - when the given line is a command - returns a non-void command - returns a command - and context is provided - passes the context to the command - #rename_command - can optionally set custom description - renames a comamnd - when provided command is not registered - raises ArgumentError - #find_command_by_match_or_listing - returns a matching by listing command - raises ArgumentError on non-matching command - returns a matching by name command - #create_command - defines a new class command - assings default description - configures command options - can overwrite default description - class_evals the given block in the command context - when description is a hash - treats description as options - -Pry::Helpers::CommandHelpers - #temp_file - creates a tempfile with rb extension - yields a tempfile - allows overwriting file extension - closes the tempfile - unlinks the tempfile - #one_index_range - decrements range boundaries - #set_file_and_dir_locals - injects local variable _dir_ - sets pry instance's last_file to _file_ - injects local variable _file_ - sets pry instance's last_dir to _dir_ - #restrict_to_lines - when lines are specified as an integer - restricts the given string to the specified line number - when lines are specified as a range - restricts the given string to the specified range - #get_method_or_raise - when super opt is provided but there's no super method - raises MethodNotFound - when super opt is provided and there's a parent method - gets the parent method - when there's name but no corresponding method - raises MethodNotFound - when there's no method name - raises MethodNotFound - #absolute_index_range - when given an integer - returns an absolute range that was decremented - when given an integer - returns a range based on the integer and array length - #one_index_number - when line number is more than 0 - decrements the line number - when line number is 0 - returns the line number - #internal_binding? - when target's __method__ returns nil - returns true - when target's __method__ returns __pry__ - returns true - when target's __method__ returns __binding__ - returns true - #unindent - should ignore lines starting with -- - should also remove tabs if present - should only remove a common prefix - removes the same prefix from all lines - should not be phased by empty lines - #one_index_range_or_number - when given a range - decrements range boundaries - when given an integer - decrements the line number - #absolute_index_number - when line number is less than zero - returns the absolute sum of line number and array length - when line number is zero - returns the line number - -Pry::ExceptionHandler - .handle_exception - when exception is a nested standard error - prints standard error message - when exception is a standard error - prints standard error message - when exception is a UserError and a SyntaxError - prints the syntax error with customized message - clear-screen - calls the "cls" command on Windows calls the "clear" command on non-Windows platforms + calls the "cls" command on Windows -Pry::Config::Value - #call - when given value is a LazyValue - calls the LazyValue object - when given value is a MemoizedValue - calls the MemoizedLazy object - when given value is a Proc - returns the value as is - when given value is a non-callable object - returns the value as is - -amend-line - should amend a range of lines of input when negative numbers given - should amend a specified line when negative number given - should correctly delete a range of lines using the ! for content - should amend the last line of input when no line number specified - should correctly delete the previous line using the ! for content - should amend the specified range of lines, with numbers < 0 in range - should correctly amend the specified line with interpolated text - should correctly amend the specified range of lines - should display error if nothing to amend - should amend the first line of input when 0 given as line number - should amend the specified line of input when line number given - should ignore second value of range with > syntax - should correctly insert a line before a specified line using > - should correctly delete a specific line using the ! for content - -Pry::Method - should use String names for compatibility - method_name_from_first_line - should work in all simple cases - .from_binding - should find the right method from a BasicObject - should find the right method if a super method exists - should find methods that have been undef'd - should NOT find a method from the toplevel binding - should find the right method even if it was renamed and replaced - should not find a wrong method by matching on nil source location - should be able to pick a method out of a binding - should find the super method correctly - super - should be able to find the super method on a bound method - should be able to find super methods defined on super-classes when there are modules in the way - should be able to find the super method of an unbound method - should be able to find super methods defined on modules - jumps up multiple levels of bound method, even through modules - should return nil if no super method exists - all_from_obj - on normal objects - should not find methods defined on the classes singleton class - should find methods defined in modules included into the object's class - should work in the face of an overridden send - should find methods all the way up to Kernel - should find methods in modules included into the object's singleton class - should find methods defined in the object's class - should find methods defined in the object's singleton class - method resolution order - should include modules included into singleton classes - should include the included modules between a class and its superclass - should not include singleton classes of numbers - should include modules at the point which they would be reached - includes the Pry::Method.instance_resolution_order of Class after the singleton classes - should include the singleton class of objects - should look at a class and then its superclass - should include modules at most once - should include singleton classes for classes - should not include modules extended into the class - should include included modules for Modules - on classes - attributes overridden methods to the relevant singleton class in preference to Class - should find methods defined on modules extended into the class - should find methods defined on Class - should find methods defined on the singleton class of super-classes - should find methods defined on Kernel - should not find methods defined within the class - should attrbute overridden methods to the class not the module - should find methods defined in the class' singleton class - should attribute overridden methods to the sub-class' singleton class - .from_str - should look up methods using the object.method syntax - should NOT look up methods using the object.method syntax if no methods defined - looks up methods if no instance methods available and no options provided - should take care of cases like $ mongo[] - issue 998 - looks up instance methods if no methods available and no options provided - should look up methods using klass.new.method syntax - should NOT look up instance methods using the Class#method syntax if no instance methods defined - looks up instance methods first even if methods available and no options provided - should not raise an exception if receiver does not exist - should look up instance methods using klass.meth#method syntax - should look up instance methods using the Class#method syntax - should look up methods if :methods option provided - should look up methods using instance::bar syntax - should take care of corner cases like mongo[] e.g Foo::Bar.new[]- issue 998 - should look up instance methods if "instance-methods" option provided - #receiver - when it is overriden in Object - correctly reports the receiver - .signature - should print the name of block args, with an & label - should print the name of optional args, with =? after the arg name - should print the name of keyword args, with : after the arg name - should print the name of regular args - should print the name of keyword args, with :? after the arg name - should print the name of additional args, with an * label - #owner - when it is overriden in Object - correctly reports the owner - all_from_class - should be able to find instance methods defined in a super-class - should be able to find methods defined on a singleton class - finds private and protected instance methods defined in a class - should be able to find public instance methods defined in a class - should find methods all the way up to Kernel - should attribute overridden methods to the sub-class - should be able to find methods on super-classes when given a singleton class - finds instance methods defined in modules included into this class - finds instance methods defined in modules included into super-classes - method aliases - should be able to find method aliases - should return an empty Array if cannot find aliases - should be able to find aliases for methods implemented in C - should not include the own name in the list of aliases - should find aliases for top-level methods - #parameters - when it is overriden in Object - correctly reports the parameters - -pry_backtrace - should print a backtrace - -Pry::Command::Wtf - #process - when the code flag is present - prints lines of code that exception frame references - and when referenced frame doesn't exist - skips code and prints only the backtrace frame - when there wasn't an exception raised - raises Pry::CommandError - when the verbose flag is present - prints full exception backtrace - when given a nested exception - and when the verbose flag is missing - prints parts of both original and nested exception backtrace - and when the verbose flag present - prints both original and nested exception backtrace - when captures contains exclamations (wtf?! invocation) - prints more of backtrace - when the verbose flag is missing - prints only a part of the exception backtrace - -Pry::ControlDHandler - when given eval string is empty & pry instance has 2+ bindings - saves a dup of the current binding stack in the 'cd' command - pops the binding off the stack - when given eval string is non-empty - clears input buffer - when given eval string is empty & pry instance has one binding - throws :breakout - clears binding stack - -whereami - should not show line numbers or marker when -n switch is used - should work inside an object - should work inside a class - should work in objects with no method methods - uses Pry.config.default_window_size for window size when outside a method context - should work at the top level - should show entire method when -m option used - should show code window (not just method source) if parameter passed to whereami - should show entire file when -f option used - should work in BasicObjects - should work with prepended methods - should work with methods that have been undefined - should properly set _file_, _line_ and _dir_ - shows description and corrects code when @method.source_location would raise an error - shows description and corrects code when __LINE__ and __FILE__ are outside @method.source_location - -c - should show class when -c option used, and beginning of the class is on thesame line as another expression - should show class when -c option used, and locate correct candidate - should show class when -c option used, and binding is outside a method - should show class when -c option used, and locate correct superclass - -play - whatever - should properly reindent lines - should play a method (a single line) - should play a method (multiple lines) - has pretty error messages when -d cant find object - should restrict -d switch with --lines - should play documentation with the -d switch - should APPEND to the input buffer when playing a method line, not replace it - play -e - should run an expression from given line number - play -i - should play multi-ranged input expressions - playing a file - should play a file - should output file contents with print option - -Bundler - when Pry requires Gemfile, which doesn't specify Pry as a dependency - loads auto-completion correctly (PENDING: Temporarily skipped with xit) +test Pry defaults + should set the hooks default, and the default should be overridable + should set the output default, and the default should be overridable + should set the print default, and the default should be overridable + view_clip used for displaying an object in a truncated format + given the 'main' object + returns the #to_s of main (special case) + given an object with an #inspect string + returns the #<> format of the object (never use inspect) + the list of prompt safe objects + returns the #inspect of the special-cased immediate object: -5 + returns the #inspect of the custom prompt safe objects + returns the #inspect of the special-cased immediate object: hello + returns the #inspect of the special-cased immediate object: test + returns the #inspect of the special-cased immediate object: 1 + returns #<> format of the special-cased immediate object if #inspect is longer than maximum + returns the #inspect of the special-cased immediate object: 2.0 + given an object with an #inspect string as long as the maximum specified + returns the #<> format of the object (never use inspect) + given a regular object with an #inspect string longer than the maximum specified + when the object is a regular one + returns a string of the # format + when the object is a Class or a Module + with a #name shorter than or equal to the maximum specified + returns a string of the # format + with a #name longer than the maximum specified + returns a string of the # format + without a name (usually a c = Class.new) + returns a string of the # format + quiet + should show whereami by default + should hide whereami if quiet is set + prompts + sets the prompt default, and the default should be overridable (multi prompt) + sets the prompt default, and the default should be overridable (single prompt) + storing and restoring the prompt + should restore overridden prompts when returning from shell-mode + #pop_prompt should return the popped prompt + should not pop the last prompt + should have a prompt stack + #prompt= should replace the current prompt with the new prompt + when only one prompt on the stack + when several prompts on the stack + input + should set the input default, and the default should be overridable + should pass in the prompt if readline arity is 1 + should not pass in the prompt if the arity is 0 + should not pass in the prompt if the arity is -1 + toplevel_binding + should be devoid of local variables + should define private methods on Object + should have self the same as TOPLEVEL_BINDING + pry return values + should return the parameter (multi word string) given to exit-all + should return nil + should return the parameter (self) given to exit-all + should return the parameter (function call) given to exit-all + should return the parameter given to exit-all -Hanami integration - does not enter an infinite loop (#1471, #1621) +Pry::CodeObject + .lookup + when looking up commands with the super option + finds the command ignoring the super option + when looking up Pry commands by class + finds Pry::WrappedModule + when looking up Pry::ClassCommand + finds Pry:BlockCommand + when looking up 'nil' while being inside a class instance + infers the module + when looking up classes with 'super: 0' + finds the child class + when looking up anonymous class methods + finds instance methods via the # notation + when looking up classes by names of variables + finds instance methods via the # notation + when looking up empty string while being inside a class instance + infers the module + when looking up class methods of a named class + finds instance methods via the # notation + when looking up classes + finds classes + when looking up 'nil' + returns nil + when looking up empty string while being inside a method + infers the method + when looking up procs + finds classes + when looking up 'nil' while being inside a method + infers the method + when looking up classes with 'super: 1' + finds the parent class + when there is a class and a method who is a namesake + finds the class before the method when it's namespaced + finds the method when the look up ends with () + finds the class before the method + when looking up modules + finds modules + when looking up Pry commands by listing + finds Pry::WrappedModule + when looking up Pry::BlockCommand + finds Pry:BlockCommand + when looking up instance methods + finds instance methods via the # notation + finds instance methods via the . notation + when looking up method + finds methods defined on objects + when looking up 'nil' while being inside a module + infers the module + when looking up empty string while being inside a module + infers the module + when looking up instance methods of a class + finds instance methods -save-file - saving commands - should save a command to a file - overwrite by default (no --append) - should overwrite specified file with new input - saving methods - single method - should save a method to a file truncated by --lines - should save a method to a file - should display a success message on save - -f - should save a file to a file - -i - should save multi-ranged input expressions - should display a success message on save - should save input expressions to a file (single expression) - should save input expressions to a file (range) - --append - should append to end of specified file +Readline + is not loaded on invoking 'pry' if Pry.input is set + is not loaded on requiring 'pry' + is loaded on invoking 'pry' Pry::Config + is expected to be a kind of Array + is expected to eq true or equal false + is expected to be a kind of Pry::History + is expected to be a kind of Proc is expected to equal true or equal false - is expected to respond to #call - is expected to be a kind of OpenStruct + is expected to be a kind of String or equal nil is expected to equal true or equal false - is expected to be a kind of Array + is expected to be a kind of String is expected to be a kind of Pry::CommandSet - is expected to equal true or equal false - is expected to be a kind of IO + is expected to be a kind of OpenStruct is expected to be a kind of String - is expected to equal true or equal false - is expected to be a kind of Method is expected to be a kind of String - is expected to be a kind of Hash is expected to eq true or equal false - is expected to eq Pry::InputCompleter - is expected to be a kind of String is expected to equal true or equal false - is expected to be a kind of String is expected to equal true or equal false - is expected to be a kind of Proc - is expected to be a kind of Proc is expected to equal true or equal false - is expected to eq true or equal false - is expected to be a kind of Method - is expected to respond to #readline + is expected to be a kind of IO + is expected to equal true or equal false is expected to be a kind of Array - is expected to be a kind of Numeric - is expected to be a kind of Numeric is expected to be a kind of String - is expected to be a kind of Array is expected to equal true or equal false - is expected to be a kind of String or equal nil - is expected to be a kind of Pry::History - is expected to be a kind of Method - is expected to be a kind of Pry::Hooks + is expected to respond to #call is expected to equal true or equal false + is expected to equal true or equal false + is expected to be a kind of Array + is expected to eq Pry::InputCompleter + is expected to be a kind of Pry::Hooks + is expected to be a kind of Method is expected to be a kind of Pry::Prompt is expected to equal true or equal false - is expected to be a kind of String is expected to equal true or equal false + is expected to be a kind of Method + is expected to be a kind of Numeric + is expected to be a kind of String + is expected to be a kind of Numeric + is expected to respond to #readline + is expected to be a kind of Proc + is expected to be a kind of String is expected to equal true or equal false + is expected to be a kind of Hash + is expected to be a kind of Method + #respond_to? + when checking a defined option + returns true for the writer + returns true for the reader + when checking an undefined option + returns false #[] returns the config value reads the config value + #method_missing + when invoked method is not an option + returns nil + when invoked method is a LazyValue + defines a callable attribute + when invoked method ends with = + assigns a new custom option + #merge! + merges given hash with the config instance + returns self + when an undefined option is given + adds the option to the config #rc_file when ~/.pryrc exists and $XDG_CONFIG_HOME is undefined defaults to ~/.pryrc - when $PRYRC env variable is set - defaults to the value of PRYRC env variable when $XDG_CONFIG_HOME is defined - and when '/xdg_home/pry/pryrc' exists - defaults to $XDG_CONFIG_HOME/pry/pryrc and when ~/.pryrc exists defaults to ~/.pryrc and when ~/.config/pry/pryrc exists defaults to ~/.config/pry/pryrc + and when '/xdg_home/pry/pryrc' exists + defaults to $XDG_CONFIG_HOME/pry/pryrc and when no default rc file exists should return nil - #method_missing - when invoked method ends with = - assigns a new custom option - when invoked method is a LazyValue - defines a callable attribute - when invoked method is not an option - returns nil + when $PRYRC env variable is set + defaults to the value of PRYRC env variable #merge - doesn't mutate the original config returns a new config object - #respond_to? - when checking an undefined option - returns false - when checking a defined option - returns true for the writer - returns true for the reader - #merge! - merges given hash with the config instance - returns self - when an undefined option is given - adds the option to the config + doesn't mutate the original config #control_d_handler when it returns a callabale with two arguments and when it's called with one argument @@ -3301,170 +2278,1229 @@ when the handler expects multiple arguments prints a warning +ri + prints an error message without an argument + +Pry::Command::ShellCommand + cd + .cd + saves the current working directory + given an empty string + sends ~ to File.expand_path + given a path + sends the path to File.expand_path + with CDPATH + when it is defined + simple cdpath + cd's into the dir + complex cdpath + cd's into the dir + given a dash + given a prior directory + sends the user's last pry working directory to File.expand_path + given no prior directory + raises the correct error + +show-input + should correctly show the current lines in the input buffer + +Pry::Method::Patcher + should change the behaviour of the method + should preserve visibility + should change the source of new Pry::Method objects + should return a new method with new source + +Pry::Pager + PageTracker + treats a long line as taking up more than one row + records short lines that don't add up to a page + records a string with an embedded newline + records short lines that do add up to a page + doesn't count a line until it ends + doesn't count ansi color codes towards length + +Pry::Command::Cat::FileFormatter + #file_and_line + parses relative path without line_num + parses relative path with line_num + windows filesystem + parses '\'style absolute path with line_num + parses '/'style absolute path without line_num + parses '\'style absolute path without line_num + parses '/'style absolute path with line_num + UNIX-like filesystem + parses absolute path with line_num + parses absolute path without line_num + #format + formats given files + formats given files with line number + +Pry::Env + #[] + when ENV contains the passed key but its value is nil + is expected to be nil + when ENV contains the passed key + is expected to eq "val" + when ENV doesn't contain the passed key + is expected to be nil + +Pry::Code + #select + selects lines matching a condition + returns a code object + .from_method + reads lines from a method's definition + #highlighted + returns a highlighted for terminal string representation of code + #reject + returns a code object + rejects lines matching a condition + #push + is an alias of #<< + appends lines to the code + #with_indentation + indents lines + #expression_at + returns a multiline expressiong starting on the given line number + #around + when line number is nil + returns self + when line number is an integer + selects one line around the specified line number + and we specify how many lines to select + selects more than 1 line around + #grep + when pattern is nil + returns self + when pattern is specified + returns lines matching the pattern + #method_missing + when a String responds to the given method + forwards the method to a String instance + when a String does not respond to the given method + raises NoMethodError + #== + when a code is compared with another code with identical lines + returns true + when a code is compared with another code with different lines + returns true + when an empty code is compared with another empty code + returns true + #after + when line number is nil + returns self + when line number is an integer + selects one line around the specified line number + and we specify how many lines to select + selects more than 1 line around + Pry::Code() + when given a Pry::Method + reads lines from Pry::Method + when given a Code object + returns the passed parameter unchanged + when given an Array + reads lines from the array + when given a Method + reads lines from bound method + when given a Proc + reads lines from proc + when given an UnboundMethod + reads lines from unbound methods + #with_line_numbers + appends line numbers to code + #take_lines + takes N lines from start_line + #max_lineno_width + when there are less than 100 lines + returns 2 + when there are less than 1000 lines + returns 3 + when there are less than 10 lines + returns 1 + #between + when both start_line and end_line are specified + returns a code object + removes all lines that aren't in the given range + when start_line is nil + returns self + when a negative end_line is specified + returns a range of lines from the end + when a negative start_line is specified + returns a line from the end + when start_line is a Range + returns a range fo lines corresponding to the given Range + when only start_line is specified + returns a code object + removes leaves only the specified line + #to_s + returns a string representation of code + #with_marker + shows a marker in the right place + .from_module + reads line from a class + sets code type to :ruby + #nesting_at + returns an Array of open modules + #respond_to_missing? + when a String does not respond to the given method + doesn't find the method + when a String responds to the given method + finds the method that is not defined on self + #length + returns how many lines the code object has + .from_file + reads lines from a file relative to origin pwd + reads lines from a file relative to current pwd + raises error when file doesn't exist + reads lines from a file on disk + reads lines from a file relative to origin pwd with '.rb' omitted + sets code type according to the file + when readling lines from Pry's line buffer + can specify file type manually + reads entered lines + when reading files from $LOAD_PATH + finds files with '.rb' extensions + finds Ruby files with omitted '.rb' extension + recognizes Gemfile as a Ruby file + doesn't confuse files with the same name, but with an extension + finds files in a relative directory with '.rb' extension + doesn't confuse files with the same name, but without an extension + finds files in a relative directory with '.rb' omitted + when reading lines from a file without an extension + sets code type to :unknown + #before + when line number is an integer + selects one line before the specified line number + and we specify how many lines to select + selects more than 1 line before + when line number is nil + returns self + #raw + when code has a marker + returns an unformatted String of all lines + #comment_describing + returns a comment describing expression + +disable-pry + should set DISABLE_PRY + should quit the current session + +Pry::Output + #<< + is expected to eq # + #decolorize_maybe + when the given pry instance has 'color' disabled + returns decolorized string + when the given pry instance has 'color' enabled + returns the given string without modifications + #puts + returns nil + when given an empty array + prints a newline + when the given pry instance has 'color' enabled + doesn't decolorize output + when given non-convertible to array objects + prints the non-converted objects in its string form + and when the object's #to_s has a newline + doesn't print a double newline + when the given pry instance has 'color' disabled + decolorizes output + when given multiple empty arrays + prints multiple newline + when given convertible to array objects + prints the converted objects + #size + when the output is not a tty, and no info in ENV and no Readline info + and when there's no ANSICON ENV variable + returns the default winsize + and when there's ANSICON ENV variable + and when it can be matched + and when the size consists of positive integers + returns the ansicon winsize + and when the size has a zero column + returns the default winsize + and when it cannot be matched + returns the default winsize + when the output is not a tty + and ENV has size info in ROWS and COLUMNS + returns the ENV variable winsize + and ENV has size info in LINES and COLUMNS + returns ENV variable winsize + when the output is a tty and responds to winsize + returns the io/console winsize + when the output is not a tty and no info in ENV + when Readline's size has no zeroes + returns the Readline winsize + when Readline's size has zero column + returns the default size + #tty? + when the output responds to #tty? and is a TTY + returns true + when the output doesn't respond to #tty? + returns false + when the output responds to #tty? and is not a TTY + returns false + #respond_to_missing? + when the output responds to the given method name + finds the method that is not defined on self + when the output doesn't respond to the given method name + doesn't find the method + #width + returns the number of columns + #height + returns the number of rows + #print + returns nil + when the given pry instance has 'color' disabled + decolorizes output + when the given pry instance has 'color' enabled + doesn't decolorize output + #method_missing + when the output responds to the given method name + forwards the method to the output + when the output doesn't respond to the given method name + raises NoMethodError + #write + is expected to eq # + +Pry::Config::MemoizedValue + #call + doesn't conflate falsiness with unmemoizedness + memoizes the result of call + +exit + should break out of the repl even after an exception + should break out of the repl when binding_stack has only one binding + should pop a binding + should break out of the repl and return user-given value + +whereami + should not show line numbers or marker when -n switch is used + should work with methods that have been undefined + should work in objects with no method methods + uses Pry.config.default_window_size for window size when outside a method context + should work inside a class + should work inside an object + shows description and corrects code when __LINE__ and __FILE__ are outside @method.source_location + should work in BasicObjects + should show entire file when -f option used + should show entire method when -m option used + should work with prepended methods + should show code window (not just method source) if parameter passed to whereami + should properly set _file_, _line_ and _dir_ + shows description and corrects code when @method.source_location would raise an error + should work at the top level + -c + should show class when -c option used, and locate correct candidate + should show class when -c option used, and binding is outside a method + should show class when -c option used, and locate correct superclass + should show class when -c option used, and beginning of the class is on thesame line as another expression + +Pry::Config::LazyValue + #call + doesn't memoize the result of call + +Sticky locals (_file_ and friends) + locals should keep value after cd-ing (pry_instance) + locals should all exist upon initialization + locals should keep value after cd-ing (_file_ and _dir_) + locals should still exist after cd-ing into a new context + locals should return second last result (__) + locals should return last result (_) + _ex_ + keeps its value after cd-ing + returns the last exception without wrapping it in a LastException + User defined sticky locals + should still exist after cd-ing into new binding + should create a new sticky local + should provide different values for successive block invocations + hash option value should override config value + should define a new sticky local for the session (normal value) + setting as Pry.config option + should define a new sticky local for the session (normal value) + should define a new sticky local for the session (proc) + passing in as hash option when creating pry instance + should define a new sticky local for the session (normal value) + should define multiple sticky locals + should define a new sticky local for the session (as Proc) + +Pry::ControlDHandler + when given eval string is empty & pry instance has one binding + throws :breakout + clears binding stack + when given eval string is non-empty + clears input buffer + when given eval string is empty & pry instance has 2+ bindings + pops the binding off the stack + saves a dup of the current binding stack in the 'cd' command + +Pry::Command::Wtf + #process + when the verbose flag is missing + prints only a part of the exception backtrace + when the code flag is present + prints lines of code that exception frame references + and when referenced frame doesn't exist + skips code and prints only the backtrace frame + when captures contains exclamations (wtf?! invocation) + prints more of backtrace + when the verbose flag is present + prints full exception backtrace + when given a nested exception + and when the verbose flag present + prints both original and nested exception backtrace + and when the verbose flag is missing + prints parts of both original and nested exception backtrace + when there wasn't an exception raised + raises Pry::CommandError + +Pry::ExceptionHandler + .handle_exception + when exception is a nested standard error + prints standard error message + when exception is a UserError and a SyntaxError + prints the syntax error with customized message + when exception is a standard error + prints standard error message + +Hanami integration + does not enter an infinite loop (#1471, #1621) + +Pry::Hooks + adding a new hook + should not allow adding of a hook with a duplicate name + should return a count of 0 for an empty hook + should use block if given both block and callable + should not execute hook while adding it + should create multiple hooks for an event + should create a new hook with a block + should raise if not given a block or any other object + should create a new hook with a callable + Pry::Hooks#merge + merge! + should not share merged elements with original + should preserve hook order + should NOT overwrite hooks belonging to shared event in receiver + should overwrite identical hook in receiver + should merge in the Pry::Hooks + merge + should return a fresh, independent instance + should contain hooks from original instance + should not affect original instances when new hooks are added + anonymous hooks + should only allow one anonymous hook to exist + should execute most recently added anonymous hook + should allow adding of hook without a name + dupping a Pry::Hooks instance + should share hooks with original + adding a new hook to dupped instance should not affect original + adding a new event to dupped instance should not affect original + clearing all hooks for an event + should clear all hooks + integration tests + after_session hook + should always run, even if uncaught exception bubbles out of repl + before_eval hook + modifying input code + should not interfere with command processing when replacing input code + should replace input code with code determined by hook + exceptions + should not raise exceptions + should print out a notice for each exception raised + when_started hook + should allow overriding of target (and binding_stack) + should yield options to the hook + target + should yield the target to the hook + should yield the target, as a binding + deleting a hook + should return nil if hook does not exist + should successfully delete a hook + should return the deleted hook + executing a hook + should execute a general callable hook + return value of exec_hook should be that of last executed hook + should execute all hooks for an event if more than one is defined + should add exceptions to the errors array + should return the last exception raised as the return value + should execute block hook + should execute hooks in order + should execute proc hook + getting hooks + get_hooks + should return a hash of hook names/hook functions for an event + should return an empty hash if no hooks defined + get_hook + should return nil if hook does not exist + should return the correct requested hook + .default + returns hooks with default before_session hook + when pry instance is quiet + doesn't run the whereami command + when pry instance is not quiet + runs the whereami command + +Pry::CommandSet + #[] + when there's an ambiguous command + prefers a command with a higher score + when there's an unambiguous command + selects the command according to the given pattern + #new + merges other set with itself + when block given + instance evals the block + #process_line + when the given line is a command + returns a command + returns a non-void command + and context is provided + passes the context to the command + when the given line is not a command + returns a void result + returns not a command + #list_commands + returns the list of commands + #find_command_by_match_or_listing + raises ArgumentError on non-matching command + returns a matching by listing command + returns a matching by name command + #import + returns self + imports commands from given sets + includes given sets' helper modules + #each + iterates over commands + #create_command + configures command options + class_evals the given block in the command context + defines a new class command + can overwrite default description + assings default description + when description is a hash + treats description as options + #alias_command + sets aliased command's listing for string alias + returns the aliased command + sets group for the aliased command automatically + sets description for the aliased command automatically + sets aliased command's listing for regex alias + when string description is provided + uses the given description for the aliased command + when non-string description is provided + uses the string representation of the given object + when command doesn't match + raises RuntimeError + #delete + deletes given commands + #desc + gets command description + sets command description + #[]= + rebinds the command with key + when given command is nil + deletes the command matching the pattern + when given command is not a subclass of Pry::Command + raises TypeError + #valid_command? + when command cannot be found + returns false + when command can be found + returns true + #import_from + returns self + imports matching command from a set + includes other set's helper module + #find_command_for_help + when the command cannot be found + returns nil + when the command can be found + returns the command + #add_command + adds a command + #to_hash + converts commands to hash + doesn't mutate original commands + #block_command + configures command options + defines a new command + can overwrite default description + assings default description + when description is a hash + treats description as options + #rename_command + can optionally set custom description + renames a comamnd + when provided command is not registered + raises ArgumentError + +watch expression + prints when an expression changes + continues to work if you start a second pry instance + prints when an expression is mutated + prints no watched expressions + doesn't print when an expresison remains the same + watches a local variable + registers the after_eval hook + watches an expression + deleting expressions + deletes delete + keeps keeper + show-doc shows docs emits a deprecation warning -Pry::Warning - #warn - prints message with file and line of the calling frame +Pry::Prompt + prompt invocation + computes prompt name dynamically + #name + returns name + #prompt_procs + returns the proc array + #description + returns description + .all + returns a hash with prompts + returns a duplicate of original prompts + .add + raises error on adding a prompt with the same name + adds a new prompt + raises error when separators.size != 2 + returns nil + #incomplete_proc + returns the second proc + #wait_proc + returns the first proc + .[] + accesses prompts + +help + should display help for a specific command + should display help for a command with a spaces in its name + should display help for a regex command with a "listing" + should sort the output of the 'help' command + should display help for all commands with a description ls - on java objects - should include java-esque aliases if requested (PENDING: No reason given) - should omit java-esque aliases by default (PENDING: No reason given) - bug #1407 - behaves as usual when a method of the same name exists. + when no arguments given + when at the top-level + should show local variables + when in a class + should show class variables + should show methods + should show constants + when in an object + should show methods + should show instance variables + grep + should reduce the number of outputted things + should still output matching things + help + should show help with -h below ceiling - should include object if -v is given - should include super-classes by default should stop before Object by default + should include super-classes by default should not include super-classes when -q is given + should include object if -v is given when inside Modules - should behave normally when invoked on Module itself should still work + should behave normally when invoked on Module itself should work for ivars should include instance methods by default - BasicObject - should work on subclasses of BasicObject - should work on BasicObject - help - should show help with -h + on java objects + should include java-esque aliases if requested (PENDING: No reason given) + should omit java-esque aliases by default (PENDING: No reason given) immediates should work on Integer - with -l - should not list pry noise - should find locals and sort by descending size - grep - should still output matching things - should reduce the number of outputted things + methods + should show error message when instance is given with -M option + should show protected/private methods with -p + should handle classes that (pathologically) define .ancestors + should show public methods with -p + should show public methods by default + should not show protected/private by default + should work for objects which instance_variables returns array of symbol but there is no Symbol#downcase + should work for objects with an overridden method method + BasicObject + should work on BasicObject + should work on subclasses of BasicObject + bug #1407 + behaves as usual when a method of the same name exists. constants - should show constants defined on the current module + should show constants for an object's class regardless of mixins works on top-level + should show constants defined on the current module should show constants defined on ancestors with -v should not show constants defined on parent modules by default should not autoload constants! - should show constants for an object's class regardless of mixins - when no arguments given - when at the top-level - should show local variables - when in an object - should show methods - should show instance variables - when in a class - should show constants - should show methods - should show class variables - methods - should show public methods by default - should work for objects which instance_variables returns array of symbol but there is no Symbol#downcase - should work for objects with an overridden method method - should show public methods with -p - should show error message when instance is given with -M option - should handle classes that (pathologically) define .ancestors - should show protected/private methods with -p - should not show protected/private by default + with -l + should find locals and sort by descending size + should not list pry noise + +Pry::SystemCommandHandler + .default + when doesn't exist + executes the command without printing the warning + when command exists + executes the command without printing the warning + +jump-to + prints error when trying to jump to a non-existent binding index + jumps to the proper binding index in the stack + prints an error when trying to jump to the same binding index + +exit-program + should raise SystemExit + should exit the program with the provided value + +Pry::REPL + should let you run commands in the middle of multiline expressions + should rescue exceptions + space prefix + with more than 1 space + prioritizes commands over variables + with 1 space + it prioritizes variables over commands + eval_string and binding_stack + should immediately evaluate eval_string after cmd if complete + shouldn't break if we pop bindings in Ruby + shouldn't break if we start a nested REPL + shouldn't break if we start a nested instance + #piping? + returns false when $stdout is a non-IO object + autoindent + should raise no exception when indented with a tab (PENDING: Temporarily skipped with xit) + +pry_backtrace + should print a backtrace Pry::WrappedModule - .from_str - should lookup a constant - should lookup a local - should lookup an ivar + candidates + doc + should return docs for deeply nested class + should return primary candidates doc by default + should return doc for second ranked candidate + should return doc for third ranked candidate + should return doc for highest ranked candidate + number_of_candidates + should return the correct number of candidates + should return 0 candidates for a class with no nested modules or methods + should return 1 candidate for a class with a nested module with methods + source_location + should return nil if no source_location can be found + returns the location of the outer module if an inner module has methods + should return primary candidates source_location by default + source + should return source for second ranked candidate + should return primary candidates source by default + should return source for highest ranked candidate + should return source for third ranked candidate + should return source for deeply nested class + ordering of candidates + should raise when trying to access non-existent candidate + returns class with third largest number of methods as third ranked candidate + returns class with second largest number of methods as second ranked candidate + should return class with largest number of methods as primary candidate + #initialize + should raise an exception when a non-module is passed + .singleton_instance + should raise an exception when called on a non-singleton-class + should return the attached object .super receiver is a class should ignore modules when retrieving nth superclass - should return self when .super(0) is used should return nth superclass for a wrapped class - should return superclass for a wrapped class should return nil when no nth superclass exists + should return self when .super(0) is used + should return superclass for a wrapped class receiver is a module should not ignore modules when retrieving supers - should retrieve nth super should return self when .super(0) is used - .singleton_instance - should raise an exception when called on a non-singleton-class - should return the attached object - .singleton_class? - should be true for singleton classes - should be false for normal classes - should be false for modules + should retrieve nth super .method_prefix of singleton classes of anonymous classes should not be empty + should return Bar# for modules of singleton classes of objects of anonymous classes should not be empty should return Foo# for normal classes - should return Bar# for modules should return Foo. for singleton classes of classes - candidates - source - should return source for third ranked candidate - should return source for second ranked candidate - should return primary candidates source by default - should return source for deeply nested class - should return source for highest ranked candidate - source_location - returns the location of the outer module if an inner module has methods - should return primary candidates source_location by default - should return nil if no source_location can be found - doc - should return doc for highest ranked candidate - should return docs for deeply nested class - should return primary candidates doc by default - should return doc for second ranked candidate - should return doc for third ranked candidate - ordering of candidates - returns class with second largest number of methods as second ranked candidate - should return class with largest number of methods as primary candidate - should raise when trying to access non-existent candidate - returns class with third largest number of methods as third ranked candidate - number_of_candidates - should return 1 candidate for a class with a nested module with methods - should return 0 candidates for a class with no nested modules or methods - should return the correct number of candidates - #initialize - should raise an exception when a non-module is passed + .from_str + should lookup a local + should lookup a constant + should lookup an ivar + .singleton_class? + should be false for normal classes + should be true for singleton classes + should be false for modules Pry - loading rc files - should never run the rc file twice - should not run the rc file at all if Pry.config.should_load_rc is false - should not load the pryrc if it cannot expand ENV[HOME] - should not load the pryrc if pryrc's directory permissions do not allow this - should not load the rc file twice if it's symlinked differently - that raise exceptions - should continue to run pry - should not raise exceptions - should output an error + should display correct number of errors on invalid syntax like ["puts )("] + should not raise an error on broken lines: pouts(< do + should indent a hash + should not raise error, if MIDWAY_TOKENS are used without indentation + should indent correctly with nesting + should not indent nested HEREDOCs + should handle multiple open and closing tokens on a line + should not indent single-line ifs + should differentiate single/multi-line unless + should indent a module and class + should indent an array + should not indent inside HEREDOCs + should indent statements such as if, else, etc + should ident case statements + should indent begin rescue end + should not indent single line statements + should indent cunningly disguised ifs + should indent a function + nesting + should parse nesting on line 16 of example_nesting.rb + should parse nesting on line 8 of example_nesting.rb + should parse nesting on line 14 of example_nesting.rb + should parse nesting on line 3 of example_nesting.rb + should parse nesting on line 31 of example_nesting.rb + should parse nesting on line 7 of example_nesting.rb + should parse nesting on line 26 of example_nesting.rb + should fail to parse nesting on line 19 of example_nesting.rb + should parse nesting on line 22 of example_nesting.rb + should parse nesting on line 1 of example_nesting.rb + should parse nesting on line 33 of example_nesting.rb + should parse nesting on line 5 of example_nesting.rb + should parse nesting on line 6 of example_nesting.rb + should parse nesting on line 4 of example_nesting.rb + should parse nesting on line 15 of example_nesting.rb + should parse nesting on line 27 of example_nesting.rb + should fail to parse nesting on line 21 of example_nesting.rb + should fail to parse nesting on line 20 of example_nesting.rb + should parse nesting on line 23 of example_nesting.rb + should fail to parse nesting on line 17 of example_nesting.rb + should parse nesting on line 9 of example_nesting.rb + should fail to parse nesting on line 30 of example_nesting.rb + should parse nesting on line 29 of example_nesting.rb + should fail to parse nesting on line 18 of example_nesting.rb + should parse nesting on line 28 of example_nesting.rb + should parse nesting on line 24 of example_nesting.rb + should parse nesting on line 2 of example_nesting.rb + should parse nesting on line 10 of example_nesting.rb + should parse nesting on line 25 of example_nesting.rb + should parse nesting on line 32 of example_nesting.rb + should parse nesting on line 11 of example_nesting.rb + should parse nesting on line 12 of example_nesting.rb + should parse nesting on line 13 of example_nesting.rb + +Pry + output failsafe + should catch serialization exceptions + should display serialization exceptions + should catch errors serializing exceptions + default print + should include the => + doesn't leak colour for object literals + should output the right thing + should not be phased by un-inspectable things + color + should not colorize strings that already include color + should colorize strings as though they were ruby + custom non-IO object as $stdout + does not crash pry + output_prefix + should be able to change output_prefix + output suppression + should not output anything if the input ends with a semicolon + should not output something if the input is only a comment + should output something if the input ends with a comment + should normally output the result + +Bundler + when Pry requires Gemfile, which doesn't specify Pry as a dependency + loads auto-completion correctly (PENDING: Temporarily skipped with xit) + +Pry::Helpers::CommandHelpers + #get_method_or_raise + when there's no method name + raises MethodNotFound + when super opt is provided but there's no super method + raises MethodNotFound + when super opt is provided and there's a parent method + gets the parent method + when there's name but no corresponding method + raises MethodNotFound + #one_index_number + when line number is 0 + returns the line number + when line number is more than 0 + decrements the line number + #restrict_to_lines + when lines are specified as a range + restricts the given string to the specified range + when lines are specified as an integer + restricts the given string to the specified line number + #unindent + should ignore lines starting with -- + should only remove a common prefix + removes the same prefix from all lines + should also remove tabs if present + should not be phased by empty lines + #absolute_index_number + when line number is less than zero + returns the absolute sum of line number and array length + when line number is zero + returns the line number + #absolute_index_range + when given an integer + returns a range based on the integer and array length + when given an integer + returns an absolute range that was decremented + #set_file_and_dir_locals + injects local variable _dir_ + injects local variable _file_ + sets pry instance's last_file to _file_ + sets pry instance's last_dir to _dir_ + #internal_binding? + when target's __method__ returns __pry__ + returns true + when target's __method__ returns __binding__ + returns true + when target's __method__ returns nil + returns true + #one_index_range_or_number + when given a range + decrements range boundaries + when given an integer + decrements the line number + #one_index_range + decrements range boundaries + #temp_file + yields a tempfile + creates a tempfile with rb extension + closes the tempfile + allows overwriting file extension + unlinks the tempfile + +raise-up + should eat the exception at the last new pry instance on raise-up + should raise an unamed exception with raise-up + should allow you to cd up and (eventually) out + should raise the exception with raise-up + should jump immediately out of nested contexts with ! + should raise the most recently raised exception + +Pry::Helpers::DocumentationHelpers + process_rdoc + should emphasise italic tags + should emphasise em tags + should syntax highlight things in backticks + should not remove ++ + should highlight words surrounded by +s + should not syntax highlight already highlighted code + should syntax highlight indented code + should not double-highlight backticks inside indented code + should syntax highlight code in + should syntax highlight code in + get_comment_content + should remove shebangs + should unindent past separators + should strip out leading lines of hashes + should strip off the hash and unindent + +Pry.run_command + can perform a show-source + performs a simple ls + +cat + with --in + should display the last few expressions with indices + when invoked without arguments + should display an error message + with --ex + cat --ex should correctly display code that generated exception + cat --ex should display repl code that generated exception + with --in -1 + should display the last expression with no index + with --in 1 + should display the first expression with no index + with --ex N + should cat second level of backtrace when --ex 1 used + should cat third level of backtrace when --ex 2 used + should cat first level of backtrace when --ex 0 used + should cat first level of backtrace when --ex used with no argument + each successive cat --ex should show the next level of backtrace, and going past the final level should return to the first + should show error when backtrace level out of bounds + on receiving a file that does not exist + should display an error message + with --in 1..2 + should display the given range with indices, omitting nils + +Pry.config.unrescued_exceptions + should rescue all exceptions NOT specified on unrescued_exceptions + should NOT rescue exceptions specified on unrescued_exceptions + +Pry::Editor + invoke_editor with a proc + should not shell-escape files + .default + when no editor is detected + shells out to find 'vi' + shells out to find 'nano' + shells out to find 'editor' + when $EDITOR is defined + returns the value of $EDITOR + when $VISUAL is defined + returns the value of $VISUAL + when platform is Windows + returns 'notepad' + build_editor_invocation_string + should shell-escape files + build_editor_invocation_string on windows + should not shell-escape files + +Pry + DISABLE_PRY + should not binding.pry + should not Pry.start + FAIL_PRY + should raise an error for Pry.start + should raise an error for binding.pry + Pry.binding_for + should not leak local variables + Should not error when object doesn't have a valid == method + should work on frozen objects + Pry.critical_section + should prevent Pry being called + #last_exception= + returns an object who mirrors itself as the wrapped exception + returns an instance of Pry::LastException + returns a frozen exception + a fresh instance + should use `caller` as its backtrace + setting custom options + correctly handles the :quiet option (#1261) + does not raise for unrecognized options + .configure + yields a block with Pry.config as its argument + Exotic object support + Should not error when return value is a BasicObject instance + open a Pry session on an object + rep + should display error if Pry instance runs out of input + should suppress output if input ends in a ";" and is an Exception object (single line) + should make self evaluate to the receiver of the rep session + should suppress output if input ends in a ";" (single line) + should define a nested class under Hello and not on top-level or Pry + should be able to operate inside the BasicObject class + should be able to evaluate exceptions normally + should set an ivar on an object + should notice when exceptions are raised + should not try to catch intended exceptions + should not leak pry constants into Object namespace + inside signal handler + should return with error message + multi-line input + works + should suppress output if input ends in a ";" (multi-line) + newline stripping from an empty string + with double quotes + with fancy delimiters + with single quotes + newline from an empty heredoc + works + newline stripping from an empty regexp + with fancy delimiters + with regular regexp delimiters + repl + defining methods + defines an instance method on the class when performing "def meth;end" inside the class + defines an instance method on the module when performing "def meth;end" inside the module + defines a method on the class of an object when performing "def meth;end" inside an immediate value or Numeric + defines a method on the singleton class of an object when performing "def meth;end" inside the object + Pry.binding_for + should return TOPLEVEL_BINDING if parameter self is main + last_result + should be set to the most recent value + should be preserved over an empty line + should be preserved when evalling a command without :keep_retval + should be set to the result of a command with :keep_retval + basic functionality + should set an ivar on an object and exit the repl + complete_expression? + should not mutate the input! + history arrays + uses 100 as the size of _in_ and _out_ + sets _in_ to an array with the entered lines + can change the size of the history arrays + store exceptions + sets _ to the last result + sets out to an array with the result + nesting + should nest properly + Object#pry + should start a pry session on the receiver (second form) + should start a pry session on the receiver (first form) + should raise if more than two arguments are passed to Object#pry + +save-file + saving methods + single method + should display a success message on save + should save a method to a file + should save a method to a file truncated by --lines + -f + should save a file to a file + -i + should display a success message on save + should save input expressions to a file (range) + should save multi-ranged input expressions + should save input expressions to a file (single expression) + saving commands + should save a command to a file + --append + should append to end of specified file + overwrite by default (no --append) + should overwrite specified file with new input + +play + playing a file + should play a file + should output file contents with print option + whatever + should play a method (multiple lines) + should restrict -d switch with --lines + has pretty error messages when -d cant find object + should play documentation with the -d switch + should properly reindent lines + should APPEND to the input buffer when playing a method line, not replace it + should play a method (a single line) + play -e + should run an expression from given line number + play -i + should play multi-ranged input expressions + +Pry::ClassCommand + #help + returns help output + #slop + defines the help option + returns a Slop instance + makes Slop's banner unindented + when there are subcommands + adds subcommands to Slop + when there are options + adds subcommands to Slop + .source_line + returns source file + .source_location + returns source location + .source_file + returns source file + #complete + generates option completions + #process + raises CommandError + .doc + returns source code for the process method + .inherited + when match is defined + sets match on the subclass + when command_options is defined + sets command_options on the subclass + when description is defined + sets description on the subclass + #call + invokes setup + sets command's args + sets command's opts + when help is not invloved + when #process accepts no arguments + calls the command despite passed arguments + when #process accepts some arguments + calls the command even if there's not enough arguments + calls the command even if there are more arguments than needed + when passed a variable-length array + calls the command with some arguments + calls the command without arguments + when help is invoked + returns void value + outputs help info + .source + returns source code for the process method -show-input - should correctly show the current lines in the input buffer +amend-line + should correctly delete a range of lines using the ! for content + should ignore second value of range with > syntax + should correctly delete a specific line using the ! for content + should correctly delete the previous line using the ! for content + should correctly amend the specified range of lines + should amend the specified range of lines, with numbers < 0 in range + should display error if nothing to amend + should amend a range of lines of input when negative numbers given + should correctly insert a line before a specified line using > + should amend the last line of input when no line number specified + should amend the specified line of input when line number given + should amend the first line of input when 0 given as line number + should amend a specified line when negative number given + should correctly amend the specified line with interpolated text Pending: (Failures listed here are expected and do not affect your suite's status) - 1) Pry::REPL autoindent should raise no exception when indented with a tab - # Temporarily skipped with xit - # ./spec/pry_repl_spec.rb:127 - - 2) Pry::InputCompleter should not crash if there's a Module that has a symbolic name. + 1) Pry::InputCompleter should not crash if there's a Module that has a symbolic name. # No reason given # ./spec/completion_spec.rb:36 - 3) Bundler when Pry requires Gemfile, which doesn't specify Pry as a dependency loads auto-completion correctly - # Temporarily skipped with xit - # ./spec/integration/bundler_spec.rb:10 - - 4) ls on java objects should include java-esque aliases if requested + 2) ls on java objects should include java-esque aliases if requested # No reason given # ./spec/commands/ls_spec.rb:302 - 5) ls on java objects should omit java-esque aliases by default + 3) ls on java objects should omit java-esque aliases by default # No reason given # ./spec/commands/ls_spec.rb:295 -Finished in 21.34 seconds (files took 1.25 seconds to load) + 4) Pry::REPL autoindent should raise no exception when indented with a tab + # Temporarily skipped with xit + # ./spec/pry_repl_spec.rb:127 + + 5) Bundler when Pry requires Gemfile, which doesn't specify Pry as a dependency loads auto-completion correctly + # Temporarily skipped with xit + # ./spec/integration/bundler_spec.rb:10 + +Finished in 1 minute 5.77 seconds (files took 5.38 seconds to load) 1437 examples, 0 failures, 5 pending -Randomized with seed 3532 +Randomized with seed 52519 /usr/bin/ruby3.3 /usr/bin/gem2deb-test-runner @@ -3481,2123 +3517,2099 @@ RUBYLIB=. GEM_PATH=/build/reproducible-path/pry-0.14.2/debian/pry/usr/share/rubygems-integration/all:/build/reproducible-path/pry-0.14.2/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.3.0:/var/lib/gems/3.3.0:/usr/local/lib/ruby/gems/3.3.0:/usr/lib/ruby/gems/3.3.0:/usr/lib/arm-linux-gnueabihf/ruby/gems/3.3.0:/usr/share/rubygems-integration/3.3.0:/usr/share/rubygems-integration/all:/usr/lib/arm-linux-gnueabihf/rubygems-integration/3.3.0 ruby3.3 -S rake --rakelibdir /gem2deb-nonexistent -f debian/ruby-tests.rake /usr/bin/ruby3.3 -I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib /usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation -Randomized with seed 46010 +Randomized with seed 63931 -Pry::Method - should use String names for compatibility - .from_str - should look up instance methods if "instance-methods" option provided - looks up instance methods if no methods available and no options provided - looks up methods if no instance methods available and no options provided - should look up methods using klass.new.method syntax - should NOT look up methods using the object.method syntax if no methods defined - should take care of corner cases like mongo[] e.g Foo::Bar.new[]- issue 998 - should NOT look up instance methods using the Class#method syntax if no instance methods defined - should take care of cases like $ mongo[] - issue 998 - should look up instance methods using the Class#method syntax - should look up methods using the object.method syntax - should not raise an exception if receiver does not exist - should look up methods using instance::bar syntax - should look up instance methods using klass.meth#method syntax - should look up methods if :methods option provided - looks up instance methods first even if methods available and no options provided - all_from_class - should be able to find instance methods defined in a super-class - finds instance methods defined in modules included into this class - should be able to find methods defined on a singleton class - should be able to find methods on super-classes when given a singleton class - finds private and protected instance methods defined in a class - should find methods all the way up to Kernel - finds instance methods defined in modules included into super-classes - should attribute overridden methods to the sub-class - should be able to find public instance methods defined in a class - method_name_from_first_line - should work in all simple cases - method aliases - should not include the own name in the list of aliases - should be able to find method aliases - should be able to find aliases for methods implemented in C - should find aliases for top-level methods - should return an empty Array if cannot find aliases - #parameters - when it is overriden in Object - correctly reports the parameters - #owner - when it is overriden in Object - correctly reports the owner - super - should be able to find the super method of an unbound method - should be able to find super methods defined on modules - should be able to find super methods defined on super-classes when there are modules in the way - jumps up multiple levels of bound method, even through modules - should be able to find the super method on a bound method - should return nil if no super method exists - #receiver - when it is overriden in Object - correctly reports the receiver - all_from_obj - on classes - should attrbute overridden methods to the class not the module - should not find methods defined within the class - should find methods defined on Class - should find methods defined on modules extended into the class - should find methods defined in the class' singleton class - should find methods defined on Kernel - should attribute overridden methods to the sub-class' singleton class - should find methods defined on the singleton class of super-classes - attributes overridden methods to the relevant singleton class in preference to Class - on normal objects - should find methods defined in the object's singleton class - should not find methods defined on the classes singleton class - should find methods defined in the object's class - should find methods in modules included into the object's singleton class - should find methods defined in modules included into the object's class - should work in the face of an overridden send - should find methods all the way up to Kernel - method resolution order - should include the included modules between a class and its superclass - should include modules included into singleton classes - should look at a class and then its superclass - should include included modules for Modules - should include modules at the point which they would be reached - should not include singleton classes of numbers - should include the singleton class of objects - should include singleton classes for classes - includes the Pry::Method.instance_resolution_order of Class after the singleton classes - should not include modules extended into the class - should include modules at most once - .from_binding - should find the right method if a super method exists - should not find a wrong method by matching on nil source location - should find the right method even if it was renamed and replaced - should find the super method correctly - should find the right method from a BasicObject - should find methods that have been undef'd - should NOT find a method from the toplevel binding - should be able to pick a method out of a binding - .signature - should print the name of additional args, with an * label - should print the name of keyword args, with :? after the arg name - should print the name of regular args - should print the name of keyword args, with : after the arg name - should print the name of optional args, with =? after the arg name - should print the name of block args, with an & label +reload_code + reload_current_file + raises an error when pry command not found + raises an error when class not found + raises an error source code not found + reloads pry commmand -show-doc - shows docs - emits a deprecation warning +amend-line + should amend the first line of input when 0 given as line number + should amend a specified line when negative number given + should amend a range of lines of input when negative numbers given + should correctly amend the specified line with interpolated text + should amend the specified line of input when line number given + should ignore second value of range with > syntax + should correctly amend the specified range of lines + should display error if nothing to amend + should amend the last line of input when no line number specified + should correctly delete a specific line using the ! for content + should correctly insert a line before a specified line using > + should correctly delete a range of lines using the ! for content + should amend the specified range of lines, with numbers < 0 in range + should correctly delete the previous line using the ! for content exit should break out of the repl when binding_stack has only one binding - should pop a binding - should break out of the repl even after an exception should break out of the repl and return user-given value + should break out of the repl even after an exception + should pop a binding + +Readline + is not loaded on invoking 'pry' if Pry.input is set + is not loaded on requiring 'pry' + is loaded on invoking 'pry' + +Pry + loading rc files + should not load the pryrc if it cannot expand ENV[HOME] + should never run the rc file twice + should not load the pryrc if pryrc's directory permissions do not allow this + should not run the rc file at all if Pry.config.should_load_rc is false + should not load the rc file twice if it's symlinked differently + that raise exceptions + should not raise exceptions + should output an error + should continue to run pry + +Pry::History + expanding the history file path + recognizes ~ (#1262) + .load_history + reads the contents of the file + #history_line_count + counts entries in history + file io errors + handles Errno::EACCES failure to write history + handles Errno::EACCES failure to read from history + handles Errno::ENOENT failure to write history + handles Errno::ENOENT failure to read from history + #clear + doesn't affect the contents of the history file + clears this session's history + saving to a file + interleaves lines from many places + saves lines to a file as they are written + should not write histignore words to the history file + .default_file + returns ~/.local/share/pry/pry_history + when ~/.pry_history exists + returns ~/.pry_history + when $XDG_DATA_HOME is defined + returns config location relative to $XDG_DATA_HOME + returns config location relative to $XDG_DATA_HOME when ~/.pryrc exists + #push + does not record empty lines + does not record lines that contain a NULL byte + does not record duplicated lines + #session_line_count + returns the number of lines in history from just this session + +show-doc + emits a deprecation warning + shows docs + +exit-program + should raise SystemExit + should exit the program with the provided value + +pry_backtrace + should print a backtrace + +Pry::Command::Wtf + #process + when the verbose flag is missing + prints only a part of the exception backtrace + when given a nested exception + and when the verbose flag present + prints both original and nested exception backtrace + and when the verbose flag is missing + prints parts of both original and nested exception backtrace + when the verbose flag is present + prints full exception backtrace + when there wasn't an exception raised + raises Pry::CommandError + when captures contains exclamations (wtf?! invocation) + prints more of backtrace + when the code flag is present + prints lines of code that exception frame references + and when referenced frame doesn't exist + skips code and prints only the backtrace frame + +edit + with FILE + should use the line number from -l + works with files that contain blanks in their names + should not allow patching any known kind of file + should invoke Pry.config.editor with absolutified filenames + should work with require relative + should not delete the file! + should guess the line number from a colon + + should pass the editor a reloading arg + + should not reload a ruby file if -n is given + should reload the file if it is a ruby file + should reload a non-ruby file if -r is given + should not reload the file if it is not a ruby file + old edit-method tests now migrated to edit + on a method defined in a file + with -p + should successfully replace a method on an instance + should successfully replace a class method + should successfully replace a method with a question mark + should successfully replace an instance method + should successfully replace a method from a module + should preserve module nesting + monkey-patching + should work for a method with a question mark + should work with nesting + should work for a method from a module + should work for an instance method + should work for a class method + should work for a method on an instance + on an aliased method + should change the alias, but not the original, without breaking super + with three-arg editor + should pass the editor a reloading arg + without -p + should correctly find an aliased method + should correctly find a class method + should correctly find a method on an instance + should correctly find a method from a module + should correctly find an instance method + without FILE + should position the cursor at the end of the expression + should edit the previous expression if the current is empty + should evaluate the expression + should use a blank file if -t given, even during an expression + should write the evaluated command to history + should use a blank file if -t is specified + should edit the current expression if it's incomplete + should not evaluate a file with -n + should ignore -n for tempfiles + with --in + should edit the nth line of _in_ + should not work with nonsense + should edit a range of lines if a range is given + should edit the last line if no argument is given + should not work with a filename + should edit a multi-line expression as it occupies one line of _in_ + --method flag + should edit method context + errors when a filename arg is passed with --method + errors when cannot find method context + pretty error messages + should display a nice error message when cannot open a file + with --ex + with --ex NUM + should display error message when backtrace level is invalid + should start editor on first level of backtrace with --ex 0 + should start editor on second level of backtrace with --ex 1 + should start on first level of backtrace with just --ex + should start editor on third level of backtrace with --ex 2 + with a real file + edits the exception even when in a patched method context + should not reload the file if -n is passed + should reload the file + with --patch + should apply changes only in memory (monkey patching) + when editing a method by name + uses patch editing on methods that were previously patched + can repeatedly edit methods that were defined in the console Pry::Ring #clear resets ring to initial state + #<< + overwrites elements when the ring is full + keeps duplicate elements + adds elements as is when the ring is not full + #to_a + returns a duplicate of internal buffer #[] + when the ring is empty + returns nil when the ring is full + reads elements reads elements via exclusive range reads elements via inclusive range returns the first element when accessed through 0..0 - reads elements - when the ring is empty - returns nil when the ring is not full reads elements reads elements via range - #<< - adds elements as is when the ring is not full - keeps duplicate elements - overwrites elements when the ring is full - #to_a - returns a duplicate of internal buffer + +ri + prints an error message without an argument cd - should cd into an object and its ivar using cd obj/@ivar syntax - should be able to cd into the Object BasicObject - cds into an object and its ivar and back again using cd obj/@ivar/.. syntax - should break out to outer-most session with cd / - cds into an object and its ivar using cd obj/@ivar/ syntax (note following /) cds into an object and its ivar and back and then into another ivar using cd obj/@ivar/../@y syntax - should break out to outer-most session with just cd (no args) - should not cd into complex input when it encounters an exception should cd back to top-level and then into another ivar using cd /@ivar/ syntax - should start a session on TOPLEVEL_BINDING with cd :: - should cd into complex input (with spaces) - should cd into simple input - can cd into an expression containing a string with slashes in it - can cd into an expression with division in it should break out of session with cd .. should not leave the REPL session when given 'cd ..' should cd into previous object and its local using cd ../local syntax + should start a session on TOPLEVEL_BINDING with cd :: can cd into objects that redefine #respond_to? to return true + should be able to cd into the Object BasicObject + should cd into complex input (with spaces) + cds into an object and its ivar and back again using cd obj/@ivar/.. syntax + can cd into an expression with division in it + can cd into an expression containing a string with slashes in it + cds into an object and its ivar using cd obj/@ivar/ syntax (note following /) + should not cd into complex input when it encounters an exception + should cd into an object and its ivar using cd obj/@ivar syntax + should cd into simple input + should break out to outer-most session with just cd (no args) + should break out to outer-most session with cd / old stack toggling with `cd -` + series of cd calls + should toggle with fuzzy `cd -` calls + when using ^D (Control-D) key press + should keep correct old binding + when an error was raised + should not toggle and should keep correct stacks + when using complex cd syntax + should toggle with a complex path (simple case) + should toggle with a complex path (more complex case) + when using cd :: + should toggle when using simple cd syntax should toggle when using cd .. should toggle with a complex path should toggle with a simple path - in fresh pry instance - should not toggle when there is no old stack - when using ^D (Control-D) key press - should keep correct old binding when using cd / should toggle - when using cd :: - should toggle - when an error was raised - should not toggle and should keep correct stacks - series of cd calls - should toggle with fuzzy `cd -` calls - when using complex cd syntax - should toggle with a complex path (more complex case) - should toggle with a complex path (simple case) - -Bundler - when Pry requires Gemfile, which doesn't specify Pry as a dependency - loads auto-completion correctly (PENDING: Temporarily skipped with xit) - -whereami - should work inside a class - shows description and corrects code when __LINE__ and __FILE__ are outside @method.source_location - shows description and corrects code when @method.source_location would raise an error - should work in objects with no method methods - should work inside an object - should not show line numbers or marker when -n switch is used - should work with methods that have been undefined - uses Pry.config.default_window_size for window size when outside a method context - should show entire method when -m option used - should show code window (not just method source) if parameter passed to whereami - should work in BasicObjects - should work with prepended methods - should show entire file when -f option used - should properly set _file_, _line_ and _dir_ - should work at the top level - -c - should show class when -c option used, and locate correct candidate - should show class when -c option used, and beginning of the class is on thesame line as another expression - should show class when -c option used, and binding is outside a method - should show class when -c option used, and locate correct superclass - -Hanami integration - does not enter an infinite loop (#1471, #1621) - -Pry::Helpers::CommandHelpers - #set_file_and_dir_locals - sets pry instance's last_file to _file_ - injects local variable _dir_ - sets pry instance's last_dir to _dir_ - injects local variable _file_ - #unindent - should only remove a common prefix - should not be phased by empty lines - should also remove tabs if present - removes the same prefix from all lines - should ignore lines starting with -- - #one_index_number - when line number is more than 0 - decrements the line number - when line number is 0 - returns the line number - #get_method_or_raise - when there's no method name - raises MethodNotFound - when super opt is provided but there's no super method - raises MethodNotFound - when super opt is provided and there's a parent method - gets the parent method - when there's name but no corresponding method - raises MethodNotFound - #internal_binding? - when target's __method__ returns __pry__ - returns true - when target's __method__ returns nil - returns true - when target's __method__ returns __binding__ - returns true - #one_index_range - decrements range boundaries - #temp_file - creates a tempfile with rb extension - allows overwriting file extension - yields a tempfile - closes the tempfile - unlinks the tempfile - #restrict_to_lines - when lines are specified as an integer - restricts the given string to the specified line number - when lines are specified as a range - restricts the given string to the specified range - #one_index_range_or_number - when given a range - decrements range boundaries - when given an integer - decrements the line number - #absolute_index_range - when given an integer - returns a range based on the integer and array length - when given an integer - returns an absolute range that was decremented - #absolute_index_number - when line number is less than zero - returns the absolute sum of line number and array length - when line number is zero - returns the line number - -Pry::Env - #[] - when ENV doesn't contain the passed key - is expected to be nil - when ENV contains the passed key - is expected to eq "val" - when ENV contains the passed key but its value is nil - is expected to be nil - -Pry::Command::Wtf - #process - when the code flag is present - prints lines of code that exception frame references - and when referenced frame doesn't exist - skips code and prints only the backtrace frame - when captures contains exclamations (wtf?! invocation) - prints more of backtrace - when given a nested exception - and when the verbose flag present - prints both original and nested exception backtrace - and when the verbose flag is missing - prints parts of both original and nested exception backtrace - when the verbose flag is missing - prints only a part of the exception backtrace - when there wasn't an exception raised - raises Pry::CommandError - when the verbose flag is present - prints full exception backtrace - -Pry::CodeObject - .lookup - when looking up 'nil' while being inside a module - infers the module - when looking up 'nil' while being inside a method - infers the method - when looking up classes - finds classes - when looking up classes by names of variables - finds instance methods via the # notation - when looking up Pry::BlockCommand - finds Pry:BlockCommand - when looking up 'nil' while being inside a class instance - infers the module - when looking up empty string while being inside a method - infers the method - when looking up empty string while being inside a class instance - infers the module - when there is a class and a method who is a namesake - finds the class before the method - finds the method when the look up ends with () - finds the class before the method when it's namespaced - when looking up Pry::ClassCommand - finds Pry:BlockCommand - when looking up instance methods of a class - finds instance methods - when looking up anonymous class methods - finds instance methods via the # notation - when looking up method - finds methods defined on objects - when looking up classes with 'super: 1' - finds the parent class - when looking up procs - finds classes - when looking up class methods of a named class - finds instance methods via the # notation - when looking up commands with the super option - finds the command ignoring the super option - when looking up classes with 'super: 0' - finds the child class - when looking up instance methods - finds instance methods via the . notation - finds instance methods via the # notation - when looking up modules - finds modules - when looking up 'nil' - returns nil - when looking up Pry commands by class - finds Pry::WrappedModule - when looking up Pry commands by listing - finds Pry::WrappedModule - when looking up empty string while being inside a module - infers the module + in fresh pry instance + should not toggle when there is no old stack -Pry::ControlDHandler - when given eval string is non-empty - clears input buffer - when given eval string is empty & pry instance has 2+ bindings - pops the binding off the stack - saves a dup of the current binding stack in the 'cd' command - when given eval string is empty & pry instance has one binding - clears binding stack - throws :breakout +ls + grep + should still output matching things + should reduce the number of outputted things + help + should show help with -h + with -l + should not list pry noise + should find locals and sort by descending size + when no arguments given + when at the top-level + should show local variables + when in an object + should show instance variables + should show methods + when in a class + should show methods + should show class variables + should show constants + methods + should show error message when instance is given with -M option + should not show protected/private by default + should show public methods with -p + should work for objects with an overridden method method + should show protected/private methods with -p + should work for objects which instance_variables returns array of symbol but there is no Symbol#downcase + should handle classes that (pathologically) define .ancestors + should show public methods by default + when inside Modules + should work for ivars + should include instance methods by default + should still work + should behave normally when invoked on Module itself + constants + should not show constants defined on parent modules by default + should not autoload constants! + should show constants for an object's class regardless of mixins + works on top-level + should show constants defined on ancestors with -v + should show constants defined on the current module + below ceiling + should not include super-classes when -q is given + should include object if -v is given + should include super-classes by default + should stop before Object by default + bug #1407 + behaves as usual when a method of the same name exists. + BasicObject + should work on BasicObject + should work on subclasses of BasicObject + on java objects + should include java-esque aliases if requested (PENDING: No reason given) + should omit java-esque aliases by default (PENDING: No reason given) + immediates + should work on Integer -find-method - should work with badly behaved constants - should escape regexes correctly - find matching methods by name regex (-n option) - should NOT match a method that does not match the regex - should find a method by regex - find matching methods by content regex (-c option) - should find a method by regex - should NOT match a method that does not match the regex +watch expression + prints when an expression is mutated + prints when an expression changes + doesn't print when an expresison remains the same + watches an expression + watches a local variable + continues to work if you start a second pry instance + registers the after_eval hook + prints no watched expressions + deleting expressions + deletes delete + keeps keeper show-source - should output source for a repl method defined using define_method - should output a method's source if inside method and no name given - should not show the source when a non-extant method is requested + should output the source of a method defined inside Pry + should find normal methods (i.e non-instance methods) by default + should output a method's source with line numbers starting at 1 should not find normal methods with self#moo + should find normal methods with self.moo + should find instance methods if no normal methods available should output a method's source with line numbers - should output help - should find normal methods (i.e non-instance methods) by default - should find instance_methods if the class overrides instance_method should raise a CommandError when super method doesn't exist - should output source for an instance method defined inside pry - should output the source of a command defined inside Pry - should output the source of a method defined inside Pry - should output a method's source with line numbers starting at 1 - should not find instance methods with self.moo + should find methods even if the object overrides method method should find instance methods with self#moo should output a method's source - should find methods even if there are spaces in the arguments - should find methods even if the object overrides method method - should find normal methods with self.moo - should find instance methods if no normal methods available + should not find instance methods with self.moo + should output help should output a method's source inside method using the -l switch + should output a method's source if inside method and no name given + should find methods even if there are spaces in the arguments + should output source for a repl method defined using define_method doesn't show the source and deliver an error message without exclamation point + should output source for an instance method defined inside pry + should find instance_methods if the class overrides instance_method + should not show the source when a non-extant method is requested + should output the source of a command defined inside Pry + finding super methods with help of `--super` switch + finds super methods without explicit method argument + finds super methods with explicit method argument + finds super methods with multiple --super show-source --doc - when #call is defined on Symbol - still finds documentation - when given a proc - should show documentation for object - when given a nested class - shows docs for the nested classes - when given a module with a doc - shows documentation for the code object along with source code - when given a method with a doc - finds the method's documentation + should set _file_ and _dir_ + sets _file_ and _dir_ to file containing method source + when provided a class without docs that has a superclass with docs + shows a warning about superclass reversion + shows the docs of the superclass + when the Const = Module.new syntax is used + shows documentation for the module + when no docs can be found for the given class + raises Pry::CommandError when used against a command displays help for a command with a spaces in its name - displays help for a specific command displays help for a regex command with a "listing" + displays help for a specific command class commands - when looking up by command name - displays help when class is used (rather than command name) is used for lookup displays actual preceding comment for a class command - code highlighting - when there's inline code with backticks the docs - doesn't highlight the backticks - when there's code in the docs - highlights the code - when there's inline code in the docs - highlights the code + when looking up by command name + displays help when the --line-numbers switch is provided outputs a method's docs with line numbers - when provided a class without docs that has a superclass with docs - shows the docs of the superclass - shows a warning about superclass reversion - when the module with docs was included in another module - shows the included module's doc - shows a warning about the included module reversion - should set _file_ and _dir_ - sets _file_ and _dir_ to file containing method source - when the --super switch is provided - and when it's passed once - finds the super method docs - and when it's passed twice - finds the parent method docs - and when it's passed thrice - finds the grandparent method docs - and when the explicit argument is not provided - finds super method docs with multiple `--super` switches - finds super method docs without explicit method argument - and when the super method doesn't exist - raises Pry::CommandError - when no docs can be found for the given class - raises Pry::CommandError when given a class defined in a REPL session shows documentation for the class - when the current context is a non-nested class + when no class/module arg is given + returns the doc for the current module + when given a nested class shows docs for the nested classes - when given a 'broken' module - skips over the module when no docs can be found for the given method raises Pry::CommandError + when the --base-one switch is provided + outputs a method's docs with line numbering starting at 1 + when given a proc + should show documentation for object + when the current context is a non-nested class + shows docs for the nested classes + when given a method with a doc + finds the method's documentation when provided a class without docs that has nth superclass with docs - shows the docs of the superclass shows a warning about superclass reversion + shows the docs of the superclass + when the current context is a method + outputs the method without needing to use its name + when given a 'broken' module + skips over the module + when given a class with a doc + shows documentation for the code object along with source code + when given a module with a doc + shows documentation for the code object along with source code + code highlighting + when there's code in the docs + highlights the code + when there's inline code in the docs + highlights the code + when there's inline code with backticks the docs + doesn't highlight the backticks the --all switch behavior - when there are monkeypatches in different files - shows them + when --all is not used and there's only 1 candidate for the class + doesn't mention anything about monkeypatches when --all is not used but there are multiple monkeypatches + mentions available monkeypatches correctly displays the number of monkeypatches displays the original definition first - mentions available monkeypatches - when --all is not used and there's only 1 candidate for the class - doesn't mention anything about monkeypatches + when there are monkeypatches in different files + shows them when both the base mod and the included module have no docs raises Pry::CommandError - when the Const = Module.new syntax is used - shows documentation for the module + when the module with docs was included in another module + shows the included module's doc + shows a warning about the included module reversion + when #call is defined on Symbol + still finds documentation when included module has docs and there are intermediary docless modules shows nth level included module doc shows a warning about module reversion - when provided a class without docs that has a superclass without docs - raises Pry::CommandError - when the --base-one switch is provided - outputs a method's docs with line numbering starting at 1 - when given a class with a doc - shows documentation for the code object along with source code when the Const = Class.new syntax is used shows documentation for the class - when no class/module arg is given - returns the doc for the current module - when the current context is a method - outputs the method without needing to use its name - on variable or constant - outputs source of its class if constant doesn't respond to source_location - outputs source of its class if variable doesn't respond to source_location + when provided a class without docs that has a superclass without docs + raises Pry::CommandError + when the --super switch is provided + and when it's passed twice + finds the parent method docs + and when it's passed thrice + finds the grandparent method docs + and when it's passed once + finds the super method docs + and when the explicit argument is not provided + finds super method docs with multiple `--super` switches + finds super method docs without explicit method argument + and when the super method doesn't exist + raises Pry::CommandError + with -e option + shows the source code for the returned value as Ruby + should set _file_ and _dir_ + should set _file_ and _dir_ to file containing method source + when there's no source code but the comment exists + outputs zero line numbers on sourcable objects should output source for procs/lambdas stored in constants - should output source defined inside pry should output source for method objects should output source for procs/lambdas stored in variables + should output source defined inside pry on variables that shadow methods source of variable takes precedence over method that is being shadowed source of method being shadowed should take precedence over variable if given self.meth_name syntax - can't find class/module code - for classes - shows superclass code - shows warning when reverting to superclass code - ignores included modules - shows correct warning when reverting to nth level superclass - errors when class has no superclass to show - shows nth level superclass code (when no intermediary superclasses have code either) - for modules - shows included module code - shows nth level included module code (when no intermediary modules have code either) - shows correct warning when reverting to nth level included module - shows warning when reverting to included module code - errors when module has no included module to show - finding super methods with help of `--super` switch - finds super methods with explicit method argument - finds super methods without explicit method argument - finds super methods with multiple --super - should set _file_ and _dir_ - should set _file_ and _dir_ to file containing method source on modules - should lookup module name with respect to current context should lookup nested modules + should lookup module name with respect to current context + basic functionality, should find top-level module definitions + should show source for a super class + should show source for a module + should show source for a super class when Const = Class.new syntax is used + should show source for a module when Const = Module.new syntax is used + should show source for an ancestor module + should show source for a class + should show source for a class when Const = Class.new syntax is used when show-source is invoked without a method or class argument inside a module - should allow options to be passed - should display class source when inside instance + displays method code (rather than class) if Pry started inside method binding should display module source by default + should display class source when inside instance + should allow options to be passed should be unable to find module source if no methods defined - displays method code (rather than class) if Pry started inside method binding + should skip over broken modules + should return source for first valid module monkey-patched C modules - when current context is something other than a C object - should display a candidate, not a warning when current context is a C object recommends to use the --all switch when other candidates are found should display a warning, and not monkey-patched definition - should skip over broken modules - should return source for first valid module - in REPL - should find superclass defined in repl - should find class defined in repl + when current context is something other than a C object + should display a candidate, not a warning show-source -a + when there are class method monkeypatches in different files + shows the source for all monkeypatches + when there are class-eval monkeypatches in different files + ignores -a because object is not a module + shows the source for all monkeypatches when -a is not used and there are multiple monkeypatches mentions available monkeypatches - when there are class-eval monkeypatches in different files + when there are instance method monkeypatches in different files shows the source for all monkeypatches - ignores -a because object is not a module when there are instance-eval monkeypatches in different files shows the source for all monkeypatches when -a is not used and there's only one candidate for the class doesn't mention anything about monkeypatches - when there are class method monkeypatches in different files - shows the source for all monkeypatches - when there are instance method monkeypatches in different files - shows the source for all monkeypatches - basic functionality, should find top-level module definitions - should show source for a module - should show source for a super class when Const = Class.new syntax is used - should show source for an ancestor module - should show source for a class when Const = Class.new syntax is used - should show source for a super class - should show source for a class - should show source for a module when Const = Module.new syntax is used - when there's no source code but the comment exists - outputs zero line numbers + in REPL + should find superclass defined in repl + should find class defined in repl + on variable or constant + outputs source of its class if constant doesn't respond to source_location + outputs source of its class if variable doesn't respond to source_location + can't find class/module code + for classes + shows superclass code + shows warning when reverting to superclass code + ignores included modules + shows nth level superclass code (when no intermediary superclasses have code either) + shows correct warning when reverting to nth level superclass + errors when class has no superclass to show + for modules + shows nth level included module code (when no intermediary modules have code either) + errors when module has no included module to show + shows correct warning when reverting to nth level included module + shows included module code + shows warning when reverting to included module code on commands create_command commands should show source for a command should show source for a command defined inside pry real class-based commands - should show source for a command should show source for a command defined inside pry + should show source for a command block commands - should show source for a command by listing name should output source of commands using special characters + should show source for a command by listing name should show source for a command with spaces in its name should show source for an ordinary command - with -e option - shows the source code for the returned value as Ruby -Pry::Helpers::DocumentationHelpers - process_rdoc - should not remove ++ - should not double-highlight backticks inside indented code - should emphasise italic tags - should syntax highlight indented code - should emphasise em tags - should syntax highlight code in - should not syntax highlight already highlighted code - should syntax highlight code in - should highlight words surrounded by +s - should syntax highlight things in backticks - get_comment_content - should strip off the hash and unindent - should strip out leading lines of hashes - should remove shebangs - should unindent past separators +Pry::CodeObject + .lookup + when looking up 'nil' while being inside a class instance + infers the module + when looking up instance methods + finds instance methods via the # notation + finds instance methods via the . notation + when looking up commands with the super option + finds the command ignoring the super option + when looking up instance methods of a class + finds instance methods + when looking up class methods of a named class + finds instance methods via the # notation + when looking up 'nil' while being inside a module + infers the module + when looking up Pry::ClassCommand + finds Pry:BlockCommand + when looking up procs + finds classes + when looking up modules + finds modules + when looking up Pry commands by listing + finds Pry::WrappedModule + when looking up classes by names of variables + finds instance methods via the # notation + when looking up classes + finds classes + when looking up anonymous class methods + finds instance methods via the # notation + when there is a class and a method who is a namesake + finds the class before the method when it's namespaced + finds the class before the method + finds the method when the look up ends with () + when looking up empty string while being inside a method + infers the method + when looking up method + finds methods defined on objects + when looking up empty string while being inside a class instance + infers the module + when looking up classes with 'super: 1' + finds the parent class + when looking up 'nil' while being inside a method + infers the method + when looking up Pry::BlockCommand + finds Pry:BlockCommand + when looking up classes with 'super: 0' + finds the child class + when looking up 'nil' + returns nil + when looking up Pry commands by class + finds Pry::WrappedModule + when looking up empty string while being inside a module + infers the module -Pry::Command - .group - when source file doesn't match anything - returns '(other)' - when source file matches 'pryrc' - sets group name to pryrc - when source file matches a pry command - sets group name to command name - when source file matches a pry plugin - sets group name to plugin name - when name is given - sets group to that name - #run - runs a command from another command - .subclass - returns a new class - sets block on the new class - sets match on the new class - sets description on the new class - includes helpers to the new class - sets command options on the new class - #complete - returns empty array - .command_options - when no argument is given - and when command options were defined previously - returns memoized command options - and when command options were not defined previously - sets command options to default options - when given an argument - merges the argument with command options - .name - returns the name of the command - when super command name exists - returns the name of the parent command - #void - returns void value - #commands - returns command set as a hash - .block - when block exists - returns the block - when block doesn't exist - uses #process method - .state - returns a command state - .command_name - returns listing - #tokenize - when shellwords is enabled - strips quotes from the arguments - when given string uses interpolation - interpolates the string in the target's context - and when interpolation is disabled - doesn't interpolate the string - when command regex has captures - returns the captures - when target is not set - still returns tokens - when given string doesn't match a command - raises CommandError - when shellwords is disabled - doesn't split quotes from the arguments - .banner - when no argument is given - and when banner was defined previously - returns the memoized banner - and when banner was not defined previously - return nil - when given an argument - merges the argument with command options - #state - returns a state object - remembers the state - #check_for_command_collision - when a command doesn't collide - doesn't display a warning - when a command collides with a method - displays a warning - when a command collides with a local variable - displays a warning - .doc - returns help output - .convert_to_regex - when given object is an Object - returns the given object - when given object is a String - escapes the string as a Regexp - .default_options - when given a String argument - returns default options with string listing - when given an Object argument - returns default options with object's inspect as listing - .match_score - when command regex doesn't match given value - returns -1 - when command regex matches given value - and when the size of last match is more than 1 - returns the length of the first match - and when the size of last match is 1 or 0 - returns the length of the last match - .source_line - returns source line - #interpolate_string - when given string doesn't contain #{ - returns the given string - when given string contains #{ - returns the result of eval within target - .inspect - returns command name - .description - and when description was not defined previously - sets description to nil - when given an argument - sets description - and when description was defined previously - doesn't overwrite match - .matches? - when given value matches command regex - returns true - when given value doesn't match command regex - returns false - #target_self - returns the value of self inside the target binding - .match - when no argument is given - and when match was defined previously - doesn't overwrite match - and when match was not defined previously - sets match to nil - when given an argument - and when match is an object - sets command options with listing as object's inspect - and when match is a string - sets command options with listing as match - .command_regex - when use_prefix is false - returns a Regexp with a prefix - when use_prefix is true - returns a Regexp without a prefix - .source_file - returns source file - #process_line - sets captures - sets arg_string - collision warnings - when collision warnings are configured - prints a warning when there's a collision - when collision warnings are not set - prints a warning when there's a collision - .source - returns source code of the method +Pry + #last_exception= + returns an instance of Pry::LastException + returns an object who mirrors itself as the wrapped exception + returns a frozen exception + .configure + yields a block with Pry.config as its argument + Pry.critical_section + should prevent Pry being called + a fresh instance + should use `caller` as its backtrace + Pry.binding_for + should not leak local variables + Should not error when object doesn't have a valid == method + should work on frozen objects + Exotic object support + Should not error when return value is a BasicObject instance + DISABLE_PRY + should not Pry.start + should not binding.pry + FAIL_PRY + should raise an error for Pry.start + should raise an error for binding.pry + open a Pry session on an object + rep + should suppress output if input ends in a ";" (single line) + should notice when exceptions are raised + should make self evaluate to the receiver of the rep session + should not leak pry constants into Object namespace + should define a nested class under Hello and not on top-level or Pry + should be able to evaluate exceptions normally + should not try to catch intended exceptions + should suppress output if input ends in a ";" and is an Exception object (single line) + should set an ivar on an object + should be able to operate inside the BasicObject class + should display error if Pry instance runs out of input + inside signal handler + should return with error message + multi-line input + should suppress output if input ends in a ";" (multi-line) + works + newline stripping from an empty regexp + with regular regexp delimiters + with fancy delimiters + newline from an empty heredoc + works + newline stripping from an empty string + with single quotes + with fancy delimiters + with double quotes + repl + defining methods + defines a method on the singleton class of an object when performing "def meth;end" inside the object + defines an instance method on the class when performing "def meth;end" inside the class + defines an instance method on the module when performing "def meth;end" inside the module + defines a method on the class of an object when performing "def meth;end" inside an immediate value or Numeric + complete_expression? + should not mutate the input! + Pry.binding_for + should return TOPLEVEL_BINDING if parameter self is main + nesting + should nest properly + last_result + should be preserved over an empty line + should be set to the result of a command with :keep_retval + should be preserved when evalling a command without :keep_retval + should be set to the most recent value + Object#pry + should start a pry session on the receiver (second form) + should raise if more than two arguments are passed to Object#pry + should start a pry session on the receiver (first form) + history arrays + sets _ to the last result + uses 100 as the size of _in_ and _out_ + sets out to an array with the result + can change the size of the history arrays + sets _in_ to an array with the entered lines + store exceptions + basic functionality + should set an ivar on an object and exit the repl + setting custom options + correctly handles the :quiet option (#1261) + does not raise for unrecognized options -ri - prints an error message without an argument +Pry::ControlDHandler + when given eval string is empty & pry instance has 2+ bindings + saves a dup of the current binding stack in the 'cd' command + pops the binding off the stack + when given eval string is non-empty + clears input buffer + when given eval string is empty & pry instance has one binding + clears binding stack + throws :breakout -cat - with --in 1 - should display the first expression with no index - with --in -1 - should display the last expression with no index - with --ex - cat --ex should display repl code that generated exception - cat --ex should correctly display code that generated exception - with --in 1..2 - should display the given range with indices, omitting nils - when invoked without arguments - should display an error message - with --in - should display the last few expressions with indices - on receiving a file that does not exist - should display an error message - with --ex N - should cat first level of backtrace when --ex 0 used - should cat second level of backtrace when --ex 1 used - should cat first level of backtrace when --ex used with no argument - should show error when backtrace level out of bounds - each successive cat --ex should show the next level of backtrace, and going past the final level should return to the first - should cat third level of backtrace when --ex 2 used +Pry::REPL + should let you run commands in the middle of multiline expressions + should rescue exceptions + autoindent + should raise no exception when indented with a tab (PENDING: Temporarily skipped with xit) + space prefix + with 1 space + it prioritizes variables over commands + with more than 1 space + prioritizes commands over variables + eval_string and binding_stack + shouldn't break if we start a nested REPL + should immediately evaluate eval_string after cmd if complete + shouldn't break if we pop bindings in Ruby + shouldn't break if we start a nested instance + #piping? + returns false when $stdout is a non-IO object -jump-to - prints error when trying to jump to a non-existent binding index - prints an error when trying to jump to the same binding index - jumps to the proper binding index in the stack +whereami + uses Pry.config.default_window_size for window size when outside a method context + should work inside a class + shows description and corrects code when __LINE__ and __FILE__ are outside @method.source_location + should show entire method when -m option used + should show code window (not just method source) if parameter passed to whereami + should work in objects with no method methods + should work with prepended methods + should not show line numbers or marker when -n switch is used + shows description and corrects code when @method.source_location would raise an error + should work inside an object + should show entire file when -f option used + should work with methods that have been undefined + should work in BasicObjects + should properly set _file_, _line_ and _dir_ + should work at the top level + -c + should show class when -c option used, and binding is outside a method + should show class when -c option used, and locate correct candidate + should show class when -c option used, and locate correct superclass + should show class when -c option used, and beginning of the class is on thesame line as another expression -clear-screen - calls the "clear" command on non-Windows platforms - calls the "cls" command on Windows +Pry::Helpers::Text + #strip_color + removes color code from text "\e[31m\e[1;31m'\e[0m\e[31mhello\e[1;31m'\e[0m\e[31m\e[0m\e[1B\e[0G" + removes color code from text "string" + removes color code from text "\e[1A\e[0G[2] pry(main)> puts \e[31m\e[1;31m'\e[0m\e[31mhello\e[1;31m'\e[0m\e[31m\e[0m\e[1B\e[0G" + +Pry::Output + #respond_to_missing? + when the output doesn't respond to the given method name + doesn't find the method + when the output responds to the given method name + finds the method that is not defined on self + #tty? + when the output doesn't respond to #tty? + returns false + when the output responds to #tty? and is not a TTY + returns false + when the output responds to #tty? and is a TTY + returns true + #height + returns the number of rows + #method_missing + when the output responds to the given method name + forwards the method to the output + when the output doesn't respond to the given method name + raises NoMethodError + #print + returns nil + when the given pry instance has 'color' disabled + decolorizes output + when the given pry instance has 'color' enabled + doesn't decolorize output + #write + is expected to eq # + #<< + is expected to eq # + #puts + returns nil + when given multiple empty arrays + prints multiple newline + when the given pry instance has 'color' disabled + decolorizes output + when given non-convertible to array objects + prints the non-converted objects in its string form + and when the object's #to_s has a newline + doesn't print a double newline + when the given pry instance has 'color' enabled + doesn't decolorize output + when given an empty array + prints a newline + when given convertible to array objects + prints the converted objects + #size + when the output is not a tty and no info in ENV + when Readline's size has zero column + returns the default size + when Readline's size has no zeroes + returns the Readline winsize + when the output is not a tty + and ENV has size info in ROWS and COLUMNS + returns the ENV variable winsize + and ENV has size info in LINES and COLUMNS + returns ENV variable winsize + when the output is a tty and responds to winsize + returns the io/console winsize + when the output is not a tty, and no info in ENV and no Readline info + and when there's no ANSICON ENV variable + returns the default winsize + and when there's ANSICON ENV variable + and when it can be matched + and when the size consists of positive integers + returns the ansicon winsize + and when the size has a zero column + returns the default winsize + and when it cannot be matched + returns the default winsize + #width + returns the number of columns + #decolorize_maybe + when the given pry instance has 'color' disabled + returns decolorized string + when the given pry instance has 'color' enabled + returns the given string without modifications + +Pry::Env + #[] + when ENV contains the passed key + is expected to eq "val" + when ENV doesn't contain the passed key + is expected to be nil + when ENV contains the passed key but its value is nil + is expected to be nil + +Pry::CommandState + #state_for + returns a state for the matching command + returns new state for new command + memoizes state for the same command + .default + returns the default command state + when called multiple times + returns the same command state + #reset + resets the command state for the given command + doesn't reset command state for other commands Formatting Table - knows about colorized fitting decide between one-line or indented output - line length is smaller than the length of the longest word - should not raise error - should format output as one column + knows about colorized fitting formatting - should order downward and wrap to columns - should handle the basic case - should handle colors - should handle empty input - should handle a tiny case should handle one-token input + should handle a tiny case + should handle empty input should handle... another basic case + should handle colors + should handle the basic case + line length is smaller than the length of the longest word + should format output as one column + should not raise error -Pry::Editor - build_editor_invocation_string - should shell-escape files +jump-to + prints error when trying to jump to a non-existent binding index + jumps to the proper binding index in the stack + prints an error when trying to jump to the same binding index + +Pry::SystemCommandHandler .default - when $VISUAL is defined - returns the value of $VISUAL - when $EDITOR is defined - returns the value of $EDITOR - when no editor is detected - shells out to find 'vi' - shells out to find 'nano' - shells out to find 'editor' - when platform is Windows - returns 'notepad' - build_editor_invocation_string on windows - should not shell-escape files - invoke_editor with a proc - should not shell-escape files + when command exists + executes the command without printing the warning + when doesn't exist + executes the command without printing the warning -Pry::Command::ShellCommand - cd - .cd - saves the current working directory - given an empty string - sends ~ to File.expand_path - given a dash - given a prior directory - sends the user's last pry working directory to File.expand_path - given no prior directory - raises the correct error - with CDPATH - when it is defined - simple cdpath - cd's into the dir - complex cdpath - cd's into the dir - given a path - sends the path to File.expand_path +Bundler + when Pry requires Gemfile, which doesn't specify Pry as a dependency + loads auto-completion correctly (PENDING: Temporarily skipped with xit) -help - should sort the output of the 'help' command - should display help for all commands with a description - should display help for a regex command with a "listing" - should display help for a specific command - should display help for a command with a spaces in its name +exit-all + should have empty binding_stack after breaking out of the repl + should break out of the repl and return nil + should break out of the repl wth a user specified value + should break out of the repl even if multiple bindings still on stack + +Pry::Command::Cat::FileFormatter + #file_and_line + parses relative path without line_num + parses relative path with line_num + windows filesystem + parses '/'style absolute path without line_num + parses '\'style absolute path with line_num + parses '/'style absolute path with line_num + parses '\'style absolute path without line_num + UNIX-like filesystem + parses absolute path without line_num + parses absolute path with line_num + #format + formats given files + formats given files with line number + +Pry::Config::Attributable + #attribute + creates a reader attribute for the given name + creates a writer attribute for the given name + and when the attribute is invoked + sends the 'call' message to the value + +Pry::ExceptionHandler + .handle_exception + when exception is a UserError and a SyntaxError + prints the syntax error with customized message + when exception is a standard error + prints standard error message + when exception is a nested standard error + prints standard error message + +Sticky locals (_file_ and friends) + locals should keep value after cd-ing (_file_ and _dir_) + locals should all exist upon initialization + locals should still exist after cd-ing into a new context + locals should return last result (_) + locals should return second last result (__) + locals should keep value after cd-ing (pry_instance) + User defined sticky locals + should provide different values for successive block invocations + should still exist after cd-ing into new binding + should create a new sticky local + hash option value should override config value + should define a new sticky local for the session (normal value) + passing in as hash option when creating pry instance + should define multiple sticky locals + should define a new sticky local for the session (normal value) + should define a new sticky local for the session (as Proc) + setting as Pry.config option + should define a new sticky local for the session (proc) + should define a new sticky local for the session (normal value) + _ex_ + keeps its value after cd-ing + returns the last exception without wrapping it in a LastException test Pry defaults should set the output default, and the default should be overridable - should set the hooks default, and the default should be overridable should set the print default, and the default should be overridable + should set the hooks default, and the default should be overridable + quiet + should hide whereami if quiet is set + should show whereami by default view_clip used for displaying an object in a truncated format + given an object with an #inspect string + returns the #<> format of the object (never use inspect) + the list of prompt safe objects + returns #<> format of the special-cased immediate object if #inspect is longer than maximum + returns the #inspect of the custom prompt safe objects + returns the #inspect of the special-cased immediate object: -5 + returns the #inspect of the special-cased immediate object: hello + returns the #inspect of the special-cased immediate object: 2.0 + returns the #inspect of the special-cased immediate object: 1 + returns the #inspect of the special-cased immediate object: test + given the 'main' object + returns the #to_s of main (special case) given an object with an #inspect string as long as the maximum specified returns the #<> format of the object (never use inspect) given a regular object with an #inspect string longer than the maximum specified - when the object is a regular one - returns a string of the # format when the object is a Class or a Module with a #name shorter than or equal to the maximum specified returns a string of the # format - without a name (usually a c = Class.new) - returns a string of the # format with a #name longer than the maximum specified returns a string of the # format - given the 'main' object - returns the #to_s of main (special case) - the list of prompt safe objects - returns the #inspect of the special-cased immediate object: 2.0 - returns the #inspect of the special-cased immediate object: hello - returns the #inspect of the special-cased immediate object: 1 - returns the #inspect of the special-cased immediate object: test - returns the #inspect of the custom prompt safe objects - returns #<> format of the special-cased immediate object if #inspect is longer than maximum - returns the #inspect of the special-cased immediate object: -5 - given an object with an #inspect string - returns the #<> format of the object (never use inspect) + without a name (usually a c = Class.new) + returns a string of the # format + when the object is a regular one + returns a string of the # format + pry return values + should return the parameter (self) given to exit-all + should return the parameter given to exit-all + should return the parameter (function call) given to exit-all + should return nil + should return the parameter (multi word string) given to exit-all prompts sets the prompt default, and the default should be overridable (multi prompt) sets the prompt default, and the default should be overridable (single prompt) storing and restoring the prompt - should not pop the last prompt should have a prompt stack + should not pop the last prompt #pop_prompt should return the popped prompt should restore overridden prompts when returning from shell-mode #prompt= should replace the current prompt with the new prompt when several prompts on the stack when only one prompt on the stack - pry return values - should return the parameter (function call) given to exit-all - should return the parameter (self) given to exit-all - should return the parameter (multi word string) given to exit-all - should return nil - should return the parameter given to exit-all toplevel_binding + should be devoid of local variables should define private methods on Object should have self the same as TOPLEVEL_BINDING - should be devoid of local variables - quiet - should show whereami by default - should hide whereami if quiet is set input should pass in the prompt if readline arity is 1 - should not pass in the prompt if the arity is -1 - should not pass in the prompt if the arity is 0 should set the input default, and the default should be overridable + should not pass in the prompt if the arity is 0 + should not pass in the prompt if the arity is -1 -disable-pry - should set DISABLE_PRY - should quit the current session - -Pry::Indent - should not indent inside HEREDOCs - should not indent single line statements - should correctly handle while do - should ident case statements - should not raise error, if MIDWAY_TOKENS are used without indentation - should indent a hash - should not indent inside strings - should not indent single/multi-line until - should indent correctly with nesting - should indent cunningly disguised ifs - should indent separate lines - should not indent single-line rescue - should not indent single-line ifs - should indent begin rescue end - should not indent nested HEREDOCs - should indent a function - should indent statements such as if, else, etc - should handle multiple open and closing tokens on a line - should differentiate single/multi-line unless - should indent an array - should properly indent nested code - should indent a module and class - nesting - should fail to parse nesting on line 19 of example_nesting.rb - should parse nesting on line 27 of example_nesting.rb - should parse nesting on line 31 of example_nesting.rb - should fail to parse nesting on line 21 of example_nesting.rb - should parse nesting on line 6 of example_nesting.rb - should parse nesting on line 32 of example_nesting.rb - should parse nesting on line 22 of example_nesting.rb - should fail to parse nesting on line 17 of example_nesting.rb - should parse nesting on line 10 of example_nesting.rb - should fail to parse nesting on line 18 of example_nesting.rb - should parse nesting on line 3 of example_nesting.rb - should parse nesting on line 2 of example_nesting.rb - should parse nesting on line 25 of example_nesting.rb - should parse nesting on line 8 of example_nesting.rb - should parse nesting on line 24 of example_nesting.rb - should parse nesting on line 14 of example_nesting.rb - should parse nesting on line 11 of example_nesting.rb - should parse nesting on line 26 of example_nesting.rb - should parse nesting on line 1 of example_nesting.rb - should fail to parse nesting on line 20 of example_nesting.rb - should parse nesting on line 7 of example_nesting.rb - should parse nesting on line 33 of example_nesting.rb - should parse nesting on line 12 of example_nesting.rb - should parse nesting on line 16 of example_nesting.rb - should parse nesting on line 15 of example_nesting.rb - should parse nesting on line 28 of example_nesting.rb - should parse nesting on line 13 of example_nesting.rb - should parse nesting on line 9 of example_nesting.rb - should parse nesting on line 23 of example_nesting.rb - should fail to parse nesting on line 30 of example_nesting.rb - should parse nesting on line 4 of example_nesting.rb - should parse nesting on line 5 of example_nesting.rb - should parse nesting on line 29 of example_nesting.rb - -The bin/pry CLI - -I path - adds an additional path to $LOAD_PATH - adds multiple additional paths to $LOAD_PATH - ARGV forwarding - forwards ARGV as an empty array when -- is passed without following arguments - forwards its remaining arguments as ARGV when - is passed - forwards its remaining arguments as ARGV when -- is passed - forwards ARGV as an empty array when - is passed without following arguments - -play - playing a file - should play a file - should output file contents with print option - whatever - should play a method (multiple lines) - should restrict -d switch with --lines - should play documentation with the -d switch - has pretty error messages when -d cant find object - should properly reindent lines - should play a method (a single line) - should APPEND to the input buffer when playing a method line, not replace it - play -e - should run an expression from given line number - play -i - should play multi-ranged input expressions - -exit-all - should break out of the repl and return nil - should have empty binding_stack after breaking out of the repl - should break out of the repl wth a user specified value - should break out of the repl even if multiple bindings still on stack - -raise-up - should eat the exception at the last new pry instance on raise-up - should allow you to cd up and (eventually) out - should jump immediately out of nested contexts with ! - should raise the exception with raise-up - should raise the most recently raised exception - should raise an unamed exception with raise-up - -Pry::ExceptionHandler - .handle_exception - when exception is a UserError and a SyntaxError - prints the syntax error with customized message - when exception is a standard error - prints standard error message - when exception is a nested standard error - prints standard error message +Hanami integration + does not enter an infinite loop (#1471, #1621) Pry::ClassCommand .inherited + when description is defined + sets description on the subclass when command_options is defined sets command_options on the subclass when match is defined sets match on the subclass - when description is defined - sets description on the subclass + #slop + makes Slop's banner unindented + returns a Slop instance + defines the help option + when there are options + adds subcommands to Slop + when there are subcommands + adds subcommands to Slop + #help + returns help output + .source_location + returns source location + .source_line + returns source file .source_file returns source file + #complete + generates option completions #call sets command's args sets command's opts invokes setup when help is not invloved + when #process accepts no arguments + calls the command despite passed arguments when passed a variable-length array calls the command without arguments calls the command with some arguments when #process accepts some arguments - calls the command even if there are more arguments than needed calls the command even if there's not enough arguments - when #process accepts no arguments - calls the command despite passed arguments + calls the command even if there are more arguments than needed when help is invoked outputs help info returns void value + .doc + returns source code for the process method #process raises CommandError .source returns source code for the process method - .source_line - returns source file - .doc - returns source code for the process method - #help - returns help output - #complete - generates option completions - #slop - defines the help option - makes Slop's banner unindented - returns a Slop instance - when there are subcommands - adds subcommands to Slop - when there are options - adds subcommands to Slop - .source_location - returns source location + +Pry::Config::MemoizedValue + #call + memoizes the result of call + doesn't conflate falsiness with unmemoizedness + +Pry::Helpers::CommandHelpers + #temp_file + yields a tempfile + closes the tempfile + allows overwriting file extension + creates a tempfile with rb extension + unlinks the tempfile + #set_file_and_dir_locals + injects local variable _dir_ + sets pry instance's last_dir to _dir_ + sets pry instance's last_file to _file_ + injects local variable _file_ + #restrict_to_lines + when lines are specified as an integer + restricts the given string to the specified line number + when lines are specified as a range + restricts the given string to the specified range + #absolute_index_number + when line number is less than zero + returns the absolute sum of line number and array length + when line number is zero + returns the line number + #unindent + should also remove tabs if present + removes the same prefix from all lines + should not be phased by empty lines + should ignore lines starting with -- + should only remove a common prefix + #one_index_number + when line number is 0 + returns the line number + when line number is more than 0 + decrements the line number + #one_index_range + decrements range boundaries + #get_method_or_raise + when there's no method name + raises MethodNotFound + when there's name but no corresponding method + raises MethodNotFound + when super opt is provided and there's a parent method + gets the parent method + when super opt is provided but there's no super method + raises MethodNotFound + #one_index_range_or_number + when given a range + decrements range boundaries + when given an integer + decrements the line number + #absolute_index_range + when given an integer + returns an absolute range that was decremented + when given an integer + returns a range based on the integer and array length + #internal_binding? + when target's __method__ returns __binding__ + returns true + when target's __method__ returns nil + returns true + when target's __method__ returns __pry__ + returns true + +Pry::Pager + PageTracker + records short lines that do add up to a page + records a string with an embedded newline + records short lines that don't add up to a page + doesn't count ansi color codes towards length + doesn't count a line until it ends + treats a long line as taking up more than one row + +Pry::InputCompleter + should complete for stdlib symbols + should complete for arbitrary scopes + should not return nil in its output + should complete for stdlib symbols + should take parenthesis and other characters into account for symbols + should complete instance variables + completes expressions with all available methods + should not crash if there's a Module that has a symbolic name. (PENDING: No reason given) + should complete for target symbols + should complete for arbitrary scopes + does not offer methods from restricted modules + ignores methods from modules that override Object#hash incompatibly + should complete for target symbols + +Pry::Hooks + executing a hook + should execute block hook + return value of exec_hook should be that of last executed hook + should add exceptions to the errors array + should return the last exception raised as the return value + should execute all hooks for an event if more than one is defined + should execute hooks in order + should execute proc hook + should execute a general callable hook + Pry::Hooks#merge + merge! + should NOT overwrite hooks belonging to shared event in receiver + should merge in the Pry::Hooks + should not share merged elements with original + should preserve hook order + should overwrite identical hook in receiver + merge + should not affect original instances when new hooks are added + should return a fresh, independent instance + should contain hooks from original instance + adding a new hook + should create a new hook with a block + should raise if not given a block or any other object + should not execute hook while adding it + should use block if given both block and callable + should create a new hook with a callable + should return a count of 0 for an empty hook + should create multiple hooks for an event + should not allow adding of a hook with a duplicate name + getting hooks + get_hooks + should return an empty hash if no hooks defined + should return a hash of hook names/hook functions for an event + get_hook + should return the correct requested hook + should return nil if hook does not exist + clearing all hooks for an event + should clear all hooks + integration tests + after_session hook + should always run, even if uncaught exception bubbles out of repl + exceptions + should not raise exceptions + should print out a notice for each exception raised + before_eval hook + modifying input code + should replace input code with code determined by hook + should not interfere with command processing when replacing input code + when_started hook + should allow overriding of target (and binding_stack) + should yield options to the hook + target + should yield the target to the hook + should yield the target, as a binding + anonymous hooks + should only allow one anonymous hook to exist + should execute most recently added anonymous hook + should allow adding of hook without a name + deleting a hook + should return the deleted hook + should successfully delete a hook + should return nil if hook does not exist + dupping a Pry::Hooks instance + should share hooks with original + adding a new event to dupped instance should not affect original + adding a new hook to dupped instance should not affect original + .default + returns hooks with default before_session hook + when pry instance is not quiet + runs the whereami command + when pry instance is quiet + doesn't run the whereami command + +Pry::WrappedModule + .singleton_instance + should raise an exception when called on a non-singleton-class + should return the attached object + .method_prefix + should return Foo# for normal classes + of anonymous classes should not be empty + of singleton classes of anonymous classes should not be empty + should return Bar# for modules + of singleton classes of objects + should return Foo. for singleton classes of classes + .singleton_class? + should be false for modules + should be false for normal classes + should be true for singleton classes + .super + receiver is a module + should retrieve nth super + should return self when .super(0) is used + should not ignore modules when retrieving supers + receiver is a class + should return nil when no nth superclass exists + should return superclass for a wrapped class + should ignore modules when retrieving nth superclass + should return nth superclass for a wrapped class + should return self when .super(0) is used + #initialize + should raise an exception when a non-module is passed + .from_str + should lookup an ivar + should lookup a constant + should lookup a local + candidates + number_of_candidates + should return 0 candidates for a class with no nested modules or methods + should return the correct number of candidates + should return 1 candidate for a class with a nested module with methods + doc + should return doc for highest ranked candidate + should return primary candidates doc by default + should return doc for third ranked candidate + should return docs for deeply nested class + should return doc for second ranked candidate + source + should return source for highest ranked candidate + should return source for third ranked candidate + should return source for second ranked candidate + should return source for deeply nested class + should return primary candidates source by default + ordering of candidates + returns class with third largest number of methods as third ranked candidate + should return class with largest number of methods as primary candidate + should raise when trying to access non-existent candidate + returns class with second largest number of methods as second ranked candidate + source_location + should return primary candidates source_location by default + should return nil if no source_location can be found + returns the location of the outer module if an inner module has methods + +Pry::Config::LazyValue + #call + doesn't memoize the result of call Pry::CLI - .add_options - returns self - when options is nil and a block is provided - sets the block as options - when options were previously set - overwrites the options proc that executes the provided block - overwrites the options proc that executes original options - .parse_options - when option doesn't exist - raises error - when option exists - initializes session setup - removes the existing option from ARGV - finalizes session setup - when argv is passed with a dash (-) - sets everything after the dash as input args - when invalid option is provided - exits program - when multiple options exist - processes only called options - when argv is passed with a double dash (--) - sets everything after the double dash as input args .start sets Pry.cli to true - when there are some input args - loads files through repl and exits - when the context option is provided - initializes session setup - starts Pry in the provided context - finalizes session setup when the context option is not provided starts Pry in the top level when the help option is provided exits + when there are some input args + loads files through repl and exits when 'pry' is passed as an input arg does not load files through repl + when the context option is provided + finalizes session setup + initializes session setup + starts Pry in the provided context .add_option_processor - returns self adds an option processor + returns self + .parse_options + when invalid option is provided + exits program + when option doesn't exist + raises error + when multiple options exist + processes only called options + when argv is passed with a dash (-) + sets everything after the dash as input args + when option exists + initializes session setup + finalizes session setup + removes the existing option from ARGV + when argv is passed with a double dash (--) + sets everything after the double dash as input args + .add_options + returns self + when options is nil and a block is provided + sets the block as options + when options were previously set + overwrites the options proc that executes original options + overwrites the options proc that executes the provided block -Pry - output suppression - should output something if the input ends with a comment - should not output anything if the input ends with a semicolon - should not output something if the input is only a comment - should normally output the result - custom non-IO object as $stdout - does not crash pry - color - should not colorize strings that already include color - should colorize strings as though they were ruby - output_prefix - should be able to change output_prefix - default print - should include the => - should output the right thing - doesn't leak colour for object literals - should not be phased by un-inspectable things - output failsafe - should catch serialization exceptions - should display serialization exceptions - should catch errors serializing exceptions +help + should display help for a specific command + should display help for a regex command with a "listing" + should display help for all commands with a description + should display help for a command with a spaces in its name + should sort the output of the 'help' command -Pry::Code - #between - when start_line is nil - returns self - when a negative end_line is specified - returns a range of lines from the end - when a negative start_line is specified - returns a line from the end - when only start_line is specified - returns a code object - removes leaves only the specified line - when start_line is a Range - returns a range fo lines corresponding to the given Range - when both start_line and end_line are specified - returns a code object - removes all lines that aren't in the given range - #select - returns a code object - selects lines matching a condition - #with_line_numbers - appends line numbers to code - #comment_describing - returns a comment describing expression - #highlighted - returns a highlighted for terminal string representation of code - #reject - rejects lines matching a condition - returns a code object - Pry::Code() - when given a Method - reads lines from bound method - when given a Pry::Method - reads lines from Pry::Method - when given a Proc - reads lines from proc - when given a Code object - returns the passed parameter unchanged - when given an Array - reads lines from the array - when given an UnboundMethod - reads lines from unbound methods - #length - returns how many lines the code object has - #max_lineno_width - when there are less than 100 lines - returns 2 - when there are less than 1000 lines - returns 3 - when there are less than 10 lines - returns 1 - #expression_at - returns a multiline expressiong starting on the given line number - .from_method - reads lines from a method's definition - #after - when line number is an integer - selects one line around the specified line number - and we specify how many lines to select - selects more than 1 line around - when line number is nil - returns self - #== - when a code is compared with another code with identical lines - returns true - when a code is compared with another code with different lines - returns true - when an empty code is compared with another empty code - returns true - #to_s - returns a string representation of code - #with_marker - shows a marker in the right place - .from_module - reads line from a class - sets code type to :ruby - .from_file - reads lines from a file on disk - reads lines from a file relative to origin pwd - reads lines from a file relative to origin pwd with '.rb' omitted - reads lines from a file relative to current pwd - sets code type according to the file - raises error when file doesn't exist - when reading files from $LOAD_PATH - finds files with '.rb' extensions - finds files in a relative directory with '.rb' omitted - recognizes Gemfile as a Ruby file - doesn't confuse files with the same name, but with an extension - doesn't confuse files with the same name, but without an extension - finds files in a relative directory with '.rb' extension - finds Ruby files with omitted '.rb' extension - when reading lines from a file without an extension - sets code type to :unknown - when readling lines from Pry's line buffer - reads entered lines - can specify file type manually - #nesting_at - returns an Array of open modules - #with_indentation - indents lines - #method_missing - when a String responds to the given method - forwards the method to a String instance - when a String does not respond to the given method - raises NoMethodError - #raw - when code has a marker - returns an unformatted String of all lines - #before - when line number is an integer - selects one line before the specified line number - and we specify how many lines to select - selects more than 1 line before - when line number is nil - returns self - #take_lines - takes N lines from start_line - #grep - when pattern is nil - returns self - when pattern is specified - returns lines matching the pattern - #push - appends lines to the code - is an alias of #<< - #respond_to_missing? - when a String does not respond to the given method - doesn't find the method - when a String responds to the given method - finds the method that is not defined on self - #around - when line number is an integer - selects one line around the specified line number - and we specify how many lines to select - selects more than 1 line around - when line number is nil - returns self +play + whatever + should APPEND to the input buffer when playing a method line, not replace it + should properly reindent lines + should play documentation with the -d switch + has pretty error messages when -d cant find object + should play a method (multiple lines) + should restrict -d switch with --lines + should play a method (a single line) + play -e + should run an expression from given line number + play -i + should play multi-ranged input expressions + playing a file + should play a file + should output file contents with print option + +Pry::Config::Value + #call + when given value is a Proc + returns the value as is + when given value is a LazyValue + calls the LazyValue object + when given value is a MemoizedValue + calls the MemoizedLazy object + when given value is a non-callable object + returns the value as is + +Pry::Helpers::DocumentationHelpers + process_rdoc + should not syntax highlight already highlighted code + should syntax highlight code in + should emphasise italic tags + should highlight words surrounded by +s + should syntax highlight indented code + should syntax highlight things in backticks + should syntax highlight code in + should not double-highlight backticks inside indented code + should emphasise em tags + should not remove ++ + get_comment_content + should unindent past separators + should strip off the hash and unindent + should remove shebangs + should strip out leading lines of hashes + +disable-pry + should set DISABLE_PRY + should quit the current session hist - should store a call with `--replay` flag - should show lines between lines A and B with the --show switch - should replay history correctly (single item) - should apply --head after --grep - should start from beginning if tail number is longer than history - should show lines between offsets A and B with the --show switch - should replay a range of history correctly (range of commands) - should disallow execution of `--replay ` when CommandError raised - should replay a range of history correctly (range of items) - raises CommandError when index of `--replay` points out to another `hist --replay` should return first N lines in history with --head switch - should return last N lines in history with --tail switch - should apply --tail after --grep + should replay a range of history correctly (range of items) should grep for correct lines in history should not contain lines produced by `--replay` flag + should replay a range of history correctly (range of commands) + should store a call with `--replay` flag excludes Pry commands from the history with `-e` switch + should apply --tail after --grep + raises CommandError when index of `--replay` points out to another `hist --replay` + should show lines between lines A and B with the --show switch + should show lines between offsets A and B with the --show switch + should return last N lines in history with --tail switch + should disallow execution of `--replay ` when CommandError raised + should apply --head after --grep + should replay history correctly (single item) + should start from beginning if tail number is longer than history sessions - should not display histignore words in history - displays all history (including the current sesion) with `--all` switch displays history only for current session + displays all history (including the current sesion) with `--all` switch + should not display histignore words in history -watch expression - watches a local variable - registers the after_eval hook - continues to work if you start a second pry instance - watches an expression - prints when an expression changes - doesn't print when an expresison remains the same - prints when an expression is mutated - prints no watched expressions - deleting expressions - deletes delete - keeps keeper - -Pry::REPL - should let you run commands in the middle of multiline expressions - should rescue exceptions - autoindent - should raise no exception when indented with a tab (PENDING: Temporarily skipped with xit) - eval_string and binding_stack - shouldn't break if we start a nested instance - should immediately evaluate eval_string after cmd if complete - shouldn't break if we start a nested REPL - shouldn't break if we pop bindings in Ruby - #piping? - returns false when $stdout is a non-IO object - space prefix - with more than 1 space - prioritizes commands over variables - with 1 space - it prioritizes variables over commands - -Pry::InputCompleter - should take parenthesis and other characters into account for symbols - does not offer methods from restricted modules - should complete for arbitrary scopes - should complete for arbitrary scopes - should not return nil in its output - should complete for stdlib symbols - should complete for target symbols - should not crash if there's a Module that has a symbolic name. (PENDING: No reason given) - should complete for stdlib symbols - completes expressions with all available methods - should complete for target symbols - should complete instance variables - ignores methods from modules that override Object#hash incompatibly - -Pry.run_command - can perform a show-source - performs a simple ls +show-input + should correctly show the current lines in the input buffer -Pry::ColorPrinter - .pp - when printing a BasicObject - prints a string - when #inspect returns an object literal - prints the object inspect - and when SyntaxHighlighter returns a token starting with '' - prints the object as is - and when SyntaxHighlighter returns a token that doesn't start with '' - prints the object with escape characters - when #inspect raises Pry::Pager::StopPaging - propagates the error - when an exception is raised in #inspect - still prints a string - when no exception is raised in #inspect - prints a string with a newline - .default - prints output prefix with value +raise-up + should raise the exception with raise-up + should raise an unamed exception with raise-up + should raise the most recently raised exception + should allow you to cd up and (eventually) out + should jump immediately out of nested contexts with ! + should eat the exception at the last new pry instance on raise-up -ls - help - should show help with -h - below ceiling - should include super-classes by default - should stop before Object by default - should not include super-classes when -q is given - should include object if -v is given - methods - should handle classes that (pathologically) define .ancestors - should show public methods by default - should not show protected/private by default - should show protected/private methods with -p - should work for objects with an overridden method method - should show public methods with -p - should show error message when instance is given with -M option - should work for objects which instance_variables returns array of symbol but there is no Symbol#downcase - bug #1407 - behaves as usual when a method of the same name exists. - with -l - should not list pry noise - should find locals and sort by descending size - on java objects - should include java-esque aliases if requested (PENDING: No reason given) - should omit java-esque aliases by default (PENDING: No reason given) - grep - should reduce the number of outputted things - should still output matching things - when inside Modules - should behave normally when invoked on Module itself - should work for ivars - should still work - should include instance methods by default - when no arguments given - when in a class - should show constants - should show methods - should show class variables - when in an object - should show methods - should show instance variables - when at the top-level - should show local variables - BasicObject - should work on BasicObject - should work on subclasses of BasicObject - immediates - should work on Integer - constants - works on top-level - should not autoload constants! - should show constants defined on the current module - should not show constants defined on parent modules by default - should show constants defined on ancestors with -v - should show constants for an object's class regardless of mixins +save-file + saving commands + should save a command to a file + saving methods + single method + should display a success message on save + should save a method to a file + should save a method to a file truncated by --lines + --append + should append to end of specified file + -f + should save a file to a file + overwrite by default (no --append) + should overwrite specified file with new input + -i + should save multi-ranged input expressions + should save input expressions to a file (range) + should display a success message on save + should save input expressions to a file (single expression) -show-input - should correctly show the current lines in the input buffer +Pry::BlockCommand + #help + returns help output + #call + when #process accepts no arguments + calls the block despite passed arguments + when passed a variable-length array + calls the block without arguments + calls the block with some arguments + when #process accepts some arguments + calls the block even if there are more arguments than needed + calls the block even if there's not enough arguments -Readline - is loaded on invoking 'pry' - is not loaded on requiring 'pry' - is not loaded on invoking 'pry' if Pry.input is set +clear-screen + calls the "cls" command on Windows + calls the "clear" command on non-Windows platforms -Pry::History - #push - does not record lines that contain a NULL byte - does not record empty lines - does not record duplicated lines - .default_file - returns ~/.local/share/pry/pry_history - when $XDG_DATA_HOME is defined - returns config location relative to $XDG_DATA_HOME - returns config location relative to $XDG_DATA_HOME when ~/.pryrc exists - when ~/.pry_history exists - returns ~/.pry_history - file io errors - handles Errno::EACCES failure to write history - handles Errno::EACCES failure to read from history - handles Errno::ENOENT failure to write history - handles Errno::ENOENT failure to read from history - #history_line_count - counts entries in history - #session_line_count - returns the number of lines in history from just this session - #clear - doesn't affect the contents of the history file - clears this session's history - .load_history - reads the contents of the file - saving to a file - should not write histignore words to the history file - saves lines to a file as they are written - interleaves lines from many places - expanding the history file path - recognizes ~ (#1262) +Pry::Method::Patcher + should change the behaviour of the method + should change the source of new Pry::Method objects + should return a new method with new source + should preserve visibility Pry - .configure - yields a block with Pry.config as its argument - FAIL_PRY - should raise an error for binding.pry - should raise an error for Pry.start - Exotic object support - Should not error when return value is a BasicObject instance - Pry.critical_section - should prevent Pry being called - open a Pry session on an object - repl - last_result - should be set to the result of a command with :keep_retval - should be preserved over an empty line - should be set to the most recent value - should be preserved when evalling a command without :keep_retval - basic functionality - should set an ivar on an object and exit the repl - complete_expression? - should not mutate the input! - history arrays - can change the size of the history arrays - uses 100 as the size of _in_ and _out_ - store exceptions - sets _in_ to an array with the entered lines - sets out to an array with the result - sets _ to the last result - nesting - should nest properly - Object#pry - should start a pry session on the receiver (first form) - should raise if more than two arguments are passed to Object#pry - should start a pry session on the receiver (second form) - Pry.binding_for - should return TOPLEVEL_BINDING if parameter self is main - defining methods - defines an instance method on the module when performing "def meth;end" inside the module - defines a method on the singleton class of an object when performing "def meth;end" inside the object - defines a method on the class of an object when performing "def meth;end" inside an immediate value or Numeric - defines an instance method on the class when performing "def meth;end" inside the class - rep - should display error if Pry instance runs out of input - should not try to catch intended exceptions - should define a nested class under Hello and not on top-level or Pry - should suppress output if input ends in a ";" (single line) - should be able to operate inside the BasicObject class - should suppress output if input ends in a ";" and is an Exception object (single line) - should make self evaluate to the receiver of the rep session - should set an ivar on an object - should not leak pry constants into Object namespace - should be able to evaluate exceptions normally - should notice when exceptions are raised - multi-line input - works - should suppress output if input ends in a ";" (multi-line) - newline from an empty heredoc - works - newline stripping from an empty string - with single quotes - with fancy delimiters - with double quotes - newline stripping from an empty regexp - with fancy delimiters - with regular regexp delimiters - inside signal handler - should return with error message - a fresh instance - should use `caller` as its backtrace - Pry.binding_for - should not leak local variables - should work on frozen objects - Should not error when object doesn't have a valid == method - DISABLE_PRY - should not binding.pry - should not Pry.start - #last_exception= - returns an object who mirrors itself as the wrapped exception - returns a frozen exception - returns an instance of Pry::LastException - setting custom options - does not raise for unrecognized options - correctly handles the :quiet option (#1261) + should not raise an error on broken lines: [\n:lets,\n'list',\n[/nested/\n], things ] + should not raise an error on broken lines: p = < false) that replaces eval_string with a valid expression doesn't have the expression value suppressed + should override some inherited commands + should set the commands default, and the default should be overridable + should run a command with one parameter + should create a regex command and be able to invoke it + should create a regex command and interpolate the captures + should change description of a command using desc + creates a command in a nested context and that command should be accessible from the parent + enables an inherited method to access opts, output and target, due to instance_exec + doesn't choke on complex string interpolation when checking if ruby code is a command + should create a command with a space in its name zzz + a command that return a value in a multi-line expression clears the expression and return the value + should create a command with a space in its name and pass an argument + should define a command that keeps its return value + should inherit commands from Pry::Commands + should define a command that keeps its return value even when nil + should import commands from another command object + should NOT try to interpolate pure ruby code (no commands) + should delete some inherited commands when using delete method + should interpolate ruby code into commands + should run a command with no parameter + should create a regex command and arg_string should be interpolated + creates a regex command and passes captures into the args list before regular arguments + should define a command that keeps its return value but does not return when value is void + should NOT interpolate ruby code into commands if :interpolate => false + if a regex capture is missing it should be nil + a command (with :keep_retval => true) that replaces eval_string with a valid expression overwrites the eval_string with the return value + should define a command that does NOT keep its return value + alias_command + should pass option arguments to original with additional parameters + should pass option arguments to original + should pass on arguments to original + should be able to alias a regex command + should be able to make the alias a regex + should make an aliasd command behave like its original + Pry::Command#run + should run a command from within a command + should allow running of cd command when split into array + should run a regex command from within a command + should run a command from within a command with arguments + should allow running of commands with following whitespace + should allow running of cd command when contained in a single string + Pry#run_command + should run a command in the context of a session + should run a command that modifies the passed in eval_string + +Pry::Indent + should not indent single line statements + should properly indent nested code + should indent correctly with nesting + should indent separate lines + should ident case statements + should indent cunningly disguised ifs + should handle multiple open and closing tokens on a line + should not indent inside strings + should indent an array + should differentiate single/multi-line unless + should correctly handle while do + should indent begin rescue end + should not indent single-line rescue + should indent statements such as if, else, etc + should indent a module and class + should indent a hash + should not indent inside HEREDOCs + should not indent single/multi-line until + should not indent nested HEREDOCs + should indent a function + should not indent single-line ifs + should not raise error, if MIDWAY_TOKENS are used without indentation + nesting + should parse nesting on line 13 of example_nesting.rb + should parse nesting on line 6 of example_nesting.rb + should parse nesting on line 8 of example_nesting.rb + should parse nesting on line 31 of example_nesting.rb + should parse nesting on line 33 of example_nesting.rb + should parse nesting on line 11 of example_nesting.rb + should parse nesting on line 29 of example_nesting.rb + should parse nesting on line 4 of example_nesting.rb + should parse nesting on line 14 of example_nesting.rb + should parse nesting on line 3 of example_nesting.rb + should fail to parse nesting on line 21 of example_nesting.rb + should parse nesting on line 28 of example_nesting.rb + should parse nesting on line 2 of example_nesting.rb + should parse nesting on line 26 of example_nesting.rb + should parse nesting on line 9 of example_nesting.rb + should parse nesting on line 25 of example_nesting.rb + should parse nesting on line 10 of example_nesting.rb + should parse nesting on line 12 of example_nesting.rb + should parse nesting on line 22 of example_nesting.rb + should fail to parse nesting on line 17 of example_nesting.rb + should parse nesting on line 7 of example_nesting.rb + should parse nesting on line 23 of example_nesting.rb + should fail to parse nesting on line 19 of example_nesting.rb + should parse nesting on line 15 of example_nesting.rb + should parse nesting on line 27 of example_nesting.rb + should parse nesting on line 5 of example_nesting.rb + should parse nesting on line 32 of example_nesting.rb + should fail to parse nesting on line 20 of example_nesting.rb + should fail to parse nesting on line 30 of example_nesting.rb + should parse nesting on line 24 of example_nesting.rb + should parse nesting on line 16 of example_nesting.rb + should fail to parse nesting on line 18 of example_nesting.rb + should parse nesting on line 1 of example_nesting.rb Pry::Warning #warn prints message with file and line of the calling frame +Pry.config.unrescued_exceptions + should rescue all exceptions NOT specified on unrescued_exceptions + should NOT rescue exceptions specified on unrescued_exceptions + Pry::CommandSet + #to_hash + converts commands to hash + doesn't mutate original commands + #add_command + adds a command #list_commands returns the list of commands + #[]= + rebinds the command with key + when given command is not a subclass of Pry::Command + raises TypeError + when given command is nil + deletes the command matching the pattern + #[] + when there's an ambiguous command + prefers a command with a higher score + when there's an unambiguous command + selects the command according to the given pattern + #block_command + can overwrite default description + configures command options + defines a new command + assings default description + when description is a hash + treats description as options #rename_command can optionally set custom description renames a comamnd when provided command is not registered raises ArgumentError - #alias_command - sets aliased command's listing for regex alias - sets aliased command's listing for string alias - sets description for the aliased command automatically - sets group for the aliased command automatically - returns the aliased command - when command doesn't match - raises RuntimeError - when non-string description is provided - uses the string representation of the given object - when string description is provided - uses the given description for the aliased command + #valid_command? + when command cannot be found + returns false + when command can be found + returns true #import + includes given sets' helper modules returns self imports commands from given sets - includes given sets' helper modules + #process_line + when the given line is a command + returns a non-void command + returns a command + and context is provided + passes the context to the command + when the given line is not a command + returns a void result + returns not a command #import_from - imports matching command from a set - returns self includes other set's helper module - #valid_command? - when command can be found - returns true - when command cannot be found - returns false + returns self + imports matching command from a set + #desc + gets command description + sets command description #find_command_by_match_or_listing + returns a matching by listing command raises ArgumentError on non-matching command returns a matching by name command - returns a matching by listing command - #desc - sets command description - gets command description - #[]= - rebinds the command with key - when given command is nil - deletes the command matching the pattern - when given command is not a subclass of Pry::Command - raises TypeError + #delete + deletes given commands + #find_command_for_help + when the command can be found + returns the command + when the command cannot be found + returns nil #create_command assings default description - can overwrite default description - configures command options class_evals the given block in the command context + configures command options + can overwrite default description defines a new class command when description is a hash treats description as options - #each - iterates over commands - #find_command_for_help - when the command can be found - returns the command - when the command cannot be found - returns nil - #delete - deletes given commands #new merges other set with itself when block given instance evals the block - #process_line - when the given line is not a command - returns not a command - returns a void result - when the given line is a command - returns a non-void command - returns a command - and context is provided - passes the context to the command - #add_command - adds a command - #to_hash - converts commands to hash - doesn't mutate original commands - #block_command - configures command options - assings default description - defines a new command - can overwrite default description - when description is a hash - treats description as options - #[] - when there's an ambiguous command - prefers a command with a higher score - when there's an unambiguous command - selects the command according to the given pattern - -Pry::Output - #<< - is expected to eq # - #method_missing - when the output doesn't respond to the given method name - raises NoMethodError - when the output responds to the given method name - forwards the method to the output - #respond_to_missing? - when the output doesn't respond to the given method name - doesn't find the method - when the output responds to the given method name - finds the method that is not defined on self - #width - returns the number of columns - #tty? - when the output responds to #tty? and is a TTY - returns true - when the output responds to #tty? and is not a TTY - returns false - when the output doesn't respond to #tty? - returns false - #print - returns nil - when the given pry instance has 'color' disabled - decolorizes output - when the given pry instance has 'color' enabled - doesn't decolorize output - #puts - returns nil - when given an empty array - prints a newline - when given non-convertible to array objects - prints the non-converted objects in its string form - and when the object's #to_s has a newline - doesn't print a double newline - when the given pry instance has 'color' disabled - decolorizes output - when given multiple empty arrays - prints multiple newline - when given convertible to array objects - prints the converted objects - when the given pry instance has 'color' enabled - doesn't decolorize output - #height - returns the number of rows - #size - when the output is a tty and responds to winsize - returns the io/console winsize - when the output is not a tty - and ENV has size info in ROWS and COLUMNS - returns the ENV variable winsize - and ENV has size info in LINES and COLUMNS - returns ENV variable winsize - when the output is not a tty, and no info in ENV and no Readline info - and when there's no ANSICON ENV variable - returns the default winsize - and when there's ANSICON ENV variable - and when it cannot be matched - returns the default winsize - and when it can be matched - and when the size has a zero column - returns the default winsize - and when the size consists of positive integers - returns the ansicon winsize - when the output is not a tty and no info in ENV - when Readline's size has no zeroes - returns the Readline winsize - when Readline's size has zero column - returns the default size - #decolorize_maybe - when the given pry instance has 'color' disabled - returns decolorized string - when the given pry instance has 'color' enabled - returns the given string without modifications - #write - is expected to eq # - -exit-program - should raise SystemExit - should exit the program with the provided value - -Pry::Config::Attributable - #attribute - creates a reader attribute for the given name - creates a writer attribute for the given name - and when the attribute is invoked - sends the 'call' message to the value - -Pry::Config::Value - #call - when given value is a Proc - returns the value as is - when given value is a non-callable object - returns the value as is - when given value is a LazyValue - calls the LazyValue object - when given value is a MemoizedValue - calls the MemoizedLazy object - -amend-line - should correctly delete the previous line using the ! for content - should display error if nothing to amend - should correctly insert a line before a specified line using > - should amend a specified line when negative number given - should correctly delete a range of lines using the ! for content - should ignore second value of range with > syntax - should amend the first line of input when 0 given as line number - should amend a range of lines of input when negative numbers given - should correctly amend the specified line with interpolated text - should amend the specified line of input when line number given - should correctly amend the specified range of lines - should amend the specified range of lines, with numbers < 0 in range - should correctly delete a specific line using the ! for content - should amend the last line of input when no line number specified - -Pry::SystemCommandHandler - .default - when doesn't exist - executes the command without printing the warning - when command exists - executes the command without printing the warning - -Pry::Config::LazyValue - #call - doesn't memoize the result of call - -! - should not clear the input buffer for negation - should correctly clear the input buffer - -Pry::Helpers::Text - #strip_color - removes color code from text "\e[31m\e[1;31m'\e[0m\e[31mhello\e[1;31m'\e[0m\e[31m\e[0m\e[1B\e[0G" - removes color code from text "\e[1A\e[0G[2] pry(main)> puts \e[31m\e[1;31m'\e[0m\e[31mhello\e[1;31m'\e[0m\e[31m\e[0m\e[1B\e[0G" - removes color code from text "string" + #each + iterates over commands + #alias_command + sets aliased command's listing for regex alias + sets group for the aliased command automatically + sets aliased command's listing for string alias + sets description for the aliased command automatically + returns the aliased command + when non-string description is provided + uses the string representation of the given object + when command doesn't match + raises RuntimeError + when string description is provided + uses the given description for the aliased command -Pry::Command::Cat::FileFormatter - #file_and_line - parses relative path without line_num - parses relative path with line_num - windows filesystem - parses '\'style absolute path without line_num - parses '/'style absolute path without line_num - parses '\'style absolute path with line_num - parses '/'style absolute path with line_num - UNIX-like filesystem - parses absolute path with line_num - parses absolute path without line_num - #format - formats given files - formats given files with line number +Pry + color + should not colorize strings that already include color + should colorize strings as though they were ruby + default print + should include the => + should not be phased by un-inspectable things + doesn't leak colour for object literals + should output the right thing + custom non-IO object as $stdout + does not crash pry + output failsafe + should display serialization exceptions + should catch errors serializing exceptions + should catch serialization exceptions + output_prefix + should be able to change output_prefix + output suppression + should normally output the result + should output something if the input ends with a comment + should not output something if the input is only a comment + should not output anything if the input ends with a semicolon -Pry::BlockCommand - #call - when #process accepts some arguments - calls the block even if there are more arguments than needed - calls the block even if there's not enough arguments - when #process accepts no arguments - calls the block despite passed arguments - when passed a variable-length array - calls the block without arguments - calls the block with some arguments - #help +Pry::Command + .source_file + returns source file + .convert_to_regex + when given object is an Object + returns the given object + when given object is a String + escapes the string as a Regexp + .banner + when given an argument + merges the argument with command options + when no argument is given + and when banner was not defined previously + return nil + and when banner was defined previously + returns the memoized banner + .command_options + when given an argument + merges the argument with command options + when no argument is given + and when command options were defined previously + returns memoized command options + and when command options were not defined previously + sets command options to default options + .description + and when description was defined previously + doesn't overwrite match + when given an argument + sets description + and when description was not defined previously + sets description to nil + .subclass + sets match on the new class + sets description on the new class + returns a new class + sets block on the new class + includes helpers to the new class + sets command options on the new class + #interpolate_string + when given string doesn't contain #{ + returns the given string + when given string contains #{ + returns the result of eval within target + #target_self + returns the value of self inside the target binding + .source_line + returns source line + .match + when given an argument + and when match is an object + sets command options with listing as object's inspect + and when match is a string + sets command options with listing as match + when no argument is given + and when match was defined previously + doesn't overwrite match + and when match was not defined previously + sets match to nil + .block + when block doesn't exist + uses #process method + when block exists + returns the block + .inspect + returns command name + #run + runs a command from another command + #check_for_command_collision + when a command collides with a method + displays a warning + when a command collides with a local variable + displays a warning + when a command doesn't collide + doesn't display a warning + .name + returns the name of the command + when super command name exists + returns the name of the parent command + .source + returns source code of the method + .matches? + when given value doesn't match command regex + returns false + when given value matches command regex + returns true + .default_options + when given an Object argument + returns default options with object's inspect as listing + when given a String argument + returns default options with string listing + .group + when source file doesn't match anything + returns '(other)' + when name is given + sets group to that name + when source file matches 'pryrc' + sets group name to pryrc + when source file matches a pry command + sets group name to command name + when source file matches a pry plugin + sets group name to plugin name + #commands + returns command set as a hash + #void + returns void value + #process_line + sets captures + sets arg_string + collision warnings + when collision warnings are configured + prints a warning when there's a collision + when collision warnings are not set + prints a warning when there's a collision + #state + returns a state object + remembers the state + .command_regex + when use_prefix is true + returns a Regexp without a prefix + when use_prefix is false + returns a Regexp with a prefix + #complete + returns empty array + .doc returns help output - -Sticky locals (_file_ and friends) - locals should all exist upon initialization - locals should return second last result (__) - locals should keep value after cd-ing (_file_ and _dir_) - locals should still exist after cd-ing into a new context - locals should keep value after cd-ing (pry_instance) - locals should return last result (_) - User defined sticky locals - should create a new sticky local - should still exist after cd-ing into new binding - should provide different values for successive block invocations - setting as Pry.config option - should define a new sticky local for the session (normal value) - should define a new sticky local for the session (proc) - hash option value should override config value - should define a new sticky local for the session (normal value) - passing in as hash option when creating pry instance - should define multiple sticky locals - should define a new sticky local for the session (normal value) - should define a new sticky local for the session (as Proc) - _ex_ - returns the last exception without wrapping it in a LastException - keeps its value after cd-ing - -Pry::Hooks - clearing all hooks for an event - should clear all hooks - Pry::Hooks#merge - merge! - should NOT overwrite hooks belonging to shared event in receiver - should merge in the Pry::Hooks - should overwrite identical hook in receiver - should not share merged elements with original - should preserve hook order - merge - should return a fresh, independent instance - should contain hooks from original instance - should not affect original instances when new hooks are added - adding a new hook - should create a new hook with a callable - should not execute hook while adding it - should use block if given both block and callable - should create multiple hooks for an event - should raise if not given a block or any other object - should create a new hook with a block - should return a count of 0 for an empty hook - should not allow adding of a hook with a duplicate name - integration tests - after_session hook - should always run, even if uncaught exception bubbles out of repl - exceptions - should print out a notice for each exception raised - should not raise exceptions - before_eval hook - modifying input code - should replace input code with code determined by hook - should not interfere with command processing when replacing input code - when_started hook - should yield options to the hook - should allow overriding of target (and binding_stack) - target - should yield the target to the hook - should yield the target, as a binding - .default - returns hooks with default before_session hook - when pry instance is not quiet - runs the whereami command - when pry instance is quiet - doesn't run the whereami command - dupping a Pry::Hooks instance - should share hooks with original - adding a new hook to dupped instance should not affect original - adding a new event to dupped instance should not affect original - getting hooks - get_hook - should return the correct requested hook - should return nil if hook does not exist - get_hooks - should return an empty hash if no hooks defined - should return a hash of hook names/hook functions for an event - anonymous hooks - should only allow one anonymous hook to exist - should allow adding of hook without a name - should execute most recently added anonymous hook - deleting a hook - should return the deleted hook - should successfully delete a hook - should return nil if hook does not exist - executing a hook - should return the last exception raised as the return value - should execute block hook - should add exceptions to the errors array - should execute a general callable hook - return value of exec_hook should be that of last executed hook - should execute proc hook - should execute all hooks for an event if more than one is defined - should execute hooks in order - -edit - with --ex - with --ex NUM - should start editor on third level of backtrace with --ex 2 - should start editor on second level of backtrace with --ex 1 - should display error message when backtrace level is invalid - should start on first level of backtrace with just --ex - should start editor on first level of backtrace with --ex 0 - with a real file - should not reload the file if -n is passed - should reload the file - edits the exception even when in a patched method context - with --patch - should apply changes only in memory (monkey patching) - without FILE - should edit the current expression if it's incomplete - should ignore -n for tempfiles - should use a blank file if -t is specified - should not evaluate a file with -n - should write the evaluated command to history - should use a blank file if -t given, even during an expression - should evaluate the expression - should position the cursor at the end of the expression - should edit the previous expression if the current is empty - old edit-method tests now migrated to edit - on a method defined in a file - with -p - should successfully replace a method on an instance - should successfully replace a method from a module - should successfully replace an instance method - should preserve module nesting - should successfully replace a class method - should successfully replace a method with a question mark - monkey-patching - should work for an instance method - should work for a method from a module - should work for a method on an instance - should work for a method with a question mark - should work for a class method - should work with nesting - on an aliased method - should change the alias, but not the original, without breaking super - without -p - should correctly find a method from a module - should correctly find an instance method - should correctly find a method on an instance - should correctly find a class method - should correctly find an aliased method - with three-arg editor - should pass the editor a reloading arg - --method flag - errors when cannot find method context - should edit method context - errors when a filename arg is passed with --method - with --in - should edit the last line if no argument is given - should not work with nonsense - should edit a range of lines if a range is given - should edit a multi-line expression as it occupies one line of _in_ - should not work with a filename - should edit the nth line of _in_ - pretty error messages - should display a nice error message when cannot open a file - when editing a method by name - can repeatedly edit methods that were defined in the console - uses patch editing on methods that were previously patched - with FILE - should not allow patching any known kind of file - should invoke Pry.config.editor with absolutified filenames - should not delete the file! - should work with require relative - should guess the line number from a colon - should use the line number from -l - works with files that contain blanks in their names - - should pass the editor a reloading arg - - should not reload the file if it is not a ruby file - should not reload a ruby file if -n is given - should reload the file if it is a ruby file - should reload a non-ruby file if -r is given + .match_score + when command regex matches given value + and when the size of last match is more than 1 + returns the length of the first match + and when the size of last match is 1 or 0 + returns the length of the last match + when command regex doesn't match given value + returns -1 + #tokenize + when target is not set + still returns tokens + when shellwords is disabled + doesn't split quotes from the arguments + when given string doesn't match a command + raises CommandError + when command regex has captures + returns the captures + when given string uses interpolation + interpolates the string in the target's context + and when interpolation is disabled + doesn't interpolate the string + when shellwords is enabled + strips quotes from the arguments + .command_name + returns listing + .state + returns a command state Pry::Config - is expected to be a kind of Pry::CommandSet - is expected to be a kind of Array - is expected to equal true or equal false - is expected to equal true or equal false - is expected to be a kind of IO - is expected to equal true or equal false - is expected to be a kind of Method - is expected to equal true or equal false - is expected to eq Pry::InputCompleter + is expected to be a kind of Proc + is expected to respond to #readline is expected to eq true or equal false is expected to be a kind of String is expected to be a kind of Array is expected to equal true or equal false is expected to be a kind of String - is expected to equal true or equal false - is expected to be a kind of String - is expected to be a kind of Method - is expected to be a kind of String or equal nil - is expected to be a kind of Pry::Hooks + is expected to be a kind of Pry::CommandSet is expected to be a kind of Method is expected to be a kind of String is expected to equal true or equal false - is expected to equal true or equal false - is expected to eq true or equal false - is expected to be a kind of Pry::Prompt + is expected to be a kind of Hash + is expected to be a kind of Pry::History + is expected to be a kind of Numeric is expected to be a kind of Array - is expected to be a kind of Proc + is expected to equal true or equal false is expected to be a kind of Numeric - is expected to be a kind of String - is expected to be a kind of Hash is expected to equal true or equal false - is expected to respond to #call + is expected to be a kind of Method + is expected to be a kind of Pry::Prompt + is expected to equal true or equal false + is expected to be a kind of IO + is expected to be a kind of Array is expected to be a kind of String - is expected to be a kind of Pry::History is expected to be a kind of Proc + is expected to be a kind of String or equal nil + is expected to be a kind of Method is expected to equal true or equal false + is expected to be a kind of String + is expected to be a kind of String + is expected to respond to #call is expected to equal true or equal false + is expected to eq true or equal false is expected to equal true or equal false is expected to be a kind of OpenStruct - is expected to respond to #readline - is expected to be a kind of Numeric - #rc_file - when ~/.pryrc exists and $XDG_CONFIG_HOME is undefined - defaults to ~/.pryrc - when $XDG_CONFIG_HOME is defined - and when no default rc file exists - should return nil - and when '/xdg_home/pry/pryrc' exists - defaults to $XDG_CONFIG_HOME/pry/pryrc - and when ~/.pryrc exists - defaults to ~/.pryrc - and when ~/.config/pry/pryrc exists - defaults to ~/.config/pry/pryrc - when $PRYRC env variable is set - defaults to the value of PRYRC env variable + is expected to be a kind of Pry::Hooks + is expected to equal true or equal false + is expected to equal true or equal false + is expected to equal true or equal false + is expected to equal true or equal false + is expected to eq Pry::InputCompleter + #merge + doesn't mutate the original config + returns a new config object + #[] + returns the config value + reads the config value #merge! merges given hash with the config instance returns self when an undefined option is given adds the option to the config - #[] - returns the config value - reads the config value - #method_missing - when invoked method is not an option - returns nil - when invoked method is a LazyValue - defines a callable attribute - when invoked method ends with = - assigns a new custom option - #merge - returns a new config object - doesn't mutate the original config #respond_to? when checking an undefined option returns false @@ -5605,222 +5617,246 @@ returns true for the reader returns true for the writer #control_d_handler - when it returns a callabale with two arguments - and when it's called with one argument - calls the handler with a eval_string and a pry instance - and when it's called with multiple arguments - calls the handler with a eval_string and a pry instance when it returns a callable accepting one argument and when it is called with one argument calls the handler with a pry instance and when it is called with multiple arguments calls the handler with a pry instance + when it returns a callabale with two arguments + and when it's called with one argument + calls the handler with a eval_string and a pry instance + and when it's called with multiple arguments + calls the handler with a eval_string and a pry instance + #method_missing + when invoked method ends with = + assigns a new custom option + when invoked method is not an option + returns nil + when invoked method is a LazyValue + defines a callable attribute #control_d_handler= when the handler expects just one argument doesn't print a warning when the handler expects multiple arguments prints a warning + #rc_file + when $PRYRC env variable is set + defaults to the value of PRYRC env variable + when ~/.pryrc exists and $XDG_CONFIG_HOME is undefined + defaults to ~/.pryrc + when $XDG_CONFIG_HOME is defined + and when ~/.pryrc exists + defaults to ~/.pryrc + and when ~/.config/pry/pryrc exists + defaults to ~/.config/pry/pryrc + and when '/xdg_home/pry/pryrc' exists + defaults to $XDG_CONFIG_HOME/pry/pryrc + and when no default rc file exists + should return nil -Pry::WrappedModule - candidates - ordering of candidates - returns class with second largest number of methods as second ranked candidate - should return class with largest number of methods as primary candidate - returns class with third largest number of methods as third ranked candidate - should raise when trying to access non-existent candidate - source_location - should return nil if no source_location can be found - should return primary candidates source_location by default - returns the location of the outer module if an inner module has methods - number_of_candidates - should return 0 candidates for a class with no nested modules or methods - should return the correct number of candidates - should return 1 candidate for a class with a nested module with methods - source - should return source for third ranked candidate - should return source for deeply nested class - should return source for highest ranked candidate - should return primary candidates source by default - should return source for second ranked candidate - doc - should return doc for highest ranked candidate - should return primary candidates doc by default - should return doc for third ranked candidate - should return doc for second ranked candidate - should return docs for deeply nested class - .super - receiver is a module - should return self when .super(0) is used - should retrieve nth super - should not ignore modules when retrieving supers - receiver is a class - should return self when .super(0) is used - should ignore modules when retrieving nth superclass - should return nil when no nth superclass exists - should return nth superclass for a wrapped class - should return superclass for a wrapped class - .method_prefix - of singleton classes of anonymous classes should not be empty - of anonymous classes should not be empty - of singleton classes of objects - should return Foo# for normal classes - should return Foo. for singleton classes of classes - should return Bar# for modules - .singleton_instance - should return the attached object - should raise an exception when called on a non-singleton-class - #initialize - should raise an exception when a non-module is passed - .singleton_class? - should be false for normal classes - should be false for modules - should be true for singleton classes - .from_str - should lookup a local - should lookup an ivar - should lookup a constant - -Pry - should allow whitespace delimeted strings ending on the first char of a line - should raise an error on invalid syntax like ["puts {key: 'val'}.to_json"] - should complete an expression that contains a line ending with a , - should not raise an error on broken lines: [\n:lets,\n'list',\n[/nested/\n], things ] - should display correct number of errors on invalid syntax like ["1 1"] - should display correct number of errors on invalid syntax like ["end"] - should not raise an error on broken lines: def\na\n(); end - should not raise an error on broken lines: p = < true) that replaces eval_string with a valid expression overwrites the eval_string with the return value - should create a command with a space in its name and pass an argument - should define a command that keeps its return value - should NOT try to interpolate pure ruby code (no commands) - if a regex capture is missing it should be nil - a command (with :keep_retval => false) that replaces eval_string with a valid expression doesn't have the expression value suppressed - enables an inherited method to access opts, output and target, due to instance_exec - should inherit commands from Pry::Commands - should import commands from another command object - creates a command in a nested context and that command should be accessible from the parent - should override some inherited commands - should create a command with a space in its name zzz - should define a command that keeps its return value even when nil - should create a regex command and be able to invoke it - should change description of a command using desc - creates a regex command and passes captures into the args list before regular arguments - a command that return a value in a multi-line expression clears the expression and return the value - doesn't choke on complex string interpolation when checking if ruby code is a command - should run a command with one parameter - should NOT interpolate ruby code into commands if :interpolate => false - Pry#run_command - should run a command in the context of a session - should run a command that modifies the passed in eval_string - alias_command - should pass option arguments to original - should be able to make the alias a regex - should be able to alias a regex command - should pass option arguments to original with additional parameters - should make an aliasd command behave like its original - should pass on arguments to original - Pry::Command#run - should run a regex command from within a command - should allow running of cd command when split into array - should run a command from within a command - should allow running of commands with following whitespace - should allow running of cd command when contained in a single string - should run a command from within a command with arguments +Pry::Code + .from_file + raises error when file doesn't exist + reads lines from a file on disk + reads lines from a file relative to origin pwd + sets code type according to the file + reads lines from a file relative to current pwd + reads lines from a file relative to origin pwd with '.rb' omitted + when readling lines from Pry's line buffer + reads entered lines + can specify file type manually + when reading lines from a file without an extension + sets code type to :unknown + when reading files from $LOAD_PATH + finds Ruby files with omitted '.rb' extension + finds files in a relative directory with '.rb' omitted + recognizes Gemfile as a Ruby file + doesn't confuse files with the same name, but without an extension + doesn't confuse files with the same name, but with an extension + finds files in a relative directory with '.rb' extension + finds files with '.rb' extensions + #method_missing + when a String responds to the given method + forwards the method to a String instance + when a String does not respond to the given method + raises NoMethodError + #length + returns how many lines the code object has + #nesting_at + returns an Array of open modules + .from_method + reads lines from a method's definition + .from_module + sets code type to :ruby + reads line from a class + #respond_to_missing? + when a String responds to the given method + finds the method that is not defined on self + when a String does not respond to the given method + doesn't find the method + #max_lineno_width + when there are less than 1000 lines + returns 3 + when there are less than 10 lines + returns 1 + when there are less than 100 lines + returns 2 + #comment_describing + returns a comment describing expression + #to_s + returns a string representation of code + #raw + when code has a marker + returns an unformatted String of all lines + #grep + when pattern is specified + returns lines matching the pattern + when pattern is nil + returns self + #push + appends lines to the code + is an alias of #<< + #between + when start_line is nil + returns self + when a negative end_line is specified + returns a range of lines from the end + when start_line is a Range + returns a range fo lines corresponding to the given Range + when a negative start_line is specified + returns a line from the end + when only start_line is specified + removes leaves only the specified line + returns a code object + when both start_line and end_line are specified + returns a code object + removes all lines that aren't in the given range + #== + when a code is compared with another code with different lines + returns true + when a code is compared with another code with identical lines + returns true + when an empty code is compared with another empty code + returns true + #after + when line number is an integer + selects one line around the specified line number + and we specify how many lines to select + selects more than 1 line around + when line number is nil + returns self + #select + selects lines matching a condition + returns a code object + #with_marker + shows a marker in the right place + #reject + returns a code object + rejects lines matching a condition + #highlighted + returns a highlighted for terminal string representation of code + #before + when line number is nil + returns self + when line number is an integer + selects one line before the specified line number + and we specify how many lines to select + selects more than 1 line before + #take_lines + takes N lines from start_line + #with_line_numbers + appends line numbers to code + #expression_at + returns a multiline expressiong starting on the given line number + #around + when line number is an integer + selects one line around the specified line number + and we specify how many lines to select + selects more than 1 line around + when line number is nil + returns self + Pry::Code() + when given a Method + reads lines from bound method + when given a Proc + reads lines from proc + when given an UnboundMethod + reads lines from unbound methods + when given an Array + reads lines from the array + when given a Code object + returns the passed parameter unchanged + when given a Pry::Method + reads lines from Pry::Method + #with_indentation + indents lines -Pry::Pager - PageTracker - records short lines that don't add up to a page - treats a long line as taking up more than one row - records a string with an embedded newline - records short lines that do add up to a page - doesn't count a line until it ends - doesn't count ansi color codes towards length +Pending: (Failures listed here are expected and do not affect your suite's status) -pry_backtrace - should print a backtrace + 1) ls on java objects should include java-esque aliases if requested + # No reason given + # ./spec/commands/ls_spec.rb:302 -Pending: (Failures listed here are expected and do not affect your suite's status) + 2) ls on java objects should omit java-esque aliases by default + # No reason given + # ./spec/commands/ls_spec.rb:295 - 1) Bundler when Pry requires Gemfile, which doesn't specify Pry as a dependency loads auto-completion correctly + 3) Pry::REPL autoindent should raise no exception when indented with a tab # Temporarily skipped with xit - # ./spec/integration/bundler_spec.rb:10 + # ./spec/pry_repl_spec.rb:127 - 2) Pry::REPL autoindent should raise no exception when indented with a tab + 4) Bundler when Pry requires Gemfile, which doesn't specify Pry as a dependency loads auto-completion correctly # Temporarily skipped with xit - # ./spec/pry_repl_spec.rb:127 + # ./spec/integration/bundler_spec.rb:10 - 3) Pry::InputCompleter should not crash if there's a Module that has a symbolic name. + 5) Pry::InputCompleter should not crash if there's a Module that has a symbolic name. # No reason given # ./spec/completion_spec.rb:36 - 4) ls on java objects should include java-esque aliases if requested - # No reason given - # ./spec/commands/ls_spec.rb:302 - - 5) ls on java objects should omit java-esque aliases by default - # No reason given - # ./spec/commands/ls_spec.rb:295 - -Finished in 22.22 seconds (files took 1.46 seconds to load) +Finished in 1 minute 4.11 seconds (files took 4.48 seconds to load) 1437 examples, 0 failures, 5 pending -Randomized with seed 46010 +Randomized with seed 63931 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -5855,12 +5891,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/3314/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/3314/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/20263 and its subdirectories -I: Current time: Mon Jan 20 01:34:34 -12 2025 -I: pbuilder-time-stamp: 1737380074 +I: removing directory /srv/workspace/pbuilder/3314 and its subdirectories +I: Current time: Tue Jan 21 03:42:11 +14 2025 +I: pbuilder-time-stamp: 1737380531