Forum: RSpec The TODO note in rspec files can't be shown in "rake notes"

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.
Kai Fu (Guest)
on 2008-12-11 06:38
(Received via mailing list)
Hello,

I've written a "TODO" comment in a xxx_controller_spec.rb. When I run
the
"rake notes" command, it doesn't appear in the output, while other notes
written in the "app" dir are shown correctly.

Could someone tell me how to fix this? Whether I should hack the rails
rake
code?

Thanks!

--
regards,
Kai Fu

Material Science and Engineering
Huazhong University of Science and Technology
Wuhan
E-mail: removed_email_address@domain.invalid
David C. (Guest)
on 2008-12-11 17:03
(Received via mailing list)
On Wed, Dec 10, 2008 at 9:12 PM, Kai Fu <removed_email_address@domain.invalid> 
wrote:
> Hello,
>
> I've written a "TODO" comment in a xxx_controller_spec.rb. When I run the
> "rake notes" command, it doesn't appear in the output, while other notes
> written in the "app" dir are shown correctly.
>
> Could someone tell me how to fix this? Whether I should hack the rails rake
> code?

I imagine you'd have to hack either rails or RSpec code to support
this. I haven't looked.

If you find the solution in RSpec, please feel free to submit a patch
to http://rspec.lighthouseapp.com.

Cheers,
David
steveluscher (Guest)
on 2009-02-10 21:48
(Received via mailing list)
On Dec 10 2008, 7:12 pm, "Kai Fu" <removed_email_address@domain.invalid> wrote:
> Could someone tell me how to fix this? Whether I should hack the rails rake
> code?

I've written about my (hopefully) durable solution to your problem,
here:
http://steveluscher.com/archives/enumerating-annot...

Create a file at lib/tasks/notes.rake:
---
# Override the directories that the
# SourceAnnotationExtractor traverses
# when you call rake notes
class SourceAnnotationExtractor
  def find_with_custom_directories
    find_without_custom_directories(%w(app lib spec features))
  end
  alias_method_chain :find, :custom_directories
end
---

…where %w(app lib spec features) is a list of directories that you
want rake:notes to traverse.

Cheers,
Steven…
This topic is locked and can not be replied to.