Skip to content

Commit 19c1e85

Browse files
committed
Missing a stub for File.read()
1 parent 29f431f commit 19c1e85

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

chef/spec/unit/provider/template_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
describe Chef::Provider::Template, "action_create" do
2222
before(:each) do
2323
@rest = mock(Chef::REST, { :get_rest => "/tmp/foobar" })
24-
@tempfile = mock(Tempfile, { :path => "/tmp/foo", })
24+
@tempfile = mock(Tempfile, { :path => "/tmp/foo", :print => true, :close => true })
25+
Tempfile.stub!(:new).and_return(@tempfile)
26+
File.stub!(:read).and_return("monkeypoop")
2527
@rest.stub!(:get_rest).and_return(@tempfile)
2628
@resource = Chef::Resource::Template.new("seattle")
2729
@resource.path(File.join(File.dirname(__FILE__), "..", "..", "data", "seattle.txt"))

0 commit comments

Comments
 (0)