Module: EacCli::Rspec::Setup
- Defined in:
- lib/eac_cli/rspec/setup.rb
Defined Under Namespace
Classes: FailIfRequestInput
Instance Method Summary
collapse
Instance Method Details
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/eac_cli/rspec/setup.rb', line 11
def disable_config_input_request
rspec_config.before do
::EacCli::Config::Entry.define_method(:input_value) do
super
end
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
|
6
7
8
9
|
# File 'lib/eac_cli/rspec/setup.rb', line 6
def disable_input_request
disable_config_input_request
disable_speaker_input_request
end
|
23
24
25
26
27
28
29
30
|
# File 'lib/eac_cli/rspec/setup.rb', line 23
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
|