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

18 commits

Author SHA1 Message Date
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
Conrad Irwin
44463e7d85 Stop using compatibility aliases for Pry.config 2014-05-01 01:51:01 -07:00
Robert Gleeson
43b80755e6 change Pry.view_clip() to optionally drop or include hex value.
change 2nd argument of Pry.view_clip() to accept a Hash of options
with two keys: max_length (default 60) and id (default false)

the custom prompt proc's in lib/pry.rb clip the object shown to
look better visually. this change still supports that behavior but
also adds the option to include a hex representation of the object's
ID by including id: true.

@rf- suggested supporting both (with & without id) to be able to
keep printer proc's pretty but also support other code that's okay
with printing inspects that are hex-y, like the Pry::CLIPPED_PRINT.

also changes Pry::CLIPPED_PRINT to print return values with a hex
ID included since it is a bit different from prompt proc's.
2014-03-16 08:25:04 +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
Kyrylo Silin
6ca5f60207 Allow customisation of the prompt objects
Fix issue #885 (Add an API for extending Pry.view_clip)

    [1] pry(main)> class Barbie
                 |   def inspect
                 |     'You can brush my hair, undress me everywhere!'
                 |   end
                 | end
    => nil
    [2] pry(main)>
    [3] pry(main)> Pry.config.prompt_safe_objects << Barbie
    => [String, Numeric, Symbol, nil, true, false, Barbie]
    [4] pry(main)> cd Barbie.new
    [5] pry(You can brush my hair, undress me everywhere!):1>
2013-05-04 11:21:16 +03: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
Conrad Irwin
1aacb10cb3 Remove output.write
Many plugins only define a puts method on the output object. This change
removse the ability to customize the formatter used when outputting
variables in `ls`. We should reconsider the best way to do this.
2013-01-14 09:33:27 -08:00
Ryan Fitzgerald
1ea1927b43 Rename accept_line to eval 2012-12-27 22:06:50 -08:00
Conrad Irwin
eeb67684d0 Add Pry::Driver to handle the reading and looping 2012-12-20 01:34:32 -08:00
Conrad Irwin
e85e9d8ec6 Don't define methods on Object when testing prompt 2012-12-18 01:08:51 -08:00
Conrad Irwin
cc8bcb2ed0 Don't use stdout... 2012-12-18 00:46:37 -08:00
Conrad Irwin
94bf5d63d0 Remove arg from select_prompt in the specs 2012-12-18 00:42:13 -08:00
Ryan Fitzgerald
432e07732e Remove rep and re 2012-12-18 00:17:00 -08:00
Ryan Fitzgerald
d9d0215ce8 Remove more target params 2012-12-17 00:18:41 -08:00
Ryan Fitzgerald
1fb571f884 Fix failures in pry_defaults_spec 2012-12-15 15:26:19 -08:00
John Mair
31a9578228 cleaned up lib/pry/test/helper.rb
* removed most historicla junk from lib/pry/test/helper.rb
* relocated recalcitrant junk to the local spec/helper.rb (this isn't exposed to 3rd parties)
2012-12-07 21:41:05 +01:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_pry_defaults.rb (Browse further)