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

22 commits

Author SHA1 Message Date
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)