Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 732245d

Browse files
committed
Merge pull request #178 from rspec/in_sub_process_where_possible
Add `in_sub_process_where_possible`
2 parents 0b23e89 + 805422b commit 732245d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rspec/support/spec/in_sub_process.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,18 @@ def in_sub_process(prevent_warnings=true)
3535

3636
raise exception if exception
3737
end
38+
# rubocop:enable MethodLength
39+
alias :in_sub_process_if_possible :in_sub_process
3840
else
3941
def in_sub_process(*)
4042
skip "This spec requires forking to work properly, " \
4143
"and your platform does not support forking"
4244
end
45+
46+
def in_sub_process_if_possible(*)
47+
yield
48+
end
4349
end
44-
# rubocop:enable MethodLength
4550
end
4651
end
4752
end

0 commit comments

Comments
 (0)