Sha256: 9dd2bceabef36bfd27321dc1c09d34d6405dc06d6f0175e7a1d34905ce5cdc01
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
#-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ require 'test/unit' $:.unshift '../lib' require 'rubygems' Gem::manage_gems require 'test/mockgemui' class InterruptCommand < Gem::Command def initialize super('interrupt', 'Raises an Interrupt Exception', {}) end def execute raise Interrupt, "Interrupt exception" end end class TestProcessCommands < Test::Unit::TestCase include Gem::DefaultUserInteraction def setup @command_manager = Gem::CommandManager.new end def test_query_command use_ui(MockGemUi.new) do @command_manager.process_args "query" assert_match(/LOCAL GEMS/, ui.output) end end def test_run_interrupt use_ui(MockGemUi.new) do @command_manager.register_command :interrupt assert_raises MockGemUi::TermError do @command_manager.run 'interrupt' end assert_equal '', ui.output assert_equal "ERROR: Interrupted\n", ui.error end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubygems-update-0.9.3 | test/test_process_commands.rb |
rubygems-update-0.9.4 | test/test_process_commands.rb |