Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.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
Ruby rspec——干运行和bundle exec rspec有不同的示例计数_Ruby_Testing_Rspec - Fatal编程技术网

Ruby rspec——干运行和bundle exec rspec有不同的示例计数

Ruby rspec——干运行和bundle exec rspec有不同的示例计数,ruby,testing,rspec,Ruby,Testing,Rspec,我看到,当我运行bundle exec rspec--dry run时,我得到了大约800个示例,但当我运行 bundle exec rspec示例数量明显减少 如何调试或识别哪些测试未运行?请检查您的规范名称。如果它们的名称没有以“_spec.rb”结尾,bundle exec rspec将不会运行它们。你真的想花时间调试,而不是像你一开始应该做的那样,用bundle exec或binstub(bin/rspec)运行测试吗?这表明当您在bundler外部运行gem时,测试没有使用相同的gem

我看到,当我运行bundle exec rspec--dry run时,我得到了大约800个示例,但当我运行
bundle exec rspec
示例数量明显减少


如何调试或识别哪些测试未运行?

请检查您的规范名称。如果它们的名称没有以“_spec.rb”结尾,bundle exec rspec将不会运行它们。

你真的想花时间调试,而不是像你一开始应该做的那样,用
bundle exec
或binstub(
bin/rspec
)运行测试吗?这表明当您在bundler外部运行gem时,测试没有使用相同的gem集运行。所以不要在bundler之外运行它们。问题解决了。请找到一个例子,
--干运行
报告,但“正常”运行不报告。你可能会立即看到原因,如果没有-张贴在问题中并ping我们。我很乐意看一看。