CruiseControl in your Menu Bar
Now here’s a little gem I’ve been waiting for a long time, and that I just discovered today. Usually i just implemented custom scripts that would check the build status in CruiseControl and use Growl to notify me of build errors. I don’t like having my email client open all the time just to see if the build failed, so this is a god-given.
CCMenu wants to remedy that, and comes along with support for all the CruiseControls out there, sitting in your menu bar, and checking your dashboards for the build status. It also signalizes, if a build is currently running.
Just as you’d expect it to, in good pragmatic automation fashion, it’ll notify via Growl of the build status.
Apparently the tool has been written by ThoughtWorks people, no surprise here. Well done is all I can say. It still has some rough edges, but it’s open source, so no need to complain, just more reasons to dig in.
Been using it with CruiseControl.rb all day, and it’s working neatly.
Rails/Ruby Books Galore
The book market is being swamped with new books. It seems like every day I discover a new announcement for an upcoming book on Ruby or Rails. Let’s see what’s currently in stock, and what’s waiting for us next year.
Mocha and RSpec Don’t Play Nice
Mocking is a great part of RSpec, and from the documentation it looks insanely easy. What had me frustrated on a current project is the fact that the mocks and stubs wouldn’t always do what I’d expect them to do. No errors when methods weren’t invoked, and, the worst part, mocks wouldn’t be cleaned up between examples which resulted in rather weird errors. They only occurred when run as a whole with rake spec
but not when I ran the specs through TextMate.
I was going insane, because noone on the mailing list seemed to have any problems, same for friends working with RSpec. Then I had another look at the RSpec configuration.
Turns out, the reason for all of this is that Mocha was used for mocking. Switching the configuration back to use RSpec’s internal mocking implementation, everything worked like a charme from then on.
So what you want to have in your SpecHelper
isn’t this:
Spec::Runner.configure do |config|
config.mock_with :mocha
end
but rather
Spec::Runner.configure do |config|
config.mock_with :rspec
end
or no mention at all of mock_with
which will result in the default implementation being used which is, you guessed it, RSpec’s own.
Friday Links (14.12.07)
Friday’s tab sweep for a little weekend reading.
CruiseControl.rb and RSpec Play Nice
When using CruiseControl.rb for continuous integration, and RSpec for testing, the defaults of CruiseControl.rb don’t play that nice with RSpec. However, that can be remedied pretty simply.