Sha256: 6d4350751a7bad432dd24fc3567887e0c24cb94b7e351c84631b762d1224a4d4

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 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
      Byebug.breakpoints[0].pos.must_equal 2
      Byebug.breakpoints[1].pos.must_equal 3
      Byebug.breakpoints[1].expr.must_equal "true"
    end
  end

  it "must be able to use shortcut" do
    enter "so #{filename}"
    debug_file('source') { Byebug.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" do
      skip("No post morten mode for now")
      #enter 'cont', "so #{filename}"
      #debug_file('post_mortem') { Byebug.breakpoints[0].pos.must_equal 3 }
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
byebug-1.0.1 test/source_test.rb
byebug-1.0.0 test/source_test.rb
byebug-0.0.1 test/source_test.rb