Skip to content

Commit

Permalink
Download source method tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Campbell committed Mar 15, 2016
1 parent d8b572c commit c287aa4
Showing 1 changed file with 4 additions and 34 deletions.
38 changes: 4 additions & 34 deletions spec/command/deploy_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 1,5 @@
require File.expand_path('../../spec_helper', __FILE__)

class MockExternalSource
def initialize
end

def fetch
end
end

module Pod
describe Command::Deploy do

Expand Down Expand Up @@ -122,38 114,16 @@ module Pod
@transformer.stubs(:transform_dependency_name).with("Google/Analytics").returns(@dependency)
DeployTransformer.stubs(:new).returns(@transformer)

@source = MockExternalSource.new
@command.stubs(:transform_podfile).returns(@podfile)
@command.stubs(:install)
end

it 'should create new external source' do
ExternalSources.expects(:from_dependency).with(@dependency, @podfile.defined_in_file).returns(@source)
@source.stubs(:fetch)
@command.run
end

it 'should fetch source' do
ExternalSources.stubs(:from_dependency).returns(@source)
@source.expects(:fetch)
it 'should download source' do
downloader = DeployDownloader.new(nil)
DeployDownloader.stubs(:new).returns(downloader)
downloader.expects(:download)
@command.run
end

describe 'when pod is from non master repo source' do

it 'should fetch source from other repo' do


# - Pod should be defined in Pod and Lockfile
# - Pod should define another repo source
# - Download method should try each source until it gets a hit
# - If there isn't a hit then it should forward the method.

# ExternalSources.stubs(:from_dependency).returns(@source)
# @source.expects(:fetch)
# @command.run
end
end
end
end
end

0 comments on commit c287aa4

Please sign in to comment.