Skip to content

Commit

Permalink
Change to exlude tests if fork is not implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Apr 21, 2019
1 parent 673581e commit 38723a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/unit/execution_time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@
expect(described_class).to have_received(:run_in_subprocess).twice
end

it "doesn't run in subproces when option :run_in_subprocess is set to false" do
it "doesn't run in subproces when option :run_in_subprocess is set to false",
unless: ::Process.respond_to?(:fork) do

allow(::Process).to receive(:fork)

described_class.run(subprocess: false) { 'x' * 1024 }

expect(::Process).to_not have_received(:fork)
end

it "doesn't run in subprocess when RUN_IN_SUBPROCESS env var is set to false" do
it "doesn't run in subprocess when RUN_IN_SUBPROCESS env var is set to false",
unless: ::Process.respond_to?(:fork) do

allow(::Process).to receive(:fork)
allow(ENV).to receive(:[]).with("RUN_IN_SUBPROCESS").and_return('false')

Expand Down

0 comments on commit 38723a5

Please sign in to comment.