Sha256: 4a4e4b8a8428abc80062786b24b4cacc09a5017b070277ce8b0e4528fa2721ca

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

require_relative 'spec_helper'

describe 'PryMoves commands' do

  it 'should make one step next' do
    breakpoints [
      [nil, 'basic next stop'],
      ['n', 'next step'],
    ]
    Playground.new.basic_next
  end

  it 'should stop on second breakpoint' do
    breakpoints [
      [nil, 'first stop'],
      ['c', 'second stop'],
    ]
    Playground.new.continue
  end

  it 'should step into func and walk over stack' do
    breakpoints [
      [nil, 'step_into stop'],
      ['s', 'point to step inside'],
      ['s', 'some internal line'],
      ['up', 'point to step inside'],
      ['up', nil ],
      ['up', {output_includes: 'top of stack'} ],
      ['down', nil ],
      ['down', 'some internal line'],
      ['down', {output_includes: 'bottom of stack'} ],
    ]
    Playground.new.step_into
  end

  it 'should step into func by name' do
    breakpoints [
      [nil, 'stop in step_by_name'],
      ['s level_c', 'stop in level_c'],
      ['param', {output: '=> :target'}],
      ['n', nil],
    ]
    Playground.new.step_by_name
  end

  it 'should stop after inability to step into func by name' do
    breakpoints [
      [nil, 'stop in step_by_name'],
      ['s absent_function', 'after_step_by_name'],
    ]
    Playground.new.step_by_name_wrap
  end

  it 'should go next over recursion calls' do
    breakpoints [
      [nil, nil],
      ['n', 'next step'],
      ['n', 'should stop here after 2 next-s'],
      ['depth', {output: '=> 0'}],
    ]
    Playground.new.recursion
  end

  it 'should debug' do
    breakpoints [
      [nil, 'basic next stop'],
      ['debug level_a', 'inside of level_a'],
      ['n', 'basic next stop']
    ]
    Playground.new.basic_next
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pry-moves-0.1.13 spec/commands_spec.rb
pry-moves-0.1.12 spec/commands_spec.rb
pry-moves-0.1.10 spec/commands_spec.rb
pry-moves-0.1.9 spec/commands_spec.rb
pry-moves-0.1.8 spec/commands_spec.rb
pry-moves-0.1.7 spec/commands_spec.rb