Skip to content

A platform for community discussion. Free, open, simple.

Suppres task spec output using capture_stdout

Martin Brennanb0f4149d6eef
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 23f6e830faf..e2e278bb91e 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -138,10 +138,6 @@ module Helpers
$stdout = old_stdout
end
- def disable_puts_stdout
- IO.any_instance.stubs(:puts)
- end
-
def set_subfolder(f)
global_setting :relative_url_root, f
old_root = ActionController::Base.config.relative_url_root
diff --git a/spec/tasks/uploads_spec.rb b/spec/tasks/uploads_spec.rb
index 65de71e1b33..944c78b5a08 100644
--- a/spec/tasks/uploads_spec.rb
+++ b/spec/tasks/uploads_spec.rb
@@ -6,7 +6,6 @@ RSpec.describe "tasks/uploads" do
before do
Rake::Task.clear
Discourse::Application.load_tasks
- disable_puts_stdout
end
describe "uploads:ensure_correct_acl" do
@@ -33,7 +32,9 @@ RSpec.describe "tasks/uploads" do
end
def invoke_task
- Rake::Task['uploads:ensure_correct_acl'].invoke
+ capture_stdout do
+ Rake::Task['uploads:ensure_correct_acl'].invoke
+ end
end
context "when the store is internal" do