Interesting Things
- An upgrade to Rails 3.0.4 broke RSpec’s
=~Array matcher (which disregards ordering). Oddly, there are times when==(which respects ordering) passes but=~fails. - Check out the Trove Hack Day. Trove lets you access photos from a variety of sites through one API.
- We’re excited about the new Palm webOS App Framework, Enyo.
Ask for Help
“We’re deploying green builds directly to production. But the
dependoption isn’t working on the CI box. Any ideas?”
Run capistrano with trace to get reports on which dependencies are or are not being used.
Here’s our short-term workaround for the broken Rails 3.0.4 matcher. Obviously the failure messages aren’t as good, but if you need a quick and dirty matcher to keep going with…
## WORKAROUND REPLACEMENT FOR =~ TO FIX BUG INTRODUCED IN RAILS 3.0.4
RSpec::Matchers.define :equal_twiddle do |expected|
match do |actual|
actual.length == expected.length &&
actual.all? {|individual_item| expected.include?(individual_item)}
end
end
February 16, 2011 at 10:22 am
Here’s a more-readable version of that code:
RSpec::Matchers.define :equal_twiddle do |expected|
match do |actual|
actual.length == expected.length &&
actual.all? {|individual_item| expected.include?(individual_item)}
end
end
February 16, 2011 at 10:25 am