summaryrefslogtreecommitdiff
path: root/spec/unit/provider/remote_file/content_spec.rb
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-06-03 13:29:08 -0700
committersersut <serdar@opscode.com>2013-06-03 13:30:09 -0700
commitc1aba2676136a81da712f7772d020ed253b89392 (patch)
tree25cadebd7653eced1c641ddb360bce5769ffe3e9 /spec/unit/provider/remote_file/content_spec.rb
parent7fee9a0121fc56228a0214390b521a11894ef601 (diff)
downloadchef-c1aba2676136a81da712f7772d020ed253b89392.tar.gz
Remove unused class RemoteFile::Result.
Diffstat (limited to 'spec/unit/provider/remote_file/content_spec.rb')
-rw-r--r--spec/unit/provider/remote_file/content_spec.rb24
1 files changed, 5 insertions, 19 deletions
diff --git a/spec/unit/provider/remote_file/content_spec.rb b/spec/unit/provider/remote_file/content_spec.rb
index ed02fa9a32..36ecfe1c8d 100644
--- a/spec/unit/provider/remote_file/content_spec.rb
+++ b/spec/unit/provider/remote_file/content_spec.rb
@@ -84,32 +84,20 @@ describe Chef::Provider::RemoteFile::Content do
describe "when the fetcher returns nil for the tempfile" do
before do
- @result = mock("Chef::Provider::RemoteFile::Result", :raw_file => nil, :etag => nil, :mtime => nil)
- http_fetcher = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @result)
+ http_fetcher = mock("Chef::Provider::RemoteFile::HTTP", :fetch => nil)
Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
end
it "should return nil for the tempfile" do
content.tempfile.should be_nil
end
-
- it "should not set the etags on the new resource" do
- new_resource.should_not_receive(:etag).with(@result.etag)
- content.tempfile
- end
-
- it "should not set the mtime on the new resource" do
- new_resource.should_not_receive(:mtime).with(@result.mtime)
- content.tempfile
- end
end
- describe "when the fetcher returns a result with a valid tempfile" do
+ describe "when the fetcher returns a valid tempfile" do
let(:mtime) { Time.now }
let(:tempfile) { mock("Tempfile") }
- let(:result) { Chef::Provider::RemoteFile::Result.new(tempfile, "etag", mtime) }
- let(:http_fetcher) { mock("Chef::Provider::RemoteFile::HTTP", :fetch => result) }
+ let(:http_fetcher) { mock("Chef::Provider::RemoteFile::HTTP", :fetch => tempfile) }
before do
Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
@@ -189,8 +177,7 @@ describe Chef::Provider::RemoteFile::Content do
before do
@tempfile = mock("Tempfile")
mtime = Time.now
- @result = mock("Chef::Provider::RemoteFile::Result", :raw_file => @tempfile, :etag => "etag", :mtime => mtime)
- http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @result)
+ http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile)
Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(http_fetcher_works)
end
@@ -225,8 +212,7 @@ describe Chef::Provider::RemoteFile::Content do
URI.should_not_receive(:parse).with(new_resource.source[1])
@tempfile = mock("Tempfile")
mtime = Time.now
- @result = mock("Chef::Provider::RemoteFile::Result", :raw_file => @tempfile, :etag => "etag", :mtime => mtime)
- http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @result)
+ http_fetcher_works = mock("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile)
Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(http_fetcher_works)
end