Sha256: 44cce5d20d203d07ac4dec5a43c1f23fd1fe9ed993034f1ffdec660f0d095f7e

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'rubygems/config_file'

class TestArgPreprocessor < Test::Unit::TestCase
  def setup
  end

  def test_create
    @cfg = Gem::ConfigFile.new([])
    assert ! @cfg.backtrace
    assert_equal File.join(Gem.user_home, '.gemrc'), @cfg.config_file_name
  end

  def test_backtrace
    args = %w(--this --that --backtrace --other stuff)
    @cfg = Gem::ConfigFile.new(args)
    assert @cfg.backtrace
    assert_equal %w(--this --that --other stuff), @cfg.args
  end

  def test_config_file
    args = %w(--this --that --config-file test/testgem.rc --other stuff)
    @cfg = Gem::ConfigFile.new(args)
    assert_equal 'test/testgem.rc', @cfg.config_file_name
    assert_equal %w(--this --that --other stuff), @cfg.args
  end

  def test_config_file2
    args = %w(--this --that --config-file=test/testgem.rc --other stuff)
    @cfg = Gem::ConfigFile.new(args)
    assert_equal 'test/testgem.rc', @cfg.config_file_name
    assert_equal %w(--this --that --other stuff), @cfg.args
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubygems-update-0.8.11 test/test_configfile.rb
rubygems-update-0.8.8 test/test_configfile.rb
rubygems-update-0.8.10 test/test_configfile.rb