summaryrefslogtreecommitdiff
path: root/spec/commands/show_doc_spec.rb
blob: 3aa10f1140bed4b601a356bd082920305ef0ce16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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