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

41 commits

Author SHA1 Message Date
Kyrylo Silin
383f97e341 rubocop: fix offences of the Layout/EmptyLineBetweenDefs cop 2018-10-14 14:40:48 +08:00
Kyrylo Silin
4cc13f9a40 rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
Kyrylo Silin
1625d362cb spec/commands/edit: delete unwanted unlinking
This line was needed for Rubinius but since we dropped it, it serves no purpose.
2018-10-07 13:33:53 +08:00
Kyrylo Silin
743b905c81 Drop support for Rubinius
Fixes  (Drop support for Rubinius)

I am amazed how many hacks we've had just to support Rubinius. It feels good to
be able to remove them and reduce the complexity of the codebase.
2018-10-07 00:58:53 +08:00
Jack Kinsella
1f4532fb35
Fix formatting in spec 2018-05-19 12:56:52 +02:00
Jack Kinsella
f53f7940db Push full edit command contents to history, enabling up-and-enter action 2018-03-25 17:43:40 +02:00
robert
ec03f1be65 fix 2.4 warning in edit command and specs about deprecated constant (Fixnum) 2017-06-03 13:50:31 +01:00
Kyrylo Silin
96c6958cc6 specs: convert to shoulds to expects 2015-03-10 22:49:29 +02:00
Matijs van Zuijlen
3eb7c55cd1 Avoid ignored literals 2015-01-23 14:05:40 +01:00
Matijs van Zuijlen
dd16a5d0ac Undefine method possibly defined in session 2015-01-23 14:05:38 +01:00
Matijs van Zuijlen
d4e4d4d8f6 Fix warning generated by editor action 2015-01-23 14:04:51 +01:00
Matijs van Zuijlen
3376e6a0db Fix more warnings 2015-01-23 14:03:50 +01:00
Conrad Irwin
bf3d7cfb69 Merge pull request from JoshCheek/issue-1269-patching-methods
Issue 1269 patching methods
2014-08-16 16:36:52 -07: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
Josh Cheek
c1c4a5152d Methods defined in console can be repeatedly edited
Fixes 
2014-08-10 00:33:38 -06:00
Josh Cheek
cbc9deccfc Methods previously patched will be patched in future edits
See https://github.com/pry/pry/issues/1269#issuecomment-51084679
2014-08-10 00:01:46 -06:00
Conrad Irwin
44463e7d85 Stop using compatibility aliases for Pry.config 2014-05-01 01:51:01 -07: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
Jonas Arvidsson
a987a8e7c2 Fix bug in edit regarding file names with path but no suffix
There was a bug in Command::Edit#probably_a_file? due to missing
parentheses in a method call followed by an operator.
2014-01-25 22:55:47 +01:00
Ryan Fitzgerald
46288ab002 Ignore -n and disable_auto_reload in tempfile cases 2013-07-26 16:52:15 -07:00
Conrad Irwin
bd320550c5 Hack in all the places 2013-03-24 20:46:15 -07:00
Conrad Irwin
9add537c93 Hack around rubinius code cache in specs
In real life it's highly unlikely anyone will be able to make a
meaningful change to a file in under a second, so the cache will
probably not interfere.
2013-03-24 20:29:04 -07:00
Conrad Irwin
b10403894a Annotate 1.9-only spec 2013-03-22 23:35:27 -07:00
Conrad Irwin
ef09e90af1 Use load instead of eval [Fixes ] 2013-03-22 23:26:52 -07: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
John Mair
f649e283ae edit: ensure 'edit --ex' always edits the exception
There was a bug where if 'edit --ex' was invoked in a patched method context
it would instead to the equivalent of 'edit --method' (patching the current method
rather than the exception)
2013-01-15 20:06:44 +01:00
Kyrylo Silin
92a1b86e1e Fix errors in "edit_spec.rb" and "editor_spec.rb"
Basically, the condition was a bit wrong. Let's hope this commit fixes
it.
2013-01-14 18:43:19 +02:00
Kyrylo Silin
05d4d13f37 Fix errors on Rubinius and JRuby
These implementations have slightly different APIs for getting your
temp directory path.
2013-01-14 16:44:09 +01:00
Kyrylo Silin
24ac5b04f4 Remove redundant call to Shellwords.escape
The "edit" command already intelligently escapes arguments, if need.
This commit also fixes four failing tests on Windows.
2013-01-14 16:44:09 +01:00
Kyrylo Silin
ae3f534b35 Fix errors in tests on Windows
Some tests are still failing, though. This commit fixes wrong usage of
temporary paths on Windows. Please, note: the `edit` command is working
well; the issue is in poor tests.

Prettify some ugly code in `spec/editor_spec.rb`.
2013-01-14 16:44:09 +01:00
Conrad Irwin
4044682704 Remove needless old_editor restoration
Unfortunately nested assignments to @old_editor meant that the
original @old_editor was permanently lost. This caused sporadic
failures of spec/editor_spec.rb which was relying on Pry.config.editor
containing a string.
2013-01-14 16:44:09 +01:00
Kyrylo Silin
e66d2083c1 Edit: handle blanks in filenames correctly
Also, move path escaping to `Editor` class. The test is currently
failing (looks like a bug in `Editor`).
2013-01-14 16:44:09 +01:00
John Mair
503e6bb63f edit command: add --method option
* --method doesn't accept any parameters, it only edits the 'current' method associated
with the binding. It's equivalent to 'edit-method' (with no args).
* This option is necessary as 'edit' by itself edits the last expression.
* Note that --method doesn't just edit the current method, if no method exists (i.e binding.pry was not put
inside a method context) then it edits the current OBJECT instead.

TODO:
* explicitly restrict --method to *just* methods and not allow it to fall back to objects?
* allow --method to take a parameter that must be a method object? e.g --method Pry#repl works
but --method Pry would fail ?
2013-01-11 20:47:46 +01:00
Larry Gilbert
611708386e Fix calls to Tempfile.new (GH issue )
Suffix of "*.rb" caused temp files to be named with "*.rb"
at the end, literally.  Not all file systems like that, and
it's almost certainly not what was intended.
2013-01-07 15:02:39 -08:00
Ryan Fitzgerald
8e289528cd Merge branch 'master' into wip.refactor 2013-01-05 19:30:14 -08:00
John Mair
68758e49ab be brave, fully remove the 'edit-method' command
All functionality has been successfully moved to 'edit' command, with all tests passing.
2013-01-01 01:25:43 +01:00
Ryan Fitzgerald
1ea1927b43 Rename accept_line to eval 2012-12-27 22:06:50 -08:00
Conrad Irwin
bef1b1972a No passing eval_str in edit_spec.rb 2012-12-18 00:51:21 -08:00
John Mair
9a279461c1 PryTestHelpers methods are now module_functions, included into Bacon::Context by default 2012-12-07 23:08:49 +01: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_commands/test_edit.rb (Browse further)