From e28bf4149cb3e9d503b61b246eb679d99cbaa975 Mon Sep 17 00:00:00 2001 From: Ryan Fitzgerald Date: Sun, 19 Aug 2012 12:39:54 -0700 Subject: [PATCH] Let pry_eval take a target as the first param --- test/helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 3577ae9c..f37a9edf 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -208,7 +208,13 @@ def pry_tester(context = TOPLEVEL_BINDING, &block) end def pry_eval(*eval_strs) - pry_tester.eval(*eval_strs) + if eval_strs.first.is_a? String + binding = TOPLEVEL_BINDING + else + binding = Pry.binding_for(eval_strs.shift) + end + + pry_tester(binding).eval(*eval_strs) end class PryTester