Skip to content

Commit 970ec8c

Browse files
committed
Add related tests
1 parent 84da924 commit 970ec8c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/unit/process_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ class Browser
2121
subject.quit
2222
end
2323
end
24+
25+
context "env variables" do
26+
subject { Browser.new(env: { "LD_PRELOAD" => "some.so" }) }
27+
28+
it "passes through env" do
29+
allow(::Process).to receive(:wait).and_return(nil)
30+
allow(Client).to receive(:new).and_return(double.as_null_object)
31+
32+
allow(::Process).to receive(:spawn).with({ "LD_PRELOAD" => "some.so" }, any_args)
33+
34+
allow_any_instance_of(Process).to receive(:parse_ws_url)
35+
36+
subject.send(:start)
37+
subject.quit
38+
end
39+
end
2440
end
2541
end
2642
end

0 commit comments

Comments
 (0)