Sha256: f20c74ddb39ebaf3e7c7fff88af47fa925170c9bdb87dbad1892c8eb7ccfd346

Contents?: true

Size: 1.53 KB

Versions: 5

Compression:

Stored size: 1.53 KB

Contents

require_relative 'test_helper'

describe "Quit Command" do
  include TestDsl

  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
      skip("No post morten mode for now")
      #Byebug::QuitCommand.any_instance.expects(:exit!)
      #enter 'cont', 'exit!'
      #debug_file 'post_mortem'
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
byebug-1.0.3 test/quit_test.rb
byebug-1.0.2 test/quit_test.rb
byebug-1.0.1 test/quit_test.rb
byebug-1.0.0 test/quit_test.rb
byebug-0.0.1 test/quit_test.rb