-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonday
More file actions
40 lines (20 loc) · 1.2 KB
/
Monday
File metadata and controls
40 lines (20 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1. When is it acceptable to use CamelCase?
- For naming classes, and possibly for constants.
2. When do we use do…end instead of {…}?
- do…end is used for blocks that have several statements spanned over several lines, {…} is used if the block consists of only one statement.
3. In Test::Unit, what is the difference between assert and assert_equal?
- assert_equal tests that two expressions are equal to each other, while assert tests if the the test case has a true value.
4. Where do we put code that needs to be run before or after each test?
- Depends…?
5. When we use setup, why do we need to use instance variables?
- So we can use them across different test methods.
6. How do you run all the specs in a folder?
- By supplying the path to the folder and running spec .
7. What is a stub?
- A stand-in class with the same methods as the real class.
8. What is a mock?
- sort of a stub v2.0?
9. Why do we make sure that our tests are red before fixing them?
- So that we know that they can fail, and then we write code that shall pass.
10. If your company won't allow full tests, what does it mean to "exercise your code, even just a little bit."
- Write smaller unit test, whatever you can.