In which we save time in various ways.
rake isolate[‘day-62’] #
I feel a fool for not knowing about this. To optimize auto-regenerating the blog, it makes sense to temporarily move the other posts to a safe place and iterate as if this were the only one. Then bring back the older posts when it’s time to do the final site generation.
Luckily, Octopress’s Rakefile
automates this as rake isolate[postname]
and rake integrate
.
That should keep me happy for just a bit longer.
Don’t wait for not #
One of my little rules for automated testing is “Don’t wait a fixed time for something to not happen”. If you wait for five seconds, the event you didn’t want will occur at the sixth second. Tests will pass, but the system will fail. Then you wait for ten seconds; then it occurs after eleven seconds. Then you get mad and wait for five minutes. Then your tests are way too slow and don’t get run as often.
This can be a hard rule to follow, especially if the test is “x should never happen”; we can’t just wait forever. But in the case where the test is really “I don’t want x to happen before y”, you should always wait until y rather than a fixed amount of time. So this:
|
|
should become this:
|
|
|
|
So that this:
1 scenario (1 passed)
9 steps (9 passed)
0m28.315s
can become this:
1 scenario (1 passed)
9 steps (9 passed)
0m6.702s
ColorLog? #
The next key in the config file is ColorLog
, but a quick code search shows that only having any
effect in the enigmatic Windows Forms code that I have no idea about or interest in. Moving on…
RequireMakeRecallReagent #
This looks interesting. Recall rings were one of the more useful items in the original game: put it on, do some adventuring, take it off and teleport back to where you put it on. The only catch was that it was one-use. After the teleport, you were holding a simple gold ring. For some it was an emergency-use-only thing; for others, it was the preferred way back to town, loaded down with all of the spoils of combat; for still others, keeping two fingers free meant never having to walk to or from the dungeon.
Because Thieves had a harder time getting around (plenty of Lawful-only areas, and they were Neutral), they could learn a spell to make their own recall rings.
But what does this config option do?
|
|
Ah, the “reagent” is the gold ring. So if this option is set, you need a gold ring in hand to imbue with recall powers. Otherwise the spell fails, exploding something on you unless your hands were empty.
To test this we’ll need the ability to:
- make a thief character
- give him the
makerecall
spell - give him a gold ring
- make him attempt to cast a spell
- check the contents of his hands
Sounds like a lot of fun test code to write. Tomorrow.
Useful Stuff #