#412 √ resolved
Yi Wen

Printout

Reported by Yi Wen | May 27th, 2008 @ 05:08 PM | in 1.1.5

After upgrading to 1.1.4, I got printout like below:

Spec::Rails::Example::RailsExampleGroup

Spec::Rails::Example::ModelExampleGroup

Spec::Rails::Example::FunctionalExampleGroup

Spec::Rails::Example::ControllerExampleGroup

Spec::Rails::Example::HelperExampleGroup

Spec::Rails::Example::ViewExampleGroup

every time I ran a spec with -fs and -fh options. Without them, there is no printout.

It is printed from SpecdocFormatter.add_example_group

Yi

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky May 28th, 2008 @ 07:30 AM

    • → Assigned user changed from “” to “David Chelimsky”
    • → Milestone changed from “No-Milestone-Assigned” to “1.1.5”

    Eeek. That's truly annoying. Thanks for pointing it out.

  • James Cox

    James Cox June 1st, 2008 @ 10:11 PM

    I've done some work on this -

    http://github.com/imajes/rspec/t...

    I've fixed the problem, however this has changed behavior - which broke specs. I've changed the specs, it passes, but my concern is whether or not the behavior should have been broken - or whether it was broken already. :)

    -james

  • David Chelimsky

    David Chelimsky June 15th, 2008 @ 03:57 PM

    Hey James - I looked at the patch and it doesn't completely fix the problem yet.

    I see an easy fix that actually fixes the problem, but it introduces a change in behaviour. Here's the patch:

    diff --git a/lib/spec/runner/reporter.rb b/lib/spec/runner/reporter.rb
    index 66db384..0096a7e 100644
    --- a/lib/spec/runner/reporter.rb
    +++ b/lib/spec/runner/reporter.rb
    @@ -10,6 +10,7 @@ module Spec
           end
           
           def add_example_group(example_group)
    +        return nil if example_group.send(:examples_to_run).empty?
             formatters.each do |f|
               f.add_example_group(example_group)
             end
    

    The change in behaviour is that no groups will report themselves unless they have examples in them to run. This might be a good thing, but in process, as you're getting started, you might start w/ an empty example group just to see that there's something there, but you won't see it reported.

    I'd like some feedback on that.

  • David Chelimsky

    David Chelimsky June 15th, 2008 @ 06:16 PM

    (from [4905ace22d4579b0851c2d3fe02e36bedb12571e]) don't report example groups with no examples [#412 status:resolved]

    http://github.com/dchelimsky/rsp...

  • David Chelimsky

    David Chelimsky June 15th, 2008 @ 06:17 PM

    • → State changed from “new” to “resolved”

    I went ahead and fixed this a different way:

    http://github.com/dchelimsky/rsp...

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket

Tags