Skip to content

Commit 00b3ea4

Browse files
Fix RSpec/ExpectOutput violations by removing global stream reassignment
Remove the around hook that was mutating $stdout/$stderr, which triggered RuboCop's RSpec/ExpectOutput warnings. Tests that need to capture output already use RSpec's .to output(...).to_stderr matcher correctly. Co-authored-by: Abanoub Ghadban <AbanoubGhadban@users.noreply.github.com>
1 parent b778a93 commit 00b3ea4

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

spec/react_on_rails/dev/process_manager_spec.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@
44
require "react_on_rails/dev/process_manager"
55

66
RSpec.describe ReactOnRails::Dev::ProcessManager do
7-
# Suppress stdout/stderr during tests
8-
around do |example|
9-
original_stderr = $stderr
10-
original_stdout = $stdout
11-
null_stderr = File.open(File::NULL, "w")
12-
null_stdout = File.open(File::NULL, "w")
13-
14-
begin
15-
$stderr = null_stderr
16-
$stdout = null_stdout
17-
example.run
18-
ensure
19-
$stderr = original_stderr
20-
$stdout = original_stdout
21-
null_stderr.close
22-
null_stdout.close
23-
end
24-
end
257

268
describe ".installed?" do
279
it "returns true when process is available in current context" do

0 commit comments

Comments
 (0)