0
0
Fork 0

Remove the stub_stdout wrapper around CLI specs (#28340)

This commit is contained in:
Matt Jankowski 2023-12-13 05:14:19 -05:00 committed by GitHub
parent 3a59365e40
commit 8a3d8c6c14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 110 additions and 58 deletions

View file

@ -104,7 +104,6 @@ RSpec.configure do |config|
end
config.before :each, type: :cli do
stub_stdout
stub_reset_connection_pools
end
@ -163,14 +162,6 @@ def attachment_fixture(name)
Rails.root.join('spec', 'fixtures', 'files', name).open
end
def stub_stdout
# TODO: Is there a bettery way to:
# - Avoid CLI command output being printed out
# - Allow rspec to assert things against STDOUT
# - Avoid disabling stdout for other desirable output (deprecation warnings, for example)
allow($stdout).to receive(:write)
end
def stub_reset_connection_pools
# TODO: Is there a better way to correctly run specs without stubbing this?
# (Avoids reset_connection_pools! in test env)