Tag Archives: testing

RubyTapas Freebie – Gem-Love Part 3

Sometimes on RubyTapas I serialize larger projects into bite-sized pieces. In this episode, you can see a slice of the outside-in TDD process I use as I develop part of my gem-love project. You’ll see me thinking about messages before … Continue reading

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , , , , | Leave a comment

RubyTapas Freebie: The End of Mocking

At the borders of our systems, mockist testing hits a point of diminishing returns. In this free episode we take a look at when to stop mocking and start integration testing.

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , , , , | Leave a comment

RubyTapas Freebie: Gem Love Part 2

I have a few ongoing miniseries in RubyTapas. In this, the second installment of a miniseries chronicling the creation of a Rubygems plugin and an associated server, I touch on a number of topics including acceptance testing, the shellwords standard … Continue reading

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , , , | Leave a comment

Configuring database_cleaner with Rails, RSpec, Capybara, and Selenium

How I avoid finding myself in database bizarro world while testing Rails apps. Continue reading

Posted in Rails, Ruby | Tagged , , , , , | 35 Comments

New maintainer needed for NullDB

NullDB, for those who don’t know, is a null backend for ActiveRecord. Unlike RSpec’s stub_object, rather than raise an exception on DB access, will NullDB DB interactions simply become no-ops. This is handy for things like testing after_save hooks in … Continue reading

Posted in Announcements | Tagged , , , , | Leave a comment

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

Posted in Ruby | Tagged , , | 9 Comments

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

Posted in Uncategorized | Tagged , , , , , , , , , , | 15 Comments

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

Posted in Rants | Tagged , , | Leave a comment

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 , , , , , , , , , , , , | 73 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 , , , , , , , , , , | Leave a comment