summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-19 10:06:27 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-19 10:06:27 -0700
commit719e49d00afc282c2f2d4e0fe20c6e7c39ccc5da (patch)
treee5d8002c2e1cc9652381dc9d613093458b0a1c92 /spec/unit/dsl
parente756f15f1034757cce5123c7fa9c77ff6627e313 (diff)
downloadohai-719e49d00afc282c2f2d4e0fe20c6e7c39ccc5da.tar.gz
more chefstyle autocorrects after the engine upgrade
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/dsl')
-rw-r--r--spec/unit/dsl/plugin_spec.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/spec/unit/dsl/plugin_spec.rb b/spec/unit/dsl/plugin_spec.rb
index 2a35701c..0b3c158a 100644
--- a/spec/unit/dsl/plugin_spec.rb
+++ b/spec/unit/dsl/plugin_spec.rb
@@ -170,10 +170,10 @@ shared_examples "Ohai::DSL::Plugin" do
describe "and an intermediate key is not a hash" do
it "raises a TypeError" do
- expect {
+ expect do
plugin.get_attribute("the_monarch", "arch_rival",
"dr_venture", "since")
- }.to raise_error(TypeError,
+ end.to raise_error(TypeError,
"Expected Hash but got String.")
end
end
@@ -204,10 +204,10 @@ shared_examples "Ohai::DSL::Plugin" do
describe "and an intermediate key is not a hash" do
it "raises a TypeError" do
- expect {
+ expect do
plugin.get_attribute(:the_monarch, :arch_rival,
:dr_venture, :since)
- }.to raise_error(TypeError,
+ end.to raise_error(TypeError,
"Expected Hash but got String.")
end
end
@@ -277,10 +277,10 @@ shared_examples "Ohai::DSL::Plugin" do
describe "and an intermediate key is not a hash" do
it "raises a TypeError" do
- expect {
+ expect do
plugin.attribute?("the_monarch", "arch_rival",
"dr_venture", "since")
- }.to raise_error(TypeError,
+ end.to raise_error(TypeError,
"Expected Hash but got String.")
end
end
@@ -310,10 +310,10 @@ shared_examples "Ohai::DSL::Plugin" do
describe "and an intermediate key is not a hash" do
it "raises a TypeError" do
- expect {
+ expect do
plugin.attribute?(:the_monarch, :arch_rival,
:dr_venture, :since)
- }.to raise_error(TypeError,
+ end.to raise_error(TypeError,
"Expected Hash but got String.")
end
end
@@ -369,11 +369,11 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "collects from multiple provides statements" do
- plugin = Ohai.plugin(:Test) {
+ plugin = Ohai.plugin(:Test) do
provides("one")
provides("two", "three")
provides("four")
- }
+ end
expect(plugin.provides_attrs).to eql(%w{one two three four})
end
@@ -402,11 +402,11 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "collects from multiple depends statements" do
- plugin = Ohai.plugin(:Test) {
+ plugin = Ohai.plugin(:Test) do
depends("one")
depends("two", "three")
depends("four")
- }
+ end
expect(plugin.depends_attrs).to eql(%w{one two three four})
end
@@ -442,11 +442,11 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "saves multiple collect_data blocks" do
- plugin = Ohai.plugin(:Test) {
+ plugin = Ohai.plugin(:Test) do
collect_data {}
collect_data(:windows) {}
collect_data(:darwin) {}
- }
+ end
[:darwin, :default, :windows].each do |platform|
expect(plugin.data_collector).to have_key(platform)
end
@@ -461,21 +461,21 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "fails a platform has already been defined in the same plugin" do
- expect {
- Ohai.plugin(:Test) {
+ expect do
+ Ohai.plugin(:Test) do
collect_data {}
collect_data {}
- }
- }.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
+ end
+ end.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
end
it "fails if a platform has already been defined in another plugin file" do
Ohai.plugin(:Test) { collect_data {} }
- expect {
- Ohai.plugin(:Test) {
+ expect do
+ Ohai.plugin(:Test) do
collect_data {}
- }
- }.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
+ end
+ end.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
end
end