summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-07 10:23:58 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-07 10:23:58 -0800
commitae86c3f97b2ea699d5e81ec459653398eef12561 (patch)
tree15d08b46c1979f98a421b00862be9e546d98f9ef /spec
parentdaec3dc0c161e8b434940efa76bc91146f6be766 (diff)
downloadohai-ae86c3f97b2ea699d5e81ec459653398eef12561.tar.gz
fix specs for exception handling
- setup a class heirarchy of exceptions so i can easily rethrow any internal ohai error - catch all the non-internal errors from running the plugin and just warn on those - convert the argumenterror raises to ohai invalidplugin errors
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/runner_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index a515bdc5..b429fa8c 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -29,7 +29,7 @@ describe Ohai::Runner, "run_plugin" do
describe "when running an invalid plugin" do
it "should raise error" do
- lambda { @runner.run_plugin(double("Ohai::NotPlugin")) }.should raise_error(ArgumentError)
+ lambda { @runner.run_plugin(double("Ohai::NotPlugin")) }.should raise_error(Ohai::Exceptions::InvalidPlugin)
end
end
@@ -120,7 +120,7 @@ describe Ohai::Runner, "run_plugin" do
let(:version) { :versionBla }
it "should raise error" do
- lambda { @runner.run_plugin(plugin) }.should raise_error(ArgumentError)
+ lambda { @runner.run_plugin(plugin) }.should raise_error(Ohai::Exceptions::InvalidPlugin)
end
end