diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-03-03 14:43:11 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-03-03 14:43:11 +0100 |
commit | 1dc6bed0ca6ca379f1c4b2e9fc0dee72dbf1e205 (patch) | |
tree | 70562b21afd123c6cabaf4d800415d8ea8232395 /spec/mspec/lib/mspec/utils/script.rb | |
parent | c1790f8c11e4be4010ee9739732053b3c6a08cab (diff) |
Update to ruby/mspec@bd47c2a
Diffstat (limited to 'spec/mspec/lib/mspec/utils/script.rb')
-rw-r--r-- | spec/mspec/lib/mspec/utils/script.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb index a77476ee2e..b9f8b17fdc 100644 --- a/spec/mspec/lib/mspec/utils/script.rb +++ b/spec/mspec/lib/mspec/utils/script.rb @@ -37,6 +37,17 @@ class MSpecScript config[key] end + class << self + attr_accessor :child_process + end + + # True if the current process is the one going to run the specs with `MSpec.process`. + # False for e.g. `mspec` which exec's to `mspec-run`. + # This is useful in .mspec config files. + def self.child_process? + MSpecScript.child_process + end + def initialize check_version! @@ -267,7 +278,9 @@ class MSpecScript # Instantiates an instance and calls the series of methods to # invoke the script. - def self.main + def self.main(child_process = true) + MSpecScript.child_process = child_process + script = new script.load_default script.try_load '~/.mspecrc' |