Skip to content

Commit

Permalink
spec/helpers.rb: rubocop autocorrect RSpec/ReceiveMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
kenyon committed Nov 27, 2023
1 parent 5332c3b commit 039b7a4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def generate_result(name, opts)
stderr = opts.has_key?(:stderr) ? opts[:stderr] : name
exit_code = opts.has_key?(:exit_code) ? opts[:exit_code] : 0
exit_code = [exit_code].flatten
allow(result).to receive(:stdout).and_return(stdout)
allow(result).to receive(:stderr).and_return(stderr)
allow(result).to receive_messages(stdout: stdout, stderr: stderr)
allow(result).to receive(:exit_code).and_return(*exit_code)
result
end
Expand All @@ -79,9 +78,7 @@ def make_host(name, host_hash)

host = make_opts.merge(host_hash)

allow(host).to receive(:name).and_return(name)
allow(host).to receive(:to_s).and_return(name)
allow(host).to receive(:exec).and_return(generate_result(name, host_hash))
allow(host).to receive_messages(name: name, to_s: name, exec: generate_result(name, host_hash))
host
end

Expand Down

0 comments on commit 039b7a4

Please sign in to comment.