Sha256: f1110deb993d23e4c764a0a0c1ae102392ae2d3be2d70149ee24fd32c771591d

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path('../spec_helper', File.dirname(__FILE__))

# The CocoaPods namespace
#
module Pod
  describe Command::GemIndexCache do
    before do
      @cache = Command::GemIndexCache.new
      UI.output = ''
    end

    after do
      mocha_teardown
    end

    it 'notifies the user that it is downloading the spec index' do
      response = [{}, []]
      Gem::SpecFetcher.any_instance.stubs(:available_specs).returns(response)

      @cache.download_and_cache_specs
      UI.output.should.include('Downloading Rubygem specification index...')
      UI.output.should.not.include('Error downloading Rubygem specification')
    end

    it 'notifies the user when getting the spec index fails' do
      error = Gem::RemoteFetcher::FetchError.new('no host', 'bad url')
      wrapper_error = stub(:error => error)
      response = [[], [wrapper_error]]
      Gem::SpecFetcher.any_instance.stubs(:available_specs).returns(response)

      @cache.download_and_cache_specs
      @cache.specs.should.be.empty?
      UI.output.should.include('Downloading Rubygem specification index...')
      UI.output.should.include('Error downloading Rubygem specification')
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/cocoapods-plugins-1.0.0/spec/command/gem_index_cache_spec.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/cocoapods-plugins-1.0.0/spec/command/gem_index_cache_spec.rb
cocoapods-plugins-1.0.0 spec/command/gem_index_cache_spec.rb
cocoapods-plugins-1.0.0.rc.1 spec/command/gem_index_cache_spec.rb
cocoapods-plugins-1.0.0.beta.1 spec/command/gem_index_cache_spec.rb
cocoapods-plugins-0.4.2 spec/command/gem_index_cache_spec.rb