@@ -23,6 +23,24 @@ def test_indexing_context_files
2323 end
2424 end
2525
26+ def test_indexing_ruby_file_extensions
27+ with_context do |context |
28+ context . write! ( "foo.rb" , "class Foo; end" )
29+ context . write! ( "task.rake" , "class Task; end" )
30+ context . write! ( "config.ru" , "class Config; end" )
31+ context . write! ( "notes.txt" , "class Notes; end" )
32+
33+ graph = Rubydex ::Graph . new
34+ assert_empty ( graph . index_all ( [ context . absolute_path ] ) )
35+ graph . resolve
36+
37+ refute_nil ( graph [ "Foo" ] )
38+ refute_nil ( graph [ "Task" ] )
39+ refute_nil ( graph [ "Config" ] )
40+ assert_nil ( graph [ "Notes" ] )
41+ end
42+ end
43+
2644 def test_indexing_invalid_file_paths
2745 graph = Rubydex ::Graph . new
2846
@@ -601,6 +619,9 @@ def test_workspace_paths
601619 context . write! ( ".git/config" , "" )
602620 context . write! ( "node_modules/pkg/index.js" , "" )
603621 context . write! ( "top_level.rb" , "class TopLevel; end" )
622+ context . write! ( "top_level.rake" , "class TopLevelRake; end" )
623+ context . write! ( "top_level.rbs" , "class TopLevelRbs; end" )
624+ context . write! ( "config.ru" , "class ConfigRu; end" )
604625
605626 graph = Rubydex ::Graph . new ( workspace_path : context . absolute_path )
606627 paths = graph . workspace_paths
@@ -615,6 +636,9 @@ def test_workspace_paths
615636
616637 # Includes the top level files
617638 assert_includes ( paths , context . absolute_path_to ( "top_level.rb" ) )
639+ assert_includes ( paths , context . absolute_path_to ( "top_level.rake" ) )
640+ assert_includes ( paths , context . absolute_path_to ( "top_level.rbs" ) )
641+ assert_includes ( paths , context . absolute_path_to ( "config.ru" ) )
618642
619643 # Includes gem dependency paths from Bundler
620644 gem_require_paths = Bundler . locked_gems . specs . flat_map do |lazy_spec |
0 commit comments