Sha256: 8610d58bd0f5a9a9190471214766b2badf373c9de6a77dcfcfaf5631cf904b5c

Contents?: true

Size: 794 Bytes

Versions: 2

Compression:

Stored size: 794 Bytes

Contents

require 'test/unit'
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
require 'rubygems/package'
require 'rubygems/security'
require 'rubygems/commands/fetch_command'

class TestGemCommandsFetchCommand < RubyGemTestCase

  def setup
    super

    @cmd = Gem::Commands::FetchCommand.new
  end

  def test_execute
    util_setup_fake_fetcher

    @fetcher.data["#{@gem_repo}/Marshal.#{@marshal_version}"] =
      @source_index.dump
    @fetcher.data["#{@gem_repo}/gems/#{@a2.full_name}.gem"] =
      File.read(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))

    @cmd.options[:args] = [@a2.name]

    use_ui @ui do
      Dir.chdir @tempdir do
        @cmd.execute
      end
    end

    assert File.exist?(File.join(@tempdir, "#{@a2.full_name}.gem"))
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubygems-update-1.1.0 test/test_gem_commands_fetch_command.rb
rubygems-update-1.1.1 test/test_gem_commands_fetch_command.rb