Sha256: 77fe7efbb737c884d5e6be148f252c74bc492e4c37e29ed7c8253d91b3bcf318

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

require_relative 'test_helper'

describe "Finish Command" do
  include TestDsl

  it "must stop at the next frame by default" do
    enter 'break 16', 'cont', 'finish'
    debug_file('finish') { state.line.must_equal 13 }
  end

  it "must stop at the #0 frame by default" do
    enter 'break 16', 'cont', 'finish 0'
    debug_file('finish') { state.line.must_equal 13 }
  end

  it "must stop at the specified frame" do
    enter 'break 16', 'cont', 'finish 1'
    debug_file('finish') { state.line.must_equal 9 }
  end

  it "must stop at the next frame if the current frame was changed" do
    enter 'break 16', 'cont', 'up', 'finish'
    debug_file('finish') { state.line.must_equal 9 }
  end

  describe "not a number is specified for frame" do
    before { enter 'break 16', 'cont', 'finish foo' }

    it "must show an error" do
      debug_file('finish')
      check_output_includes "Finish argument 'foo' needs to be a number"
    end

    it "must be on the same line" do
      debug_file('finish') { state.line.must_equal 16 }
    end
  end


  describe "Post Mortem" do
    it "must not work in post-mortem mode" do
      enter 'cont', 'finish'
      debug_file "post_mortem"
      check_output_includes 'Unknown command: "finish".  Try "help".', interface.error_queue
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debugger-1.6.0 test/finish_test.rb
debugger-1.5.0 test/finish_test.rb