module TestProf::FactoryAllStub
FactoryAllStub
inject into FactoryBot to make all strategies be `build_stubbed` strategy.
Constants
- LOCAL_NAME
Public Class Methods
disable!()
click to toggle source
# File lib/test_prof/factory_all_stub.rb, line 27 def disable! Thread.current[LOCAL_NAME] = false end
enable!()
click to toggle source
# File lib/test_prof/factory_all_stub.rb, line 23 def enable! Thread.current[LOCAL_NAME] = true end
enabled?()
click to toggle source
# File lib/test_prof/factory_all_stub.rb, line 19 def enabled? Thread.current[LOCAL_NAME] == true end
init()
click to toggle source
# File lib/test_prof/factory_all_stub.rb, line 13 def init # Monkey-patch FactoryBot / FactoryGirl TestProf::FactoryBot::FactoryRunner.prepend(FactoryBotPatch) if defined?(TestProf::FactoryBot) end