Skip to content

Instantly share code, notes, and snippets.

@hunner
Created June 11, 2013 18:52
Show Gist options
  • Select an option

  • Save hunner/5759604 to your computer and use it in GitHub Desktop.

Select an option

Save hunner/5759604 to your computer and use it in GitHub Desktop.
[2] pry(main)> require 'facter'
=> true
[3] pry(main)> Facter.value(:manufacturer)
=> nil
[4] pry(main)> Facter.fact(:manufacturer).stubs(:value).returns("aoeu") ; Facter.value(:manufacturer)
Mocha::StubbingError: stubbing method on nil: nil.value
from (pry):4:in `__pry__'
[5] pry(main)> Facter.add(:manufacturer) do "snth" end ; Facter.fact(:manufacturer).stubs(:value).returns("aoeu") ; Facter.value(:manufacturer)
=> "aoeu"
[6] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment