ruby - How to mock Rails::configuration -
I am trying to test a class that uses the rail configuration file. I have the railway railway :: configuration I want to joke.
I have tried things
Rail: :: singleton_class.expects (: configuration). Return ('Result') Rail :: singleton_class.stubs (: Configuration). Return ('Result') How can I go about doing this?
rail. Estimate (configuration). Return ('Result') Please note that there was a typo in your example. Return value returns , return
Also note that, Rails.configuration returns Rails.application.config . If your method does not use the Rails.configuration , it can actually block the call and your expectation will not work.
Comments
Post a Comment