- Use mockery to inject a mock the require dependency
- Use supertest to make an http request to the server
- Use mocha as test runner
|defmodule Password do|
|Consider a basic password loop|
|it exists with a positive result if the user chooses the right password|
|It exists with a negative result if theuser is wrong three times|
|How would you code this loop|
|def guess(attempts \\ 0)|
|def guess(attempts) when attempts < 3 do|
|guess = IO.gets "Guess: "|
I think StackOverflow was awesome when it started (and several years later still is) but over then it had failed to innovate / grow.
There has been attempts to create products like SO documentation, and SO jobs (and now SO teams) but they are not aligned with what made SO good in the first place. ¿What is the one thing SO was meat to solve in the first place?
This is was Jeff Atwood wrote when it was launched:
Stackoverflow is sort of like the anti-experts-exchange (minus the nausea-inducing sleaze and quasi-legal search engine gaming) meets wikipedia meets programming reddit. It is by programmers, for programmers, with the ultimate intent of collectively increasing the sum total of good programming knowledge in the world. No matter what programming language you use, or what operating system you call home. Better programming is our goal.