Ruby Two-sday

Explain what "Big O" is and why we utilize it
Click the card to flip 👆
1 / 13
Terms in this set (13)
Unit tests: isolate and test the functionality of a single class or method (i.e. a single unit of code) - unit tests are very specific and are meant to isolate logical problems within a class

Integration tests are used to test that all the classes interact correctly. - integration tests use real objects instead of mocks - integration tests are larger in scope and are intended to check that objects interact properly
Describe the basic workflow of Test Driven Development1. Red - run the tests after writing them - screens for instances of false positives 2. Green - write minimum amount of code to pass tests 3. Refactor - make sure it's up to par with your company's style guideExplain the use case of a double or mock when writing unit testsA test double (also called a mock) is a fake object that we can use to create the desired isolation in unit tests. A double takes the place of outside, interacting objects, so that we can test objects and methods independently of other objects/methods in our code. A test double (also called a mock) is a fake object that we can use to create the desired isolation in unit tests. A double takes the place of outside, interacting objects, so that we can test objects and methods independently of other objects/methods in our code. This ensures our unit tests are actually testing one thing at a time.Describe the difference between RSpec's describe and context and when you should use eachdescribe is RSpec's unit of organization. It gathers together several it blocks into a single unit You can nest describe blocks arbitrarily deep. context is an alias for describe that can be a bit more descriptive when nesting describe blocks. Prefer context when it makes sense.