test/runner_test.rb in ripl-0.2.8 vs test/runner_test.rb in ripl-0.2.9
- old
+ new
@@ -47,13 +47,19 @@
mock_shell
Runner.run([])
Ripl.config[:blah].should == true
end
- it "catches and prints error" do
+ it "rescues and prints SyntaxError" do
mock(Runner).load(anything) { raise SyntaxError }
mock_shell
capture_stderr { Runner.run([]) }.should =~ %r{^ripl: Error while loading ~/.riplrc:\nSyntaxError:}
+ end
+
+ it "rescues and prints LoadError" do
+ mock(Runner).load(anything) { raise LoadError }
+ mock_shell
+ capture_stderr { Runner.run([]) }.should =~ %r{^ripl: Error while loading ~/.riplrc:\nLoadError:}
end
end
describe "with subcommand" do
def set_dollar_zero(val)