summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-12-18 16:48:34 -0800
committerdanielsdeleo <dan@opscode.com>2013-12-19 09:45:43 -0800
commitc9664b3c7afd6af3445b51e7186706368d9aeb4d (patch)
tree81052d6f397b3828124b5d0874aed2bb5cb18398
parentba504dfe9315168d1ebeeca9bed4c382eef1c4a5 (diff)
downloadohai-c9664b3c7afd6af3445b51e7186706368d9aeb4d.tar.gz
Fix dependency cycle error explanation.
-rw-r--r--lib/ohai/runner.rb2
-rw-r--r--spec/unit/runner_spec.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index ef0fdcad..4b654d66 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -66,7 +66,7 @@ module Ohai
next if next_plugin.has_run? unless force
if visited.include?(next_plugin)
- raise Ohai::Exceptions::DependencyCycle, "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, p).join(", ") }"
+ raise Ohai::Exceptions::DependencyCycle, "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, plugin).join(", ") }"
end
dependency_providers = fetch_plugins(next_plugin.dependencies)
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index 0c2bea10..02602421 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -322,7 +322,8 @@ describe Ohai::Runner, "run_plugin" do
it "should raise Ohai::Exceptions::DependencyCycle" do
@runner.stub(:fetch_plugins).with(["thing"]).and_return([@plugin1])
@runner.stub(:fetch_plugins).with(["other"]).and_return([@plugin2])
- expect { @runner.run_plugin(@plugin1) }.to raise_error(Ohai::Exceptions::DependencyCycle)
+ expected_error_string = "Dependency cycle detected. Please refer to the following plugins: Thing, Other"
+ expect { @runner.run_plugin(@plugin1) }.to raise_error(Ohai::Exceptions::DependencyCycle, expected_error_string)
end
end