Sha256: fc2bd8a3d87f7f9f5ead76ecfa66331293627663dee38090e5e79183d04708cd
Contents?: true
Size: 620 Bytes
Versions: 7
Compression:
Stored size: 620 Bytes
Contents
require "fauxhai" require "omnibus/ohai" module Omnibus module RSpec module OhaiHelpers # # Stub Ohai with the given data. # def stub_ohai(options = {}, &block) ohai = Mash.from_hash(Fauxhai.mock(options, &block).data) allow(Ohai).to receive(:ohai).and_return(ohai) # If we asked for Windows, we should also specify that magical # +File::ALT_SEPARATOR+ variable if options[:platform] && options[:platform] == "windows" stub_const("File::ALT_SEPARATOR", '\\') # rubocop:disable Style/StringLiterals end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems