Sha256: 3a52831a4f0686de054f1e8bf3afc407f96a9e4de091ffddce75249c37e76bc4

Contents?: true

Size: 1.48 KB

Versions: 12

Compression:

Stored size: 1.48 KB

Contents

require_relative 'test_helper'

class TestQuit < TestDsl::TestCase

  it 'must quit if user confirmed' do
    Byebug::QuitCommand.any_instance.expects(:exit!)
    enter 'quit', 'y'
    debug_file 'quit'
    check_output_includes 'Really quit? (y/n)', interface.confirm_queue
  end

  it 'must not quit if user didn\'t confirm' do
    Byebug::QuitCommand.any_instance.expects(:exit!).never
    enter 'quit', 'n'
    debug_file 'quit'
    check_output_includes 'Really quit? (y/n)', interface.confirm_queue
  end

  it 'must quit immediatly if used with !' do
    Byebug::QuitCommand.any_instance.expects(:exit!)
    enter 'quit!'
    debug_file 'quit'
    check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
  end

  it 'must quit immediatly if used with "unconditionally"' do
    Byebug::QuitCommand.any_instance.expects(:exit!)
    enter 'quit unconditionally'
    debug_file 'quit'
    check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
  end

  it 'must finalize interface before quitting' do
    Byebug::QuitCommand.any_instance.stubs(:exit!)
    interface.expects(:finalize)
    enter 'quit!'
    debug_file 'quit'
  end

  it 'must quit if used "exit" alias' do
    Byebug::QuitCommand.any_instance.expects(:exit!)
    enter 'exit!'
    debug_file 'quit'
  end

  describe 'Post Mortem' do
    it 'must work in post-mortem mode' do
      Byebug::QuitCommand.any_instance.expects(:exit!)
      enter 'cont', 'exit!'
      debug_file 'post_mortem'
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
byebug-1.8.2 test/quit_test.rb
byebug-1.8.1 test/quit_test.rb
byebug-1.8.0 test/quit_test.rb
byebug-1.7.0 test/quit_test.rb
byebug-1.6.1 test/quit_test.rb
byebug-1.6.0 test/quit_test.rb
byebug-1.5.0 test/quit_test.rb
byebug-1.4.2 test/quit_test.rb
byebug-1.4.1 test/quit_test.rb
byebug-1.4.0 test/quit_test.rb
byebug-1.3.1 test/quit_test.rb
byebug-1.3.0 test/quit_test.rb