Sha256: 873b0172d5f93412e3a271865eeb7260b97f000ccf79215fa52793386c1875a5

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require_relative 'test_helper'

describe "Source Command" do
  include TestDsl

  let(:filename) { 'source_example.txt' }
  before do
    File.open(filename, 'w') do |f|
      f.puts 'break 2'
      f.puts 'break 3 if true'
    end
  end
  after do
    FileUtils.rm(filename)
  end

  it "must run commands from file" do
    enter "source #{filename}"
    debug_file 'source' do
      Debugger.breakpoints[0].pos.must_equal 2
      Debugger.breakpoints[1].pos.must_equal 3
      Debugger.breakpoints[1].expr.must_equal "true"
    end
  end

  it "must be able to use shortcut" do
    enter "so #{filename}"
    debug_file('source') { Debugger.breakpoints[0].pos.must_equal 2 }
  end

  it "must show an error if file is not found" do
    enter "source blabla"
    debug_file 'source'
    check_output_includes /Command file '.*blabla' is not found/, interface.error_queue
  end

  describe "Post Mortem" do
    it "must work in post-mortem mode"

    0.times do
      enter 'cont', "so #{filename}"
      debug_file('post_mortem') { Debugger.breakpoints[0].pos.must_equal 3 }
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debugger2-1.0.0.beta2 test/source_test.rb
debugger2-1.0.0.beta1 test/source_test.rb