Class: Simp::RspecPuppetFacts::Shim
- Inherits:
-
Object
- Object
- Simp::RspecPuppetFacts::Shim
- Extended by:
- RspecPuppetFacts
- Defined in:
- lib/simp/rspec-puppet-facts.rb
Overview
Shim to rspec-puppet-facts methods
Class Method Summary collapse
-
.on_supported_os(opts = {}) ⇒ Object
extend ::RspecPuppetFactsabove is not enough to guarantee thatShim.on_supported_osreaches the upstream implementation: if a spec_helper has already done a top-levelinclude RspecPuppetFacts(voxpupuli-test does this), the module is already in Object's ancestry and theextendis silently skipped.
Class Method Details
.on_supported_os(opts = {}) ⇒ Object
extend ::RspecPuppetFacts above is not enough to guarantee that
Shim.on_supported_os reaches the upstream implementation: if a
spec_helper has already done a top-level include RspecPuppetFacts
(voxpupuli-test does this), the module is already in Object's ancestry
and the extend is silently skipped. A later top-level
include Simp::RspecPuppetFacts then shadows the upstream method, so
Shim.on_supported_os would dispatch back to
Simp::RspecPuppetFacts#on_supported_os and recurse without bound,
exhausting all memory during fact loading (issue #86). Bind the
upstream method explicitly so dispatch can never be shadowed.
251 252 253 |
# File 'lib/simp/rspec-puppet-facts.rb', line 251 def self.on_supported_os(opts = {}) ::RspecPuppetFacts.instance_method(:on_supported_os).bind_call(self, opts) end |