Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build a complete mock OS object (#206)
InSpec expects there to be four parameters on every OS object: name, release, family, and arch. When the mock backend is used, only "family" is ever populated. When evaluating blocks, such as an only_if block, when the mock backend is used, errors will be encountered if someone tries to do something like: os.name.include?('something') ... because `os.name` will be nil during an inspec check, for example. This change properly populates all four expected parameters of the OS whenever the mock backend is used. The `mock_os` method still allows for one-off setting of the value as needed for unit tests, but it's now merged with the default four values. Signed-off-by: Adam Leff <adam@leff.co>
- Loading branch information