Sha256: fb09fd46b22a95984556823a8d00de55085d19669aa5c5902420b963af0f83b8
Contents?: true
Size: 581 Bytes
Versions: 10
Compression:
Stored size: 581 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', '\\') end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems