Sha256: 28ad32ff391c76ac3fb0ae15a5a45309509db3cabc35bbd33a4798474a8899a6

Contents?: true

Size: 499 Bytes

Versions: 8

Compression:

Stored size: 499 Bytes

Contents

class TestUI < Vagrant::UI::Interface
  attr_reader :messages

  METHODS = [:clear_line, :report_progress, :warn, :error, :info, :success]

  def initialize
    super
    @messages = METHODS.each_with_object({}) { |m, h| h[m] = [] }
  end

  def ask(*args)
    super
    # Automated tests should not depend on user input, obviously.
    raise Errors::UIExpectsTTY
  end

  METHODS.each do |method|
    define_method(method) do |message, *opts|
      @messages[method].push message
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-lxc-0.6.4 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.6.3 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.6.2 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.6.1 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.6.0 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.5.0 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.4.0 spec/acceptance/support/test_ui.rb
vagrant-lxc-0.3.4 spec/acceptance/support/test_ui.rb