Look at https://github.com/rails/rails/commit/1408b942d9c2c131a1cdcab97f49d74ce84dae38
I thought mocking meant you can mock any method. Did not know that methods that are implemented in C can’t be mocked. Why?
I guess that means I don’t really understand how mocking works.
This has nothing to do with mocking methods in C and is only about method dependecy.
If you read attentively, the commit states that mocking
Time.nowno longer has an impact onDate.today.In Ruby 1.8.7,
Date.todaywas implemented in Ruby and was callingTime.now. In newer Ruby,Date.todayis in C and does not callTime.now.