diff options
Diffstat (limited to 'spec/unit/dsl/plugin_spec.rb')
-rw-r--r-- | spec/unit/dsl/plugin_spec.rb | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/spec/unit/dsl/plugin_spec.rb b/spec/unit/dsl/plugin_spec.rb index bd91eb30..4b225df5 100644 --- a/spec/unit/dsl/plugin_spec.rb +++ b/spec/unit/dsl/plugin_spec.rb @@ -169,11 +169,12 @@ shared_examples "Ohai::DSL::Plugin" do end describe "and an intermediate key is not a hash" do - it "returns nil" do - expect( - plugin.get_attribute("the_moarch", "arch_rival", + it "raises a TypeError" do + expect { + plugin.get_attribute("the_monarch", "arch_rival", "dr_venture", "since") - ).to be nil + }.to raise_error(TypeError, + "Expected Hash but got String.") end end end @@ -202,11 +203,12 @@ shared_examples "Ohai::DSL::Plugin" do end describe "and an intermediate key is not a hash" do - it "returns nil" do - expect( + it "raises a TypeError" do + expect { plugin.get_attribute(:the_monarch, :arch_rival, :dr_venture, :since) - ).to be nil + }.to raise_error(TypeError, + "Expected Hash but got String.") end end end @@ -274,11 +276,12 @@ shared_examples "Ohai::DSL::Plugin" do end describe "and an intermediate key is not a hash" do - it "returns false" do - expect( - plugin.attribute?("the_moarch", "arch_rival", + it "raises a TypeError" do + expect { + plugin.attribute?("the_monarch", "arch_rival", "dr_venture", "since") - ).to be false + }.to raise_error(TypeError, + "Expected Hash but got String.") end end end @@ -306,11 +309,12 @@ shared_examples "Ohai::DSL::Plugin" do end describe "and an intermediate key is not a hash" do - it "returns false" do - expect( + it "raises a TypeError" do + expect { plugin.attribute?(:the_monarch, :arch_rival, :dr_venture, :since) - ).to be false + }.to raise_error(TypeError, + "Expected Hash but got String.") end end end |