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

30 commits

Author SHA1 Message Date
Kyrylo Silin
e61354693f Add .rspec and require 'helper' from there
Just discovered this nice feature of RSpec where it can load all files for
us. Works with `bundle exec rake` and `bundle exec rspec spec/file_spec.rb`,
which covers all use cases.
2018-11-18 14:04:44 +08:00
Juanito Fatas
d12ce06a7f Update clearer terminologies
Deprecate Pry.config.exception_whitelist,
use Pry.config.unrescued_exceptions instead.

Deprecate  Pry::DEFAULT_EXCEPTION_WHITELIST,
use Pry::DEFAULT_UNRESCUED_EXCEPTIONS instead.

What white / black means are not clear,
use clearer terminologies.
2018-11-11 20:21:59 +09:00
Kyrylo Silin
04d4f424e3 rubocop: fix offences regarding spaces
Fixes offences of the following cops:

* Layout/SpaceAroundEqualsInParameterDefault
* Layout/SpaceAroundOperators
* Layout/SpaceBeforeBlockBraces
* Layout/SpaceInsideBlockBraces
2018-11-04 17:34:24 +08:00
Kyrylo Silin
d069ca381b rubocop: fix offences of the Layout/EmptyLinesAroundArguments cop 2018-11-04 16:42:25 +08:00
Kyrylo Silin
22f0d664e0 rubocop: fix offences of the Layout/EmptyLines cop 2018-11-04 15:55:52 +08:00
Kyrylo Silin
187c199e77 Deprecate Pry::Platform and introduce Pry::Helpers::Platform
`Pry::Platform` really looks like a helper and therefore should be defined as
one. Invoking `Pry::Platform` emits a warning now. Users are encouraged to use
`Pry::Helpers::Platform`.
2018-11-02 01:52:09 +08:00
Kyrylo Silin
f33d82779a rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
Kyrylo Silin
4cc13f9a40 rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
Dmitry Gutov
707a6e7d62 Work around an unexpected success under JRuby 2016-12-13 23:46:28 +02:00
Dmitry Gutov
6a29ed8342 Really ignore old Argon2::Password and the like in the methods scan 2016-12-12 13:54:55 +02:00
Dmitry Gutov
6460ddcfcc Use a better method in the blacklisting test
irb_exit is defined on IRB's singleton class.
2016-12-12 03:53:06 +02:00
Dmitry Gutov
6ab8c95594 Speed up completion by caching the ignored modules
Relates to #1540.
2016-12-12 02:02:48 +02:00
Kyrylo Silin
96c6958cc6 specs: convert to shoulds to expects 2015-03-10 22:49:29 +02:00
Matijs van Zuijlen
96b61f14aa Fix some warnings 2015-01-23 14:03:36 +01:00
Josh Cheek
144d32e1d6 Switch test suite to RSpec
Removes Bacon and Mocha

Reasoning explained in this comment: https://github.com/pry/pry/issues/277#issuecomment-51708712

Mostly this went smoothly. There were a few errors that I fixed along
the way, e.g. tests that were failing but for various reasons still
passed. Should have documented them, but didn't think about it until
very near the end. But generaly, I remember 2 reasons this would happen:
`lambda { raise "omg" }.should.raise(RuntimeError, /not-omg/)` will pass
because the second argument is ignored by Bacon. And `1.should == 2`
will return false instead of raising an error when it is not in an it
block (e.g. if stuck in a describe block, that would just return false)

The only one that I felt unsure about was spec/helpers/table_spec.rb
`Pry::Helpers.tablify_or_one_line('head', %w(ing)).should == 'head: ing'`
This is wrong, but was not failing because it was in a describe block
instead of an it block.  In reality, it returns `"head: ing\n"`,
I updated the test to reflect this, though I don't know for sure
this is the right thing to do

This will fail on master until https://github.com/pry/pry/pull/1281 is merged.
This makes https://github.com/pry/pry/pull/1278 unnecessary.
2014-08-10 17:37:21 -06:00
robert
3fd66b6403 input becomes primary argument in #initialize.
with `_pry_` as an optional second. in the repl the second argument will
always be met but to avoid needing a pry instance around to use Pry::InputCompleter,
it uses the first argument(`input`) when implementing auto completion, and
'pry' can be used if its around/available.
2014-04-27 14:13:30 -07:00
robert
4bab51f53c rewrite Pry::InputCompleter as a class who wraps '_pry_'.
this commit changes InputCompleter from a module implemented on top
of singleton/class methods to a class who wraps '_pry_' and reads
from _pry_.input, who is assumed to be Readline.

pry-bond will also need to be updated to have a similar style API.
2014-04-27 14:12:45 -07:00
robert
41ecfbcba8 fix random test failure
when the tests are run in a certain order spec/completion_spec.rb can fail with:
NameError: uninitialized constant Pry::InputCompleter::Readline
  /Users/giorgio/code/pry/lib/pry/input_completer.rb:6:in `start': Pry::InputCompleter - should not crash if there's a Module that has a symbolic name.
  /Users/giorgio/code/pry/lib/pry/config/default.rb:41:in `block in <class:Default>'
  /Users/giorgio/code/pry/lib/pry/config/default.rb:58:in `instance_eval'

we require readline so we know spec/completion_spec.rb has its dependencies met
before being run.
2014-04-27 14:11:43 -07:00
Robert Gleeson
1c6a145ba7 remove attempt at bond support from pry and move to pry-bond project.
https://github.com/johnny5-/pry-bond project adds the enable-bond! and disable-bond! commands,
as well as other features, that enhance the pry&bond experience and make it easier to use and
setup without a manual effort.

see #1165
closes #1160
2014-03-17 09:37:23 +01:00
Robert Gleeson
97c28898e1 lazy load Pry::InputCompleter or Pry::BondCompleter
prior to commit both would be loaded but in most cases you'd only use
one or the other. when `bond` is available and `_pry_.config.completer`
has not been set to nil before the pry session has started & editline is
not being used(OSX only), then "pry/bond_completer" is loaded. otherwise
the default fallback is Pry::InputCompleter("pry/input_completer")
2014-03-16 04:24:12 +01:00
Robert Gleeson
74135c1890 allow for tests to be run with ease.
'bacon spec/config_spec.rb' instead of 'bacon -I spec spec/config_spec.rb'
2014-03-14 05:31:24 +01:00
Robert Gleeson
be5050a4e1 eager-load 'completer' via Default in completion_spec.rb 2014-02-03 13:21:34 +01:00
Robert Gleeson
ce25a5e476 fix build on MRI1.9, 2.0.0 2014-02-03 13:09:11 +01:00
Ryan Fitzgerald
f72ce4ec7e Fix completion spec for Ruby with editline 2014-02-02 15:34:44 -08:00
Robert Gleeson
005ea4898d remove reference to 'Readline' from if condition in tests. 2014-02-01 01:14:32 +01:00
Conrad Irwin
2c60f93b2d Merge branch 'wip.refactor'
Conflicts:
	lib/pry/completion.rb
	lib/pry/pry_instance.rb
	spec/commands/play_spec.rb
	spec/pry_defaults_spec.rb
2013-01-18 00:19:38 -08:00
Mon ouïe
2fe52d6e75 Made sure completions proc do not return nil
The completion proc returning nil causes errors in input systems that only
expect strings (e.g. Coolline).
2013-01-14 13:36:57 +01:00
Conrad Irwin
fdb703a8de Refactor completion API (git diff -w) 2012-12-28 15:21:23 -08:00
Ryan Fitzgerald
edf455f379 Minor fixes in completion spec 2012-12-18 00:10:00 -08:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_completion.rb (Browse further)