Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Charles Hansen

Posts By

LABS
Testing JavaScript Promises

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 and events.

Read more »

LABS
Swapping between JavaScript spec and implementation in RubyMine

When test driving your code, you inevitably end up switching between the tests and the implementation.  In Rubymine, there is a handy command-shift-T shortcut for doing this with ruby files, but it does not work for javascript files.  It isn’t too hard to add javascript functionality.  

Read more »

LABS
Keeping the Console Clean in Jasmine

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 fail to run at all to accidentally checked-in console logs.

Read more »

LABS
When pairing doesn't transfer knowledge fast enough

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 on a 6 pair project with a ~15 developer-year code base and felt a lot of pain with poor knowledge transfer during that time.  

Read more »

LABS
Why we don't use OOCSS (but we should)

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 most painful part of our UI with components over the next week.  

Read more »

LABS
Launching Focused Jasmine Specs From RubyMine

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 using sed to parse the first line of your spec file, so this actually only runs the describe block at the top of your file.  

Read more »

PIVOTAL LABS
Standup 11/29/12: Time.now, more like Time.at(2011)

Helps

mock object nil when it shouldn't be

(rdb:1) @registration

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?

Interestings

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/

PIVOTAL LABS
Standup 11/28/12: Mohawk Day!

Helps

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

  • Crickets

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.

PIVOTAL LABS
Standup 11/26/12

Interestings

dotenv Gem

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. .env.test

https://github.com/bkeepers/dotenv

LABS
Hunting Memory Leaks in Backbone

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.