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

David Chelimsky dchelimsky at gmail.com
Tue May 22 11:40:05 EDT 2007


On 5/22/07, Phil O Despotos <philodespotos at gmail.com> wrote:
> 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:
>
>   Ticket
>   - NO NAME (Because of --dry-run)
>   - NO NAME (Because of --dry-run)
>   - NO NAME (Because of --dry-run)

Self-generated example names were a feature request that got added
much more recently than --dry-run, and the two can't really work
together. Self-generated names rely on executing the examples and
--dry-run does not actually execute examples. As far as I'm concerned,
--dry-run has almost no value, so I'd actually like to see it
abolished.

2 cents from the peanut gallery.

Cheers,
David

>
> 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.
>
> Kyle
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list