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

14 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
Kyrylo Silin
d069ca381b rubocop: fix offences of the Layout/EmptyLinesAroundArguments cop 2018-11-04 16:42:25 +08: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 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
Conrad Irwin
a28b2b087c Fix Ctrl-D in nested pry's
I'm not convinced this is the correct fix, but it seems to mostly
preserve existing behaviour.
2012-12-28 10:00:33 -08:00
Conrad Irwin
bf3024bc73 Merge branch 'master' into wip.refactor
Conflicts:
	lib/pry.rb
	spec/command_integration_spec.rb
	spec/control_d_handler_spec.rb
2012-12-28 06:55:59 -08:00
Ryan Fitzgerald
1ea1927b43 Rename accept_line to eval 2012-12-27 22:06:50 -08:00
Conrad Irwin
4d4c0ab6b2 Pry.accept_line returns a 'should continue?' boolean 2012-12-21 00:41:53 -08:00
Conrad Irwin
37b2f20a34 accept_eof -> accept_line(nil) 2012-12-21 00:40:23 -08:00
Conrad Irwin
eeb67684d0 Add Pry::Driver to handle the reading and looping 2012-12-20 01:34:32 -08:00
Kyrylo Silin
c7b28efc24 Fix ^D press in nested REPLs
The interesting moment is that `cd -` is still a bit dorky.

  [1] pry(main)> _pry_.repl :a
  [2] pry(:a):1> _pry_.repl :b
  [3] pry(:b):2> cd -
  [4] pry(:b):2> cd -
  [5] pry(:b):2>

The problem is that `_pry_.repl` pushes a new binding onto
`binding_stack`, however, it knows nothing about `old_stack`.

Well, there is a workaround for this.

  [1] pry(main)> _pry_.repl :a
  [2] pry(:a):1> ^D
  [3] pry(main)> cd -
  [4] pry(:a):1> cd -
  [5] pry(main)>

Fix "undefined method `old_stack=' for nil:NilClass" error in this
commit, when you press ^D in a nested REPL. Add a test case for this.
Rewrite some comments and old Control-D units tests (so they use newer
test API).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-15 03:23:24 +02:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_control_d_handler.rb (Browse further)