Sha256: fc9ed573dc031685dac56b954b3dbaa82e4c6abbb912c881ed30087023e908a0

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 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"
    0.times 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
debugger2-1.0.0.beta2 test/finish_test.rb
debugger2-1.0.0.beta1 test/finish_test.rb