Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在带Spring的SpaceMac中使用RSpec_Spring_Emacs_Rspec_Spacemacs - Fatal编程技术网

在带Spring的SpaceMac中使用RSpec

在带Spring的SpaceMac中使用RSpec,spring,emacs,rspec,spacemacs,Spring,Emacs,Rspec,Spacemacs,当我尝试在SpaceMac中运行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

当我尝试在SpaceMac中运行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在Rails上运行RSpec测试时的作用。

确保Spring正在运行,最新的spaces Mac应该自动检测
Spring.pid
,并相应地更改其命令

通过运行
spring服务器

或任何
bin/rails
命令

Spring仅在使用rspec测试运行程序时才受支持。

如果您有切换测试运行程序的项目,您可以通过在项目的根级别创建以下文件来为每个项目设置它们

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

添加此答案,以防其他人也来这里寻求帮助


我不得不添加gem'spring commands rspec',然后一切正常。

添加了一个关于有多个测试运行程序的注释。
# .dir-locals.el
((ruby-mode (ruby-test-runner . rspec)))