From 1376726cf60fac5d145af98faece6ba7867cd311 Mon Sep 17 00:00:00 2001 From: Tom Kadwill Date: Sat, 10 May 2014 10:09:11 +0100 Subject: [PATCH] Added tests for Pry::Command::ReloadCode#reload_object and Pry::Command::ReloadCode#process --- spec/commands/reload_code_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/commands/reload_code_spec.rb b/spec/commands/reload_code_spec.rb index f471e4bb..c868bf6a 100644 --- a/spec/commands/reload_code_spec.rb +++ b/spec/commands/reload_code_spec.rb @@ -17,5 +17,16 @@ describe "reload_code" do "reload-code") end.should.raise(Pry::CommandError) end + + it 'reloads pry commmand' do + pry_eval("reload-code reload-code").should =~ /reload-code was reloaded!/ + end + + it 'raises an error when pry command not found' do + proc do + pry_eval( + "reload-code not-a-real-command") + end.should.raise(Pry::CommandError).message.should =~ /Cannot locate not-a-real-command!/ + end end end