| 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 26
26: def initialize(input = "")
27: ins = StringIO.new input
28: outs = StringIO.new
29: errs = StringIO.new
30:
31: ins.extend TTY
32: outs.extend TTY
33: errs.extend TTY
34:
35: super ins, outs, errs, true
36:
37: @terminated = false
38: end
# File lib/rubygems/mock_gem_ui.rb, line 56
56: def terminate_interaction(status=0)
57: @terminated = true
58:
59: raise TermError unless status == 0
60: raise SystemExitException, status
61: end