Closed kevinjalbert closed 9 years ago
I asked for some of my friends, and none of them use their editor in another folder than the project root. Neither me.
What you can do is use binstubs on your rails project, and then change your g:neoterm_rspec_lib_cmd
to something like g:neoterm_rspec_lib_cmd="$MY_PROJECT_PATH/bin/rspec"
, and it should work.
@kassio so I figured out that when using vim-startify if I immediately select a file directly even if I'm in the root of the project, it'll change my working directory to that of the file regardless. This is where I was seeing issues on how neoterm was always running from the file's location.
Knowing that issue, I can work around it so that my working directory is always the root (which is normally where I start my editor session.
Just curious, but I see that you are suggesting the use of the $MY_PROJECT_PATH
ENV variable. I'm curious on how you would set that for each different project dynamically?
@kevinjalbert actually I wouldn't. :smile: But if you want, you can override cd function, for example, and set the variable on every cd. Or use something like $PROMPT_COMMAND
on bash.
I noticed an odd issue, when trying neoterm (in addition to #7). This doesn't really seem to be neoterm's fault, although I guess neoterm could try to accommodate for it.
With RSpec,
bundle exec rspec
must be ran from the Rails root directory, otherwise the command won't work as expected. I had tried this on an existing and new rails project (as I thought I had some odd absolute path hardcoded). I even had a another friend try it out with similar results. I could still be wrong, if there is a better way to havebundle exec rspec
work from any sub-directory in a rails project. I'm curious on how other have gotten this to work for their own rails projects?To set up a new Rails project to reproduce this:
Create new Rails application with no TestUnit
rails new my_awesome_app -T
Change Directory to Rails application
cd my_awesome_app
Add RSpec to
Gemfile
gem 'rspec-rails'
Update gems (to include new RSpec gem)
bundle install
Setup/Install RSpec
rails g rspec:install
Create simple spec under
touch ./spec/test_spec.rb
Run
bundle exec rspec
from Rails application root directory1 example, 0 failures
Run
bundle exec rspec
from./spec
directory0 examples, 0 failures