2017-02-21 31 views
2

當我試圖運行一個RSpec測試中Spacemacs,我得到以下的輸出:在Spacemacs使用RSpec的同春

RSpec Compilation started at Tue Feb 21 14:14:30 

spring rspec --options <path to my test> 
WARN: Unresolved specs during Gem::Specification.reset: 
    activesupport (>= 4.2) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
Version: 2.0.0 

Usage: spring COMMAND [ARGS] 

Commands for spring itself: 

binstub   Generate spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert. 
help   Print available commands. 
server   Explicitly start a Spring server in the foreground 
status   Show current status. 
stop   Stop all spring processes for this project. 

Commands for your application: 

rails   Run a rails command. The following sub commands will use spring: console, runner, generate, destroy, test. 
rake   Runs the rake command 

RSpec Compilation finished at Tue Feb 21 14:14:31 

如果我禁用春季(例如,在我的控制檯運行spring stop)這個問題消失而且我能夠在沒有問題的情況下運行測試。

我想知道如果我有什麼配置不正確。我Spacemacs Ruby的配置是這樣的:

(ruby :variables 
     ruby-enable-enh-ruby-mode t 
     ruby-version-manager 'rvm 
     ruby-test-runner 'rspec) 

我也可能不會了解什麼春天的角色上運行使用Rails RSpec的測試時。

回答

1

確保彈簧運行,最新的Mac電腦的空間應自動檢測spring.pid,並改變它的相應命令。

您可以通過運行spring server

或任何bin/rails命令明確啓動的春天。

春天也似乎只用RSpec的測試運行時的支持。

如果您有切換測試運行,你可以通過在你的項目的根目錄創建如下文件進行設置每個項目的項目。

# .dir-locals.el 
((ruby-mode (ruby-test-runner . rspec))) 
+0

添加了關於擁有多個測試跑步者的註釋。 – rposborne

0

添加這個答案讓其他人最終在這裏尋找幫助。

我不得不添加寶石「彈簧命令-rspec的」,那麼它的所有工作的罰款。