Forum: RSpec Running an entire #describe block

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nick H. (Guest)
on 2008-11-10 20:55
(Received via mailing list)
I know that it's possible to run a single spec example (IE: #it block)
with the -e option for script/spec . Is it possible to run an entire
context (IE: #describe block)?

Cheers,
Nick
Mark W. (Guest)
on 2008-11-10 21:08
(Received via mailing list)
On Mon, Nov 10, 2008 at 10:53 AM, Nick H. <removed_email_address@domain.invalid>
wrote:

> I know that it's possible to run a single spec example (IE: #it block) with
> the -e option for script/spec . Is it possible to run an entire context (IE:
> #describe block)?
>

Use the -l option to specify the line number of the describe call.

///ark
Nick H. (Guest)
on 2008-11-10 23:28
(Received via mailing list)
On 2008-11-10, at 14:06, Mark W. wrote:
> On Mon, Nov 10, 2008 at 10:53 AM, Nick H. <removed_email_address@domain.invalid>
> wrote:
> I know that it's possible to run a single spec example (IE: #it
> block) with the -e option for script/spec . Is it possible to run an
> entire context (IE: #describe block)?
>
> Use the -l option to specify the line number of the describe call.
>
> ///ark

Hi Mark. I've tried -l (that's a lower-case "L"), but it never
executes any specs. Am I using it wrong?:
http://pastie.org/311721

Thanks,
Nick
Mark W. (Guest)
on 2008-11-11 00:14
(Received via mailing list)
On Mon, Nov 10, 2008 at 1:26 PM, Nick H. <removed_email_address@domain.invalid>
wrote:

>> ///ark
>>
>
> Hi Mark. I've tried -l (that's a lower-case "L"), but it never executes any
> specs. Am I using it wrong?:
> http://pastie.org/311721
>

I have to admit that I don't use -l to run a describe block very often,
but
it does seem to work when I do. However, after playing around a bit, I
found
that -l works on the innermost block, but not on enclosing blocks (0
examples), which matches what you're seeing. So I guess it only works
with
the innermost block. Rats.

///ark
Nick H. (Guest)
on 2008-11-11 00:56
(Received via mailing list)
On 2008-11-10, at 17:12, Mark W. wrote:
>
> So I guess it only works with the innermost block. Rats.
Thanks for trying that out for me, Mark. The -l option does in fact
work for me when I specify the line number for an inner-most
#desrcibe . One of these days when I upgrade to the latest version of
rspec, I'll log a ticket in Lighthouse.
-Nick
This topic is locked and can not be replied to.