About
Buy my book
Exceptional Ruby is the definitive guide to exceptions and failure handling in Ruby.
Pages
Categories
Tag Archives: testing
Testing that a block is called
CapnKernul asks: Hey Avdi. How would you test that a method’s provided block is called in RSpec? Would you stub #to_proc (for &block) and mock #call? Typically the way I test that a block is called goes something like this: … Continue reading
Making a Mockery of TDD
I made this gnomic remark on Twitter the other day: To be a successful mockist, you must dislike mocks. A lot of people re-tweeted it, so I guess I’m not completely alone in thinking this way. I should back up … Continue reading
Software Superstitions
If we are not honest about the causes of a bad situation, we pose a significant danger to those who are either less-experienced or uncertain about their own situation. Take a slow test suite, for example. Having a test suite … Continue reading
Demeter: It’s not just a good idea. It’s the law.
Is #try really so bad? In response to my recent post about #try being a code smell, a lot of people made the reasonable objection that the example I used—of using #try on a a Hash—was a pathological case. A … Continue reading
Posted in Ruby
Tagged bdd, coupling, demeter, design, law of demeter, objects, oo, oop, ruby, Ruby on Rails, structural coupling, tdd, testing
67 Comments
Linkdump #8
Scriptensity: Emscripten 1.0! This is the first I’ve heard of this project: it’s an LLVM-to-Javascript compiler. Which means you can (for instance) compile C++ to Javascript. I can’t decide if this is amazing or just batshit insane. Probably both. tags: … Continue reading
Posted in Links
Tagged http, javascript, llvm, ruby, spdy, static analysis, tcp, tdd, test-unit, testing, yield
Leave a comment
Linkdump #7
Hacker Chat: Pinboard Creator Maciej Ceglowski Talks About Why Boring Architecture is Good, and More Wise words. tags: development I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time … Continue reading
Posted in Links
Tagged architecture, bdd, java, javascript, literate programming, logging, nodejs, rails, rspec, ruby, tdd, testing
Leave a comment
RSpec is for the literate
A couple years ago I wrote a library called AlterEgo. It’s an implementation of the State Pattern for Ruby. I consider the library to be retired at this point—other libraries, such as State Machine and ActiveModel, have since incorporated all … Continue reading
Roy Osherove on Test Construction
It’s quite easy to get caught up in the technique of TDD and not pay attention to the way unit tests are written: their naming, how maintainable or readable they are, and whether they test the right things or might … Continue reading
Looking for a new NullDB maintainer
I love Open Source. NullDB, a weekend hack that I barely touched after its first version, continues to attract periodic forks and patches. For a long time I’ve been meaning to sit down and roll in all the contributions that … Continue reading
Posted in Uncategorized
Tagged activerecord, datamapper, floss, nulldb, oss, ruby, testing
Leave a comment
