Matt Scilipoti home

a facet of Facets

29 Jul 2009 – Bethesda, MD

I just updated to Rails 2.3.3 and my controllers screamed:

undefined local variable or method `set_test_assigns' for #<ActionController::TestResponse:0xb5d0b488>
/home/matt/.gem/ruby/1.8/gems/facets-2.5.2/lib/core/facets/kernel/tap.rb:9:in `instance_eval'
/home/matt/.gem/ruby/1.8/gems/facets-2.5.2/lib/core/facets/kernel/tap.rb:9:in `tap'
/home/matt/develop/clients/nih/mpr.ror/trunk/spec/controllers/about_controller_spec.rb:11:

Turns out Facets #tap is stomping on another #tap.

Enter facet library loading.

Instead of loading the entire Facets library, load what you need.
I knew this. You knew this. It was just convenient to ignore it.
I’m using Facets for ergo. That’s it. No need for the kitchen sink.

Replace:

config.gem 'facets', :version => '=2.5.2'

With:

config.gem 'facets', :version => '=2.5.2', :lib => 'facets/kernel/ergo'

Done. Error averted. Tiny library loaded.

Now… what about specs?

I prefer to write a failing spec that identifies a “bug” and then write code to make it pass.
This issue broke many existing specs, so I feel that I am covered.
Still… it would be nice to have something which identifies this particular issue AND the fix for it.

Update (07/29/2009): funky formatting.

Update (07/30/2009): using div as workaround.

I see the code format isn’t quite right. It works locally (using `jekyll —pygments —auto —server`).
Here’s a screenshot:
Formatted code screenshot
Argh.

Maybe these guys can help: github support ticket

Fork me on GitHub