[rspec-users] rspec_on_rails' spec:doc and dry runs

Phil O Despotos philodespotos at gmail.com
Tue May 22 11:13:03 EDT 2007

In rspec_on_rails, the spec:doc task uses --dry-run, which doesn't
jive well with rspec's ability to write docs for you.

For example, I use the rspec_expectation_matchers plugin from
spicycode.com (scanned for a name, didn't find one =), and end up
writing specs like:

    it { @ticket.should validate_presence_of(:name) }

Which results in specdocs such as:

  - NO NAME (Because of --dry-run)
  - NO NAME (Because of --dry-run)
  - NO NAME (Because of --dry-run)

The examples_specdoc task for rspec itself, however, doesn't use --dry-run.

Using dry runs presumably speeds things up significantly, but results
in "broken" docs when using one of rspec's handiest features. Should
this be considered proper default behavior?

Replacing the task is easy enough, so there's a good case for dry runs
being the default behavior. I'm just curious.


More information about the rspec-users mailing list