Sha256: e2eff11f08762fc85ea06a79ccb5d54172df241b1aff2cdd8f9ff8359ff54702

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require_relative 'test_helper'

describe "Reload Command" do
  include TestDsl
  temporary_change_hash_value(Debugger::Command.settings, :reload_source_on_change, false)

  it "must notify that automatic reloading is off" do
    enter 'reload'
    debug_file 'reload'
    check_output_includes "Source code is reloaded. Automatic reloading is off."
  end

  it "must notify that automatic reloading is on" do
    enter 'set autoreload', 'reload'
    debug_file 'reload'
    check_output_includes "Source code is reloaded. Automatic reloading is on."
  end

  describe "reloading" do
    after { change_line_in_file(fullpath('reload'), 4, '4') }
    it "must reload the code" do
      enter 'break 3', 'cont', 'l 4-4', -> do
        change_line_in_file(fullpath('reload'), 4, '100')
        'reload'
      end, 'l 4-4'
      debug_file 'reload'
      check_output_includes "4  100"
    end
  end

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

if false
    after { change_line_in_file(fullpath('post_mortem'), 7, '        z = 4') }
    it "must work in post-mortem mode" do
      enter 'cont', -> do
        change_line_in_file(fullpath('post_mortem'), 7, 'z = 100')
        'reload'
      end, 'l 7-7'
      debug_file 'post_mortem'
      check_output_includes "7  z = 100"
    end
end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

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