A very smart Textmate tip from my colleage, Chris
Look, no more scrabbling with the mysql console:

That he hacked it together on the train is even more impressive. Taking the ruby on rails on rails thing too far, I think.
Ben Griffiths' weblog
July 17th, 2006 — rails, textmate
A very smart Textmate tip from my colleage, Chris
Look, no more scrabbling with the mysql console:

That he hacked it together on the train is even more impressive. Taking the ruby on rails on rails thing too far, I think.
July 16th, 2006 — mocha, mocking, tdd
James Mead has released his Mocha stubbing and mocking framework for Ruby up on rubyforge.
From the README:
Mocha is a library for mocking and stubbing within tests using a syntax like that of JMock and SchMock.Mocha comes in three parts:
1. Mocha – traditional mock objects with expectations and verification
2. Stubba – allows mocking and stubbing of methods on real (non-mock) classes
3. AutoMocha – magically provides mocks in the place of undefined classesStubba and AutoMocha are the main difference between this mocking library and others like FlexMock and RSpec.
It’s a smart bit of coding, and has good examples of meta-programming and fluent interfaces.
You can do cool things like this (but this just scratches the surface):
class StubbingLibrary
def initialize(developers)
@developers = developers
end
def release!
@developers.each {|dev| dev.heap("praise","thanks")}
end
end
class StubbingLibraryTest
def test_should_heap_james_with_praise
james = Developer.new
james.expects(:heap).with("praise","thanks").at_least_once
mocha = StubbingLibrary.new([james])
mocha.release!
james.verify
end
end
I recommend you get it and read the README for yourselves – it has Star Trek examples, if you weren’t already convinced…