tldr: Testing promises is surprisingly hard. I wrote a mock-promises to address it.
A recent project of mine included a single page Marionette app that used promises around the requests for model data. Promises are a useful alternative to callbacks … Read more
I like running Jasmine with the console open. It gives you insight into various errors that you may not have tests around but may still show up in the console messages. It can detect anything from poorly written tests that … Read more
Pairing is great for knowledge transfer. With a reasonably sized 3 pair project, you can completely avoid code reviews, training sessions, tutorials, or any other means of teaching a developer how something works. I had a good amount of time … Read more
I recently had the opportunity to pair with Nicole Sullivan (of OOCSS fame) for a few days on my current project. I learned as much as I could about css components in the three days available and then rebuilt the … Read more
RubyMine is great for launching focused rspec tests, but is a little trickier for launching Jasmine specs, but we have had it working on my current project using a shell script and RubyMine external tools . The script relies on … Read more
mock object nil when it shouldn't be
RSpec::Mocks::Mock:0x3fda7eabfd68 @name="mocked registration"
(rdb:1) @registration.present? false (rdb:1) @registration.nil? false
- mock objects don't always define nil? or present?
David Chelimsky handing off rspec
David Chelmisky is stepping down as the RSpec lead after 6+ years. http://blog.davidchelimsky.net/2012/11/28/myron-marston-and-andy-lindeman-are-rspecs-new-project-leads/
Request log output in controller specs
We are getting info level log out put when running our specs from the controller examples. I don't know how they are getting turned on nor how to turn them off
default host when using url helpers in regular classes
How do most projects handle the default host for url helpers when the helper is being included in presentation classes etc?
- Pass your controller to your presenter and ask the controller for url helpers
making rspec2 custom example groups
any one know how to define custom example groups in rspec and associate them with specs in a given folder.
Have you tried this gem? It kind of rocks it. Works great with a Heroku development environment. It even has files for different Rails modes, e.g.
Ever notice your backbone app slows down considerably after using it for a few minutes? Or maybe your event callbacks are called more than once each time the event fires? Or my favorite, Chrome runs out of memory if you have a few tabs open that have run your entire Jasmine suite? This means you have backbone leaks.
I just spent the last week hunting these down in a very large app. It turns out the problem is tractable with a few guidelines. None of this is ground-breaking, but I wanted to put it all in one place.
1) The object retaining tree in the Chrome heap profiler is amazing. Use it.