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

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: [email protected]

On Wed, Dec 10, 2008 at 9:12 PM, Kai Fu [email protected] 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

On Dec 10 2008, 7:12 pm, “Kai Fu” [email protected] 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-annotations-in-directories-of-your-choosing-with-rakenotes

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…