Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using rake spec doesn't exclude files #181

Open
gcentauri opened this issue Nov 28, 2018 · 3 comments
Open

Using rake spec doesn't exclude files #181

gcentauri opened this issue Nov 28, 2018 · 3 comments

Comments

@gcentauri
Copy link

gcentauri commented Nov 28, 2018

I could be doing something wrong here, but I have a set of spec files to be excluded and the rake spec task does that for me. Works fine from the terminal. However, when i set rspec-use-rake-when-possible to non-nil, it doesn't seem to work.

I can see it showing up as a cli option in the compilation buffer:

-*- mode: rspec-compilation; default-directory: "~/cardflight/core/" -*-
RSpec Compilation started at Wed Nov 28 13:24:23

bundle exec rake spec SPEC_OPTS='--options /Users/gshang/my/project/.rspec' SPEC='/Users/gshang/my/project/spec'
/Users/gshang/.rvm/rubies/ruby-2.3.6/bin/ruby -I/Users/gshang/.rvm/gems/ruby-2.3.6/gems/rspec-core-3.7.0/lib:/Users/gshang/.rvm/gems/ruby-2.3.6/gems/rspec-support-3.7.0/lib /Users/gshang/.rvm/gems/ruby-2.3.6/gems/rspec-core-3.7.0/exe/rspec /Users/gshang/my/project/spec --exclude-pattern spec/core/\{example,foo\}/\*\*/\*_spec.rb

But it hits the example and foo files that are intended to be excluded.

@dgutov
Copy link
Collaborator

dgutov commented Nov 28, 2018

Does the command above (printed to the compilation buffer) exclude the said files when run from the terminal?

@gcentauri
Copy link
Author

gcentauri commented Nov 29, 2018

It does not. It there's actually a newline there which I didn't realize, so the line with all the rvm info and the --exclude-pattern option doesn't become part of the command. If I try to smash it all on one line, it says that --exclude-pattern is an invalid option. If I set it not to use the rake command, that second line does not show up in the compilation buffer.

So it seems like something with either my Rakefile (which in regard to rspec just sets up the default :spec task with the exclude pattern set), or maybe something with RVM, or with how the command is being generated by rspec-mode is not working as expected?

@dgutov
Copy link
Collaborator

dgutov commented Nov 29, 2018

The second like is the command that that gets invoked by the first line (by Rake). I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants