summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gleeson <therobot.johnny5@gmail.com>2014-03-30 05:52:26 +0200
committerRyan Fitzgerald <rwfitzge@gmail.com>2014-04-27 14:10:56 -0700
commit7306fdee3a2cec5c7e306a27b0d7ae27dd76ec03 (patch)
tree84c6990f58c8179222b36a1aed8a62d0ffdb9198
parentd9ce4b5436cfe82174ff42ee21dfccd88b877f09 (diff)
downloadpry-7306fdee3a2cec5c7e306a27b0d7ae27dd76ec03.tar.gz
rewrite test on top of `ReplTester`.
-rw-r--r--spec/commands/show_source_spec.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/commands/show_source_spec.rb b/spec/commands/show_source_spec.rb
index 8951d7f8..c9bf1d0a 100644
--- a/spec/commands/show_source_spec.rb
+++ b/spec/commands/show_source_spec.rb
@@ -135,12 +135,11 @@ describe "show-source" do
Object.remove_const(:FooBar)
end
- it "should find methods of evaluated argument" do
- def @o.foobar
- FooBar.new
+ it "evaluates the argument as ruby and shows the source code for the returned value" do
+ ReplTester.start target: binding do
+ input 'show-source -e @o.foobar'
+ output /class FooBar/
end
-
- pry_eval(binding, 'show-source -e @o.foobar').should =~ /class FooBar/
end
end