Skip to content

Commit

Permalink
Merge pull request #2122 from ahorek/frozen_pry_bug
Browse files Browse the repository at this point in the history
pry-backtrace frozen bug
  • Loading branch information
kyrylo committed Apr 12, 2020
2 parents 7a4166f + da81c96 commit 0979640
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/pry/commands/pry_backtrace.rb
Expand Up @@ -20,9 +20,7 @@ class PryBacktrace < Pry::ClassCommand
BANNER

def process
text = bold('Backtrace:')
text << "\n--\n"
text << pry_instance.backtrace.join("\n")
text = "#{bold('Backtrace:')}\n--\n#{pry_instance.backtrace.join("\n")}"
pry_instance.pager.page(text)
end
end
Expand Down
12 changes: 12 additions & 0 deletions spec/commands/pry_backtrace_spec.rb
@@ -0,0 +1,12 @@
# frozen_string_literal: true

describe "pry_backtrace" do
before do
@t = pry_tester
end

it 'should print a backtrace' do
@t.process_command 'pry-backtrace'
expect(@t.last_output).to start_with('Backtrace:')
end
end

0 comments on commit 0979640

Please sign in to comment.