October 2009
1 post
rspec, errors, and idiocy
Just spent ten minutes writing a test that should’ve taken thirty seconds. The final test looks like this: it "should throw an Already Running error if there is already a server running" do some_thing.should_receive(:some_method).and_raise(RuntimeError.new('no error')) lambda { some_thing.that_triggers_the_error() }.should raise_error(RuntimeError, "some...
Oct 31st