Last active
August 29, 2015 14:01
-
-
Save waseem/a843b8a842d63ffea80c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResourceArchiver | |
def archive_resource | |
@resource_downloader.download_resource # download_resource is already tested properly | |
@resource_downloader.archive # archive is already tested properly | |
upload_resource_archive # upload_resource_archive s already tested properly | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe ResourceArchiver do | |
let(:resource_archiver) { ResourceArchiver.new(Factory(:resource_downloader)) } | |
describe '#archive_resource' do | |
it 'calls methods in correct order' do | |
rd = resource_archiver.instance_variable_get(:@resource_downloader) | |
rd.should_receive(:download_resource).and_return(true) | |
rd.should_receive(:archive).and_return(true) | |
resource_archiver.should_receive(:upload_resource_archive).and_return(true) | |
resource_archiver.archive_resource | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment