1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

4217 commits

Author SHA1 Message Date
Jean Boussier
09739659b6 Test against MRI 2.7.0-preview1 2019-10-22 12:49:29 +02:00
Kyrylo Silin
899684c3ba
Merge pull request from casperisfine/ruby-27-frozen-strings
Fix Ruby 2.7 compatibility in Pry::Slop#mehtod_missing
2019-10-21 23:11:09 +08:00
Jean Boussier
3be0dc1c61 Fix Ruby 2.7 compatibility in Pry::Slop#mehtod_missing 2019-10-01 13:33:23 +02:00
Kyrylo Silin
fa97d5c299
Merge pull request from bcgraham/fix-show-negative-range
Allow negative ranges in hist --show
2019-09-03 14:20:42 +08:00
Brian Graham
113670040c Allow negative ranges in hist --show
Remove duplicate `opts[:show]` check in hist.
2019-08-09 16:07:59 -04:00
Kyrylo Silin
46a99cb6c0
Merge pull request from pry/gemspec-warning-fixes
Gemspec warning fixes
2019-08-09 01:43:19 +08:00
Kyrylo Silin
d2cf4e5c52 gemspec: fix the 'pessimistic dependency on coderay' warning 2019-08-09 01:37:06 +08:00
Kyrylo Silin
0241cc02ce gemspec: fix the 'identical summary' warning when building 2019-08-09 01:35:35 +08:00
Kyrylo Silin
83458e617c CHANGELOG: mention 2019-08-08 02:19:29 +08:00
Josh Cheek
846b7ecb6f Attempt to allow pasting multiple lines with leading dots ()
Two tests are breaking, and I kind of understand why, but I'm
not sure what to do about it. Figured I should commit and send
a PR in hopes of another brain being able to help me out :)
2019-07-11 16:54:10 +03:00
Kyrylo Silin
028af11c0e CHANGELOG: mention 2019-06-15 19:14:01 +03:00
Kyrylo Silin
33a29873ff
Merge pull request from pry/randomize-tests
spec_helper: randomize tests
2019-06-15 19:04:49 +03:00
Kyrylo Silin
56e72ce958 spec/commands/show_source: pass binding to pry_eval to fix failures
There are sporadic failures with some of the tests (seems to be isolated to the
code that uses `Pry.config.commands`). Passing `binding` to `pry_eval` seems to
be fixing them. To be quite fair, I'm not sure why that happens but it feels
like the right fix because we do the same in many other tests.
2019-06-15 18:56:37 +03:00
Kyrylo Silin
93628e0102 spec_helper: reset Pry defaults after each test
This is not perfect but this reset `Pry.line_buffer`. `pry_eval` writes to it
and makes some tests fail randomly. This should probably be rewritten properly
but this hack will do to make the tests pass.
2019-06-15 18:35:18 +03:00
Kyrylo Silin
992c28e246 spec/code_object: fix broken 'class method lookup' test 2019-06-15 18:35:18 +03:00
Kyrylo Silin
c5bc87bce3 spec/editor: make specs order-independent (and sturdier) 2019-06-15 18:34:37 +03:00
Kyrylo Silin
86dff47e91 spec_helper: randomize tests 2019-06-15 18:34:37 +03:00
Kyrylo Silin
bb5a8aedb5
Merge pull request from pry/show-source-doc-examples-refactoring
spec/commands/show_{doc,source}: refactor to be order independent
2019-06-15 18:34:12 +03:00
Kyrylo Silin
f2ef3b6ed0 spec/commands/show_{doc,source}: refactor to be order independent
A bunch of tests were order-dependent and weren't cleaning up properly after
they're executed. This results in complications with  where we want to
randomise our test suite.

With this change every test defines what it needs and then cleans up properly,
instead of relying on the global space and fixtures.

P.S. The specs are still quite messy but this change is a step in the right
direction.
2019-06-15 18:28:00 +03:00
Kyrylo Silin
bfc66a12ea
Merge pull request from pry/config-spec-fix
spec/config: fix flaky test
2019-06-09 18:35:25 +03:00
Kyrylo Silin
35d181bfac spec/config: fix flaky test
This spec was failing for me locally (but worked well on Circle). The reason
is that `XDG_CONFIG_HOME` is set for me and takes precedence. Therefore, the fix
would be to unset it for the test.
2019-06-09 18:27:59 +03:00
Kyrylo Silin
e5356a4dc8
Merge pull request from pry/env-key-helper
Add Pry::Env and use where it makes sense
2019-06-09 18:07:17 +03:00
Kyrylo Silin
6e55df5a0f Use Pry::Env where it makes sense 2019-06-09 17:47:23 +03:00
Kyrylo Silin
7ce5ca70bb Add Pry::Env
Env is a helper module to work with environment variables.
2019-06-09 17:11:24 +03:00
Kyrylo Silin
17bdfd7082
Merge pull request from aeter/master
Close  - prefer XDG_* paths (if set)
2019-06-09 16:17:02 +03:00
A. Nackov
19c51bcbd1 Close - prefer XDG_* paths (if set)
References 

Using XDG_* paths (if set) with preference higher than the
home dir, for pry config and history files.

Testing: ran `bundle exec rspec`, observed the tests pass.
2019-06-05 18:29:45 +03:00
Josh Cheek
6cc6e55f20 MemoizedValue memoizes nil results ()
I moved the existing `subject` into the test because it didn't make sense for the second test I added.
2019-06-03 11:09:31 +03:00
Josh Cheek
29bdd2e403 Fix tests that fail based on user's environment ()
These tests would fail on my machine.
I think it is because I have a ~/.pry_history file.
I modified them to not depend on the state of my machine.
2019-06-02 08:51:17 +03:00
Kyrylo Silin
54b078b9e8
Merge pull request from JoshCheek/fix-test-output-clobbering-itself
REPL prints to the configured output, not directly to $stdout
2019-06-01 09:26:47 +03:00
Kyrylo Silin
4b155b8490
Merge pull request from JoshCheek/remove-rspec-should
Remove all remaining `.should`s from the tests
2019-06-01 09:22:53 +03:00
Ryan Fitzgerald
9cca93676d
Merge pull request from vaidehijoshi/remove-poem
Remove exclusionary easter egg command
2019-05-31 08:59:52 -07:00
vaidehijoshi
69a23b0e37 Remove exclusionary easter egg command
See issue  for more details.
2019-05-31 08:42:49 -07:00
Josh Cheek
95cb0c789b
Remove all remaining .shoulds from the tests 2019-05-30 23:25:18 -05:00
Josh Cheek
6686a70116
REPL prints to the configured output, not directly to $stdout 2019-05-29 20:27:56 -05:00
Kyrylo Silin
e0e29dd12d
Merge pull request from pry/test-suite-silence-warnings
spec/pry_defaults: silence unwanted deprecation warnings
2019-05-28 21:21:47 +03:00
Kyrylo Silin
4744ec7565 spec/pry_defaults: silence unwanted deprecation warnings 2019-05-28 21:17:25 +03:00
Kyrylo Silin
cc9523dee0
Merge pull request from pry/1991-output-winsize-fix
Merge Pry::Terminal with Pry::Output
2019-05-26 17:18:49 +03:00
Kyrylo Silin
67b0b53f0b Merge Pry::Terminal with Pry::Output
Fixes  (Pry in a non-stdin/stdout PTY uses incorrect window size on
non-JRuby platforms)

`Pry::Terminal` was built without custom outputs in mind. We would always assume
that `$stdout` is what the user wants. This contradicted the `output` config
option.

Thanks to `Pry::Output`, which we use internally, we can decorate the output
that the user passes us with "size" methods. If we do that, we get improved
output support for free, so that PTY's `slave` can be passed to Pry and would be
able to determine its size correctly (example from ).

I do suspect that there are still some gotchas. Some commands or portions of
code may still be assuming that `$stdout` is the only possible option. This has
to be addressed separately, in the scope of
https://github.com/pry/pry/issues/1988. The more tests we add, the easier it
will be to uncover those spots.
2019-05-26 17:11:42 +03:00
Kyrylo Silin
28cf3e9fa8
Merge pull request from pry/output-refactoring
Refactor Pry::Output and add tests
2019-05-26 14:23:06 +03:00
Kyrylo Silin
ef72f221b1 Add unit tests for Pry::Output 2019-05-26 14:18:53 +03:00
Kyrylo Silin
23a3217f64 output: assign @color inside initialize
Just a shortcut, so we don't expose the whole pry_instance to all of the class.
2019-05-26 12:52:28 +03:00
Kyrylo Silin
e7721ff540 output: rename 'boxed_io' to 'output'
Surely, `boxed_io` sounds way cooler than plain and boring `output` but I don't
think it helps for understanding the code. Although it *is* an IO object, we
treat it as output. Hence, it should be output (no boxes involved).
2019-05-26 12:47:45 +03:00
Kyrylo Silin
7ca5facc1c
Merge pull request from pry/terminal-refactoring
terminal: rename 'bang' methods to normal ones
2019-05-19 11:31:54 +03:00
Kyrylo Silin
e15f38dece terminal: rename 'bang' methods to normal ones
To be perfectly honest, I have no idea why these methods have exclamation
marks. Maybe because they may require `io/console`? Even then, there's nothing
dangerous in this.
2019-05-19 11:25:04 +03:00
Kyrylo Silin
5967769d2a
Merge pull request from pry/1876-wtf-code
commands/wtf: add the --code flag
2019-05-12 00:16:14 +03:00
Kyrylo Silin
6fd2ca3b0d commands/wtf: add the --code flag
Fixes  (Make `wtf` show code)
2019-05-12 00:13:11 +03:00
Kyrylo Silin
41e5529451 commands/wtf: fix typo in banner 2019-05-11 18:34:07 +03:00
Kyrylo Silin
68cc7fe99b
Merge pull request from pry/wtf-refactoring
Refactoring of 'wtf' and its tests
2019-05-11 16:59:29 +03:00
Kyrylo Silin
4924cecd81 commands/wtf: refactor to avoid duplication 2019-05-11 16:32:43 +03:00
Kyrylo Silin
aa173f4114 commands/wtf_spec: refactor unit tests
Although this is more verbose now, it looks more like proper unit tests. The
tester API needs to be revamped because `tester.eval` is *not* unit testing.
2019-05-11 16:32:41 +03:00