Module: EacCli::Rspec::Setup

Defined in:
lib/eac_cli/rspec/setup.rb

Defined Under Namespace

Classes: FailIfRequestInput

Instance Method Summary collapse

Instance Method Details

#disable_config_input_requestObject



16
17
18
19
20
21
22
# File 'lib/eac_cli/rspec/setup.rb', line 16

def disable_config_input_request
  rspec_config.before do
    allow_any_instance_of(::EacCli::Config::Entry).to receive(:input_value) do |obj|
      raise "Console input requested for entry (Path: #{obj.path})"
    end
  end
end

#disable_input_requestObject



11
12
13
14
# File 'lib/eac_cli/rspec/setup.rb', line 11

def disable_input_request
  disable_config_input_request
  disable_speaker_input_request
end

#disable_speaker_input_requestObject



24
25
26
27
28
29
30
31
# File 'lib/eac_cli/rspec/setup.rb', line 24

def disable_speaker_input_request
  ::RSpec.configure do |config|
    config.around do |example|
      ::EacRubyUtils::Speaker
        .context.on(::EacCli::Speaker.new(in_in: FailIfRequestInput.new)) { example.run }
    end
  end
end