Skip to content

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

DEV: Stub stderr instead of manual change (#21511)

Jarek Radoszf9db5d5ea661
diff --git a/spec/lib/stylesheet/manager_spec.rb b/spec/lib/stylesheet/manager_spec.rb
index 0442cd69dc8..5c00f4e6742 100644
--- a/spec/lib/stylesheet/manager_spec.rb
+++ b/spec/lib/stylesheet/manager_spec.rb
@@ -878,20 +878,10 @@ RSpec.describe Stylesheet::Manager do
end
describe ".precompile css" do
- before do
- class << STDERR
- alias_method :orig_write, :write
- def write(x)
- end
- end
- end
+ before { STDERR.stubs(:write) }
after do
- class << STDERR
- def write(x)
- orig_write(x)
- end
- end
+ STDERR.unstub(:write)
FileUtils.rm_rf("tmp/stylesheet-cache")
end