Removed obsolete bin scripts.
[rbx.git] / test / rubygems / test_gem_commands_fetch_command.rb
blob5a42e4e81e04a73b35b9d52094eb41aeba823a76
1 require 'test/unit'
2 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
3 require 'rubygems/package'
4 require 'rubygems/security'
5 require 'rubygems/commands/fetch_command'
7 class TestGemCommandsFetchCommand < RubyGemTestCase
9   def setup
10     super
12     @cmd = Gem::Commands::FetchCommand.new
13   end
15   def test_execute
16     util_setup_fake_fetcher
18     @fetcher.data["#{@gem_repo}/Marshal.#{@marshal_version}"] =
19       @source_index.dump
20     @fetcher.data["#{@gem_repo}/gems/#{@a2.full_name}.gem"] =
21       File.read(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
23     @cmd.options[:args] = [@a2.name]
25     use_ui @ui do
26       Dir.chdir @tempdir do
27         @cmd.execute
28       end
29     end
31     assert File.exist?(File.join(@tempdir, "#{@a2.full_name}.gem"))
32   end
34 end