I am in a plain ruby project and I have this mock:
let(:mock_binance_client) { instance_double(Binance::Client::REST, time: {"serverTime": 1594138489530}) }
which says that when time is called it should return a hash with a string key. However, in my actual code this happens:
def time
print @client.time
Time.at(@client.time["serverTime"] / 1000).strftime(FORMAT_DATE_WITH_MILLISECONDS)
end
$ rspec
{:serverTime=>1594138489530}F
What is going on? How do I prevent this from happening? Or what can I do to get around this issue?