Class
This Gem::StreamUI
subclass records input and output to StringIO
for retrieval during tests.
Class Methods
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 47
def initialize(input = "")
require 'stringio'
ins = StringIO.new input
outs = StringIO.new
errs = StringIO.new
ins.extend TTY
outs.extend TTY
errs.extend TTY
super ins, outs, errs, true
@terminated = false
end
No documentation available
Instance Methods
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 62
def ask(question)
raise InputEOFError, question if @ins.eof?
super
end
No documentation available
#
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 76
def error
@errs.string
end
No documentation available
#
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 68
def input
@ins.string
end
No documentation available
#
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 72
def output
@outs.string
end
No documentation available
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 84
def terminate_interaction(status=0)
@terminated = true
raise TermError, status if status != 0
raise SystemExitException
end
No documentation available
lib/rubygems/mock_gem_ui.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/rubygems/mock_gem_ui.rb, line 80
def terminated?
@terminated
end
No documentation available