Singletons are evil, and here's why.
Fair enough. Yet they exist, and they're not intrinsically evil--just misused. Can we mock enough to make testing them feasible? Yep, and here's a Contrived Example™ that shows how (and why we might want to).
"Embedded" singletons or utility classes can make testing is problematic. Injected singletons are different; then it's an issue of whether or not it
(Because it's like "racetrack", and it makes Rake tasks faster, and... oh, never mind.)
Tired of waiting for Ruby to spin up just so you can run a "routes" command, or your latest "db:migrate"?
Use rake-sh and start up a rake console for running tasks without the initial spin up. It'll take a "rake routes" from four seconds down to under a second. Rake task completion? Naturally. Use "t" for
Tired of waiting for Ruby to spin up just so you can run a "routes" command, or your latest "db:migrate"?
Use rake-sh and start up a rake console for running tasks without the initial spin up. It'll take a "rake routes" from four seconds down to under a second. Rake task completion? Naturally. Use "t" for
Subscribe to:
Comments (Atom)