Yes, by the time the script runs, ideally all your classes will be real. The script implements the behavior from the point of view of the user, so the system should look like the user sees it.
In the early days of BDD, we used to start with layouts in scripts. I don’t worry about this anymore, because it’s a lot of work to constantly taunt you. Instead, I will sometimes do things like data or the behavior of hard code if it allows me to get feedback from interested parties faster.
We still keep layouts in unit tests.
For things like databases, you can use the built-in database or something else to help you get feedback faster. At some point, you should probably run your scripts on a system as close to production as possible. If it is too slow, you can do it in one night, and not as part of a normal build cycle.
As for what you have to do, writing the right code is much more difficult than writing code. I worry about using my scripts to get feedback from interested parties and users before I worry about how close my environment is to the production environment. When you get to the point that changes take place every two weeks, of course, then you probably need more confidence that you are not introducing any errors.
Good luck
Lunivore
source share