Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run rspec inside rspec-mode?

Tags:

emacs

rspec

I have a directory with files like this

.
├── example.rb
└── example_spec.rb

And my init.el :

(require 'rspec-mode)
(setq-default rspec-use-rvm t)

(require 'rvm)
(rvm-use-default)

When I try to run any of the verify functions inside the example_spec.rb will result the error :

rspec-project-root: Could not determine the project root.

How do I make rspec-mode able to determine the project root and run rspec ?

like image 744
Rangi Lin Avatar asked Feb 02 '26 18:02

Rangi Lin


1 Answers

Looking at docstring of rspec-project-root it seems it looks for Rakefile in the presenst directory or a parent directory. Here is the docstring

Finds the root directory of the project by walking the directory tree until it 
finds a rake file.

The code suggests that a gem file will also do.