projectile
guesses the name of the test file specified by the source file by adding a suffix / prefix to the source file. For example, if you have hello.rb
, then it tries to find a file called hello_test.rb
in your project.
By default, it has some rules that map to the type of project for checking the suffix / prefix. Here is the actual code:
(defun projectile-test-suffix (project-type) "Find default test files suffix based on PROJECT-TYPE." (cond ((member project-type '(rails-rspec ruby-rspec)) "_spec") ((member project-type '(rails-test ruby-test lein-test go)) "_test") ((member project-type '(scons)) "test") ((member project-type '(maven symfony)) "Test") ((member project-type '(gradle grails)) "Spec")))
If you do not see anything in projectile-find-test-file
, it means that most likely it cannot find anything related to your source file by adding a suffix / prefix.
This can be configured using projectile-test-suffix-function
. By default, a variable points to the function above, but you can override it with your own rules.
Yiman source share