mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
f2ef3b6ed0
A bunch of tests were order-dependent and weren't cleaning up properly after they're executed. This results in complications with #2055 where we want to randomise our test suite. With this change every test defines what it needs and then cleans up properly, instead of relying on the global space and fixtures. P.S. The specs are still quite messy but this change is a step in the right direction.
19 lines
425 B
Ruby
19 lines
425 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "show-doc" do
|
|
before do
|
|
@obj = Object.new
|
|
|
|
# obj docs
|
|
def @obj.sample_method; end
|
|
end
|
|
|
|
it "emits a deprecation warning" do
|
|
expect(pry_eval(binding, 'show-doc @obj.sample_method'))
|
|
.to match(/WARNING: the show-doc command is deprecated/)
|
|
end
|
|
|
|
it "shows docs" do
|
|
expect(pry_eval(binding, 'show-doc @obj.sample_method')).to match(/obj docs/)
|
|
end
|
|
end
|