Top Level Namespace

Defined Under Namespace

Modules: PryTestHelpers Classes: Array, Object, Pry, PryTester

Instance Method Summary (collapse)

Instance Method Details

- (Object) pry_eval(*eval_strs)



93
94
95
96
97
98
99
100
101
# File 'lib/pry/test/helper.rb', line 93

def pry_eval(*eval_strs)
  if eval_strs.first.is_a? String
    binding = Pry.toplevel_binding
  else
    binding = Pry.binding_for(eval_strs.shift)
  end

  pry_tester(binding).eval(*eval_strs)
end

- (Object) pry_tester(*args, &block)



83
84
85
86
87
88
89
90
91
# File 'lib/pry/test/helper.rb', line 83

def pry_tester(*args, &block)
  if args.length == 0 || args[0].is_a?(Hash)
    args.unshift(Pry.toplevel_binding)
  end

  PryTester.new(*args).tap do |t|
    (class << t; self; end).class_eval(&block) if block
  end
end