Sha256: 070bcfda76f898770c30d24e932b8f9af8d20215f89d2a38ce8f2b1b066ff459

Contents?: true

Size: 682 Bytes

Versions: 15

Compression:

Stored size: 682 Bytes

Contents

module VMC::TestSupport::InteractHelper
  def stub_ask(*args, &block)
    a_stub = nil
    any_instance_of VMC::CLI do |interactive|
      a_stub = stub(interactive).ask(*args, &block)
    end
    a_stub
  end

  def mock_ask(*args, &block)
    a_mock = nil
    any_instance_of VMC::CLI do |interactive|
      a_mock = mock(interactive).ask(*args, &block)
    end
    a_mock
  end

  def dont_allow_ask(*args)
    any_instance_of VMC::CLI do |interactive|
      dont_allow(interactive).ask(*args)
    end
  end

  def mock_with_progress(message)
    any_instance_of VMC::CLI do |interactive|
      mock(interactive).with_progress(message) { |_, block| block.call }
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
af-0.5.0.beta.11 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.10 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.9 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.8 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.7 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.6 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.5 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.4 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.3 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.2 lib/vmc/test_support/interact_helper.rb
af-0.5.0.beta.1 lib/vmc/test_support/interact_helper.rb
vmc-0.5.0.rc1 lib/vmc/test_support/interact_helper.rb
vmc-0.5.0.beta.12 lib/vmc/test_support/interact_helper.rb
vmc-0.5.0.beta.11 lib/vmc/test_support/interact_helper.rb
vmc-0.5.0.beta.10 lib/vmc/test_support/interact_helper.rb