Closed BecaLParker closed 3 years ago
For overriding random weather behaviour, please read the documentation to learn how to use test doubles: https://www.relishapp.com/rspec/rspec-mocks/docs . There’s an example of using a test double to test a die that’s relevant to testing random weather in the test.
weather mostly == sunny weather only occasionally == stormy
"The planes can land and take off provided that the weather is sunny. Occasionally it may be stormy, in which case no planes can land or take off.
"You will need to use a random number generator to set the weather (it is normally sunny but on rare occasions it may be stormy). In your tests, you'll need to use a stub to override random weather to ensure consistent test behaviour."