Skip to content

Commit b4b8683

Browse files
author
Chris Brown
committed
closes #681
+ Edit GETTING_STARTED.md to remove references to multiple tests since there is only one test in the suite. + Add RUNNING_TESTS.md, which includes instructions for running multiple tests.
1 parent dc572f7 commit b4b8683

File tree

2 files changed

+66
-33
lines changed

2 files changed

+66
-33
lines changed

exercises/hamming/RUNNING_TESTS.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Running Tests
2+
3+
In order to complete this exercise, and all of the subsequent exercises, you
4+
will need to pass multiple tests.
5+
6+
## Understanding Test Results
7+
8+
After you have created and saved `hamming.rb`, run the test suite. You should
9+
see output like the following:
10+
11+
# Running:
12+
13+
SSSSSSESSSSSSSSS
14+
15+
Finished in 0.002593s, 6170.4588 runs/s, 0.0000 assertions/s.
16+
17+
1) Error:
18+
HammingTest#test_identical_strands:
19+
NameError: uninitialized constant HammingTest::Hamming
20+
Did you mean? HammingTest
21+
../hamming/hamming_test.rb:9:in `test_identical_strands'
22+
23+
16 runs, 0 assertions, 0 failures, 1 errors, 15 skips
24+
25+
You have skipped tests. Run with --verbose for details.
26+
27+
28+
The letters `SSSSSSESSSSSSSSS` show that there are sixteen tests altogether,
29+
that one of them has an error (`E`), and that the rest of them are skipped (all
30+
the `S` letters).
31+
32+
The tests are run in randomized order, which will cause the letters to display
33+
in random order as well.
34+
35+
The goal is to have all passing tests, which will show in two places:
36+
37+
1. `SSSSSSESSSSSSSSS` will become a series dots: `................`,
38+
39+
2. The line at the bottom will read `16 runs, 0 assertions, 0 failures, 0
40+
errors, 0 skips`.
41+
42+
## Passing Tests
43+
44+
Write enough code to change the Error to Failure, and finally to Passing.
45+
46+
Open `hamming_test.rb`, and find the word "skip". All but the first test start
47+
with "skip", which tells Minitest to ignore the test. This is so that you don't
48+
have to deal with all the failures at once.
49+
50+
To activate the next test, delete the "skip", or comment it out, and run the
51+
test suite again.
52+
53+
## Wash, Rinse, Repeat
54+
55+
Delete one "skip" at a time, and make each test pass before you move to the
56+
next one.

exercises/hello-world/GETTING_STARTED.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@ On Windows, it will complain about:
3838

3939
On OS X and Linux, the error will be something like:
4040

41+
4142
# Running:
4243

43-
ESS
44+
E
4445

45-
Finished in 0.001539s, 2599.0903 runs/s, 0.0000 assertions/s.
46+
Finished in 0.001328s, 753.0121 runs/s, 0.0000 assertions/s.
4647

47-
1) Error:
48-
HelloWorldTest#test_no_name:
48+
1) Error:
49+
HelloWorldTest#test_say_hi:
4950
NameError: uninitialized constant HelloWorldTest::HelloWorld
50-
hello-world/hello_world_test.rb:20:in `test_no_name'
51-
52-
3 runs, 0 assertions, 0 failures, 1 errors, 2 skips
53-
54-
You have skipped tests. Run with --verbose for details.
51+
Did you mean? HelloWorldTest
52+
hello_world_test.rb:19:in `test_say_hi'
53+
54+
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
55+
5556

5657
Within the first test, we are referencing a constant named `HelloWorld` when
5758
we say `HelloWorld.hello`. When Ruby sees a capitalized name like
@@ -69,19 +70,6 @@ To fix it, open up the hello_world.rb file and add the following code:
6970
class HelloWorld
7071
end
7172

72-
### Understanding Test Failures
73-
74-
Whether you are on Windows, Mac OS X or Linux, you will eventually be faced with
75-
errors and failures that look a lot like the Mac OS X / Linux error above.
76-
77-
The letters `ESS` show that there are three tests altogether,
78-
that one of them has an error (`E`), and that two of them are skipped (`SS`).
79-
80-
The goal is to have three passing tests, which will show as three dots: `...`.
81-
82-
The tests are run in randomized order, which will cause the letters to display
83-
in random order as well.
84-
8573
## Step 3
8674

8775
Run the test again.
@@ -131,17 +119,6 @@ out what went wrong, and then try again.
131119

132120
If it passes, then you're ready to move to the next step.
133121

134-
Open the hello_world_test.rb file, and find the word "skip". All but the first test
135-
start with "skip", which tells Minitest to ignore the test. This is so that
136-
you don't have to deal with all the failures at once.
137-
138-
To activate the next test, delete the "skip", and run the test suite again.
139-
140-
## Wash, Rinse, Repeat
141-
142-
Delete one "skip" at a time, and make each test pass before you move to the
143-
next one.
144-
145122
## Submit
146123

147124
When everything is passing, you can submit your code with the following

0 commit comments

Comments
 (0)