Sha256: bf74f357043940651077c0c3941a0a403f495041188d4c044263cfc1f9de3d48

Contents?: true

Size: 906 Bytes

Versions: 77

Compression:

Stored size: 906 Bytes

Contents

require 'helper'

describe "exit-all" do
  it 'should break out of the repl loop of Pry instance and return nil' do
    pry_tester(0).simulate_repl do |t|
      t.eval 'exit-all'
    end.should == nil
  end

  it 'should break out of the repl loop of Pry instance wth a user specified value' do
    pry_tester(0).simulate_repl do |t|
      t.eval "exit-all 'message'"
    end.should == 'message'
  end

  it 'should break of the repl loop even if multiple bindings still on stack' do
    pry_tester(0).simulate_repl do |t|
      t.eval 'cd 1', 'cd 2', "exit-all 'message'"
    end.should == 'message'
  end

  it 'binding_stack should be empty after breaking out of the repl loop' do
    t = pry_tester(0) do
      def binding_stack
        @pry.binding_stack
      end
    end

    t.simulate_repl do |t|
      t.eval 'cd 1', 'cd 2', 'exit-all'
    end
    t.binding_stack.empty?.should == true
  end
end

Version data entries

77 entries across 77 versions & 5 rubygems

Version Path
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/commands/exit_all_spec.rb
pry-0.9.12.6 spec/commands/exit_all_spec.rb
pry-0.9.12.6-i386-mswin32 spec/commands/exit_all_spec.rb
pry-0.9.12.6-i386-mingw32 spec/commands/exit_all_spec.rb
pry-0.9.12.6-java spec/commands/exit_all_spec.rb
pry-0.9.12.5 spec/commands/exit_all_spec.rb
pry-0.9.12.5-i386-mswin32 spec/commands/exit_all_spec.rb
pry-0.9.12.5-i386-mingw32 spec/commands/exit_all_spec.rb
pry-0.9.12.5-java spec/commands/exit_all_spec.rb
pry-0.9.12.4 spec/commands/exit_all_spec.rb
pry-0.9.12.4-i386-mswin32 spec/commands/exit_all_spec.rb
pry-0.9.12.4-i386-mingw32 spec/commands/exit_all_spec.rb
pry-0.9.12.4-java spec/commands/exit_all_spec.rb
pry-0.9.12.3 spec/commands/exit_all_spec.rb
pry-0.9.12.3-i386-mswin32 spec/commands/exit_all_spec.rb
pry-0.9.12.3-i386-mingw32 spec/commands/exit_all_spec.rb
pry-0.9.12.3-java spec/commands/exit_all_spec.rb
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/pry-0.9.12-java/spec/commands/exit_all_spec.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/pry-0.9.12.2/spec/commands/exit_all_spec.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/pry-0.9.12.2/spec/commands/exit_all_spec.rb