我試圖爲我的remote_file資源之一編寫rspec。但我沒有成功。
我的概念是使用remote_file它應該下載一個zip文件的遠程文件。遠程下載後,rspec會發生什麼。無法解決遠程文件資源的rspec問題
這是我的資源聲明:
remote_file zip_file_location do
source http://google.com
mode '0754'
action :create
end
這是我的RSpec測試:
it 'creates a remote_file ' do
expect(chef_run).to create_remote_file(::File.join(Chef::Config[:file_cache_path], 'sonarqube-5.6.6.zip'))
end
@gig我給它需要安裝 – pandey
Rspec的就像是你的代碼進行單元測試遠程文件的路徑,也就是在你的願望目錄結束沒有真正的文件。 – glg