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

34 commits

Author SHA1 Message Date
Kyrylo Silin
4956376f13 rubocop: fix offences of the Metrics/LineLength cop
I realise that some code might be less readable now, but now that we set a good
default limit, we protect the codebase from further mess. It's important to do
this to prevent adding more mess to already messy code that we have. :doctor:
2019-03-03 17:37:58 +02:00
Kyrylo Silin
e9cfdc8b45 rubocop: fix offences of the Style/RescueStandardError cop 2019-03-02 14:13:59 +02:00
Kyrylo Silin
31c6077af2 rubocop: fix the Layout/MultilineMethodCallBraceLayout cop 2019-02-25 00:58:57 +02:00
Kyrylo Silin
970d0e1d57 rubocop: fix offences of the Layout/FirstParameterIndentation cop 2019-02-25 00:31:59 +02:00
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
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
743b905c81 Drop support for Rubinius
Fixes #1775 (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
Akira Matsuda
866ea0b9f9 Fixnum and Bignum are unified into Integer since Ruby 2.4
see: https://bugs.ruby-lang.org/issues/12005
2016-12-08 03:57:27 +09:00
strcmp
0a8444906b fix #1407 2015-07-24 18:07:01 +01:00
Kyrylo Silin
96c6958cc6 specs: convert to shoulds to expects 2015-03-10 22:49:29 +02:00
Josh Cheek
990d3e8062 Run test in an object of its own
Otherwise we are sharing state with the toplevel binding,
which allows other tests to modify its values causing this to fail
e.g. https://travis-ci.org/pry/pry/jobs/32184681
2014-08-10 18:28:44 -06: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
a01265881d Fix ls on Fixnum [Fixes #1120] 2014-02-05 15:35:24 -08:00
Ryan Fitzgerald
3bbe0f0c32 Remove support for 1.8-compatible versions of Ruby 2014-01-19 17:43:07 -08:00
yui-knk
b12aa12ed1 Add spec to ls command. When 'ls -M instance' is called, exception should be raised. 2013-12-23 22:53:17 +09:00
Ryan Fitzgerald
235b65d5b3 Really, really fix ls bug, with spec 2013-11-29 17:14:44 -08:00
Kyrylo Silin
6721f0ccd6 lib/pry/commands/ls.rb: fix ls -c on top-level
This is rather an odd bug introduced by this commit: "Add support for
BasicObjects to `ls`"[1]. `ls -c` works, if you install it as a gem, but
it refuses to display anything, if you run it via `rake pry`. Moreover,
I've tried to write a failing test without changing the implementation,
but the test suite couldn't fail. Let's fix this issue, because it can
save us a lot of time, avoiding the situation when one stumble upon this
oddity once again.

[1]: ac683892d1
2013-11-30 02:27:46 +02:00
Conrad Irwin
bd4817ec15 Support ruby 2.1! 2013-11-09 16:32:52 -05:00
Conrad Irwin
1b5fdc2d18 Skip BasicObject on archaic rubies 2013-10-19 21:59:58 -07:00
Conrad Irwin
cc72e1ddf8 Fix specs with spurious newlines 2013-10-19 21:20:55 -07:00
Conrad Irwin
ac683892d1 Add support for BasicObjects to ls [Fixes #984] 2013-10-19 20:58:57 -07:00
Paul Chechetin
9a3793d1a1 Fix issue with Puppet
See:
    https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/monkey_patches.rb#L278
2013-04-16 19:25:33 +04:00
Kyrylo Silin
b6b6d6b584 LsSpec: get rid of "empty spec" warning on RBX 1.9 2013-03-13 20:12:53 +02:00
☈king
1201c3c937 Skip assertion on rbx — is an edge case, anyway 2013-02-26 08:42:08 -06:00
☈king
aea6836530 Handle evil classes that define 'ancestors' 2013-02-26 07:28:37 -06:00
Ryan Fitzgerald
d7b336328c Add regression test for 28afdd547d 2013-01-27 15:33:53 -08:00
☈king
14283aa51f Adjusting ls output for voluminous output
The previous table output was geared mostly for `ls _pry_`, which isn't
a common of hierarchy. After feedback from users such as @envygeeks, we
found a few tweaks that would help the really-small layers such as those
found in Rails or in small classes, namely:

- Rolling it up onto one line, if possible
- Highlighting the heading in the colors familiar to users of GNU ls for
  "directory" style

Additionally, I took the opportunity for toning down the
private/protected method colors, because before they were green and
yellow, now they're both "muted terminal blue"

Without the ability to really get in and really distinguish colors (e.g.
using 256 colors), giving "protected" such a loud color seems wrong.

Before recoloring:
  https://github.com/pry/pry/issues/813#issuecomment-12355179
After:
  https://github.com/pry/pry/issues/813#issuecomment-12355941
2013-01-17 23:15:31 +00:00
☈king
139a2a7a0a Extract Table to its own file 2013-01-09 17:18:44 -06:00
☈king
f9b9598c11 ls columns improvement
Now is like /bin/ls, sorting downward, shrink-wrapping columns, and
minimizing row usage as best as I know how.
2013-01-08 14:22:20 -06:00
☈king
4e89649ac7 Intermediate merge step 2013-01-08 14:22:20 -06:00
Conrad Irwin
e59cd57ebf Fix ls formatting spec error 2012-12-09 22:11:09 -08:00
Andrew Vos
cd5f0ae3be Reading the output of ls is hard, tablify it
ls now shows items more like how the unix ls works
2012-11-29 10:51:08 +00:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_commands/test_ls.rb (Browse further)