From a5ce8818d29a367ac2a80eeeae649486e1158206 Mon Sep 17 00:00:00 2001 From: John Meehan Date: Tue, 5 Jul 2016 01:10:24 +0100 Subject: Allow rake notes to work with other directories. Additional directories can be added using SourceAnnotationExtractor::Annotation.register_directories("spec", "other_dir") Result: rake notes will now extract notes from these directories. --- railties/test/application/rake/notes_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'railties/test') diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb index 50def9beb0..71b7480f64 100644 --- a/railties/test/application/rake/notes_test.rb +++ b/railties/test/application/rake/notes_test.rb @@ -126,6 +126,19 @@ module ApplicationTests end end + test 'register additional directories' do + app_file "app/spec/spec_helper.rb", "# TODO: note in spec" + app_file "app/spec/models/user_spec.rb", "# TODO: note in model spec" + add_to_config %q{ config.annotations.register_directories("spec") } + + + run_rake_notes do |output, lines| + assert_match(/note in spec/, output) + assert_match(/note in model spec/, output) + assert_equal 2, lines.size + end + end + private def run_rake_notes(command = 'bin/rails notes') -- cgit v1.2.3