~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to test/rubygems/test_gem_commands_generate_index_command.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'test/unit'
 
2
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
 
3
require 'rubygems/indexer'
 
4
require 'rubygems/commands/generate_index_command'
 
5
 
 
6
class TestGemCommandsGenerateIndexCommand < RubyGemTestCase
 
7
 
 
8
  def setup
 
9
    super
 
10
 
 
11
    @cmd = Gem::Commands::GenerateIndexCommand.new
 
12
    @cmd.options[:directory] = @gemhome
 
13
  end
 
14
 
 
15
  def test_execute
 
16
    use_ui @ui do
 
17
      @cmd.execute
 
18
    end
 
19
 
 
20
    yaml = File.join @gemhome, 'yaml'
 
21
    yaml_z = File.join @gemhome, 'yaml.Z'
 
22
    quick_index = File.join @gemhome, 'quick', 'index'
 
23
    quick_index_rz = File.join @gemhome, 'quick', 'index.rz'
 
24
 
 
25
    assert File.exist?(yaml), yaml
 
26
    assert File.exist?(yaml_z), yaml_z
 
27
    assert File.exist?(quick_index), quick_index
 
28
    assert File.exist?(quick_index_rz), quick_index_rz
 
29
  end
 
30
 
 
31
end if ''.respond_to? :to_xs
 
32