Class | Gem::MockGemUi |
In: |
lib/rubygems/mock_gem_ui.rb
|
Parent: | Gem::StreamUI |
This Gem::StreamUI subclass records input and output to StringIO for retrieval during tests.
# File lib/rubygems/mock_gem_ui.rb, line 33 33: def initialize(input = "") 34: ins = StringIO.new input 35: outs = StringIO.new 36: errs = StringIO.new 37: 38: ins.extend TTY 39: outs.extend TTY 40: errs.extend TTY 41: 42: super ins, outs, errs, true 43: 44: @terminated = false 45: end
# File lib/rubygems/mock_gem_ui.rb, line 63 63: def terminate_interaction(status=0) 64: @terminated = true 65: 66: raise TermError, status if status != 0 67: raise SystemExitException 68: end