Sha256: b1b0320113c3c5594957c892a28b49196ec140a8eeb3f9b24d4e0465443af578

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++


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

5 entries across 5 versions & 1 rubygems

Version Path
rubygems-update-0.9.4 test/test_configfile.rb
rubygems-update-0.9.0 test/test_configfile.rb
rubygems-update-0.9.2 test/test_configfile.rb
rubygems-update-0.9.1 test/test_configfile.rb
rubygems-update-0.9.3 test/test_configfile.rb