summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Workman <workmad3@gmail.com>2014-09-04 22:16:40 +0100
committerDavid Workman <workmad3@gmail.com>2014-09-04 22:16:40 +0100
commitf196d2037c9dcffe5a03b12cc3f009503455c638 (patch)
tree839f94adbb127312c29a3978e9af0786c9d49879
parentbe631d50f68f56b6077965d56e2986da1e262ae3 (diff)
downloadchef-f196d2037c9dcffe5a03b12cc3f009503455c638.tar.gz
Making sure the right data is used throughout the test
-rw-r--r--spec/unit/application/apply_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index 9844640b47..913faee3a2 100644
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -36,10 +36,10 @@ describe Chef::Application::Apply do
describe "read_recipe_file" do
before do
@recipe_file_name = "foo.rb"
- @recipe_path = File.expand_path("foo.rb")
+ @recipe_path = File.expand_path(@recipe_file_name)
@recipe_file = double("Tempfile (mock)", :read => @recipe_text)
@app.stub(:open).with(@recipe_path).and_return(@recipe_file)
- File.stub(:exist?).with("foo.rb").and_return(true)
+ File.stub(:exist?).with(@recipe_path).and_return(true)
Chef::Application.stub(:fatal!).and_return(true)
end
@@ -49,6 +49,7 @@ describe Chef::Application::Apply do
it "should return a file_handle" do
@app.read_recipe_file(@recipe_file_name)[1].should be_instance_of(RSpec::Mocks::Mock)
end
+
describe "when recipe is nil" do
it "should raise a fatal with the missing filename message" do
Chef::Application.should_receive(:fatal!).with("No recipe file was provided", 1)
@@ -57,7 +58,7 @@ describe Chef::Application::Apply do
end
describe "when recipe doesn't exist" do
before do
- File.stub(:exist?).with(@recipe_file_name).and_return(false)
+ File.stub(:exist?).with(@recipe_path).and_return(false)
end
it "should raise a fatal with the file doesn't exist message" do
Chef::Application.should_receive(:fatal!).with(/^No file exists at/, 1)