Sha256: 31afd014c8414ab56d4580fd03df8f64791ccc90b5a8434c63867b8807ca59a2
Contents?: true
Size: 1.1 KB
Versions: 163
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true require 'eac_cli/config/entry' require 'eac_cli/speaker' require 'eac_ruby_utils/core_ext' require 'eac_ruby_utils/speaker' module EacCli module Rspec module Setup def disable_input_request disable_config_input_request disable_speaker_input_request end 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 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 class FailIfRequestInput %w[gets noecho].each do |method| define_method(method) do raise "Input method requested: #{method}. Should not request input on RSpec." end end end end end end
Version data entries
163 entries across 163 versions & 3 rubygems