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

When Using Spring, Specs Won't Run Unless rspec Has Been Installed as a Spring Command #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rspec-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ file if it exists, or sensible defaults otherwise."

(defun rspec-spring-p ()
(and rspec-use-spring-when-possible
(not (equal (getenv "SPRING_DISABLE") "1"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't it be set to a different non-empty value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be set to anything. How about I do this:

(member (getenv "SPRING_DISABLE") '(nil "" "0"))

Or this:

(or
  (null (getenv "SPRING_DISABLE"))
  (equal "" (getenv "SPRING_DISABLE"))
  (equal "0" (getenv "SPRING_DISABLE")))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But where do we stop, should we also check for "false", "off", etc..?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does 0 mean "not disable"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose so, then. Check all three of these possible values, using member.

It's doesn't seem like false, etc, should be treated similarly: https://github.com/rails/spring/blob/7efd492018049df43310feb89acbaf226446a123/lib/spring/binstub.rb

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please fix the name of the variable (words in wrong order).

(let ((root (directory-file-name (rspec-project-root))))
(or
;; Older versions
Expand Down