Is the mocking method code really executing

Hi, I am using Mocha for a Rails project. I am new to TDD, so please forgive me if this is a stupid question.

If i have this

@client.expects(:create_config).once.returns(true)

then do I correctly assume that the code in create_config()will not run, and instead only true will be returned true?

+3
source share
2 answers

Mocha is never used, but this is true for all the mocking frameworks I've worked with

+1
source

. , , , , .

0

Source: https://habr.com/ru/post/1734659/


All Articles