~spuul/ruby/ruby2.0

« back to all changes in this revision

Viewing changes to test/rubygems/test_gem_commands_fetch_command.rb

  • Committer: Package Import Robot
  • Author(s): Antonio Terceiro
  • Date: 2013-11-05 20:33:23 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131105203323-dqnc8bg26pt5hfp7
Tags: 2.0.0.343-1
* New upstream version (snapshot from 2.0 maintainance branch).
* fix typo in ruby2.0-tcltk description
* Backported upstream patches from Tanaka Akira to fix FTBFS on:
  - GNU/kFreeBSD (Closes: #726095)
  - x32 (Closes: #727010)
* Make date for io-console gemspec predictable (Closes: #724974)
* libruby2.0 now depends on libjs-jquery because of rdoc (Closes: #725056)
* Backport upstream patch by Nobuyoshi Nakada to fix include directory in
  `pkg-config --cflags` (Closes: #725166)
* Document missing licenses in debian/copyright (Closes: #723161)
* debian/libruby2.0.symbols: add new symbol rb_exec_recursive_paired_outer
  (not in the public API though)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                       'gem repository directories must not be created'
35
35
  end
36
36
 
 
37
  def test_execute_latest
 
38
    util_setup_fake_fetcher
 
39
    util_setup_spec_fetcher @a1, @a2
 
40
 
 
41
    @fetcher.data["#{@gem_repo}gems/#{@a1.file_name}"] =
 
42
      File.read(@a1.cache_file)
 
43
    @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
 
44
      File.read(@a2.cache_file)
 
45
 
 
46
    refute_path_exists File.join(@tempdir, 'cache'), 'sanity check'
 
47
 
 
48
    @cmd.options[:args] = [@a2.name]
 
49
    @cmd.options[:version] = req('>= 0.1')
 
50
 
 
51
    use_ui @ui do
 
52
      Dir.chdir @tempdir do
 
53
        @cmd.execute
 
54
      end
 
55
    end
 
56
 
 
57
    assert_path_exists(File.join(@tempdir, @a2.file_name),
 
58
                       "#{@a2.full_name} not fetched")
 
59
    refute_path_exists File.join(@tempdir, 'cache'),
 
60
                       'gem repository directories must not be created'
 
61
  end
 
62
 
37
63
  def test_execute_prerelease
38
64
    util_setup_fake_fetcher true
39
65
    util_clear_gems
53
79
      end
54
80
    end
55
81
 
56
 
    assert_path_exists(File.join(@tempdir, @a2_pre.file_name),
57
 
                       "#{@a2_pre.full_name} not fetched")
 
82
    assert_path_exists(File.join(@tempdir, @a2.file_name),
 
83
                       "#{@a2.full_name} not fetched")
58
84
  end
59
85
 
60
86
  def test_execute_specific_prerelease