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.
* add Pry::Testable, and friends.
This commit replaces lib/pry/test/helper.rb by using category modules.
There's now:
* Pry::Testable:
* Pry::Testable::Evalable
* Pry::Testable::Mockable
* Pry::Testable::Utility
* Pry::Testable::PryTester
'include Pry::Testable' includes all of the above.
For the pry test suite it worked out best to include 'Pry::Testable' at the top-level.
In plugins I've written though this hasn't been the case, and I only normally need:
Pry::Testable::Evalable. So it reduces pollution for the third-party cases, which this
code is intended for since it lives within lib/ of the project.
What do you think?
* breaking change: add set_testenv_variables and unset_testenv_variables
* breaking change: add Pry::Testable::Variables, and rename
constant_scope() to temporary_constants().
* breaking change: rename inject_var as insert_variable, and move its
definition to Pry::Testable::Variables.
* include Pry::Testable::Evalable & include Pry::Testable::Variables into
the top-level, but keep the other two modules spec-local.
* document third argument of insert_variable.
* update CHANGELOG.md
* note changelog entry is a breaking change
* update documentation
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.
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.
This is working around (another) brokenness in jruby 1.6.8s splat
handling in ruby 1.9 mode; but I figure that now jruby 1.7 is out,
we can not bother fixing it.