spork 0.9.2和rspec 3.0.0 =未初始化的常量RSpec :: Core :: CommandLine(NameError) [英] spork 0.9.2 and rspec 3.0.0 = uninitialized constant RSpec::Core::CommandLine (NameError)

查看:97
本文介绍了spork 0.9.2和rspec 3.0.0 =未初始化的常量RSpec :: Core :: CommandLine(NameError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Im使用spork 0.9.2和rspec 3.0.0.尝试运行测试rspec --drb时出现异常

Im using spork 0.9.2 and rspec 3.0.0. When trying to run test rspec --drb I have an exception

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in run_tests: uninitialized constant RSpec::Core::CommandLine (NameError)

但是当将rspec版本改回2.6时-一切正常. 有人遇到过同样的问题吗?有可能解决吗?

But when changing rspec version back to 2.6 - everything is OK. Has anyone faced the same issue? Is it possible to work around?

推荐答案

原因是在Rspec3中删除了RSpec :: Core :: CommandLine

The reason is that RSpec::Core::CommandLine was removed in Rspec3

https://github.com/rspec/rspec-core/blob/master/Changelog .md

将RSpec :: Core :: CommandLine(从未正式声明为公共)合并到RSpec :: Core :: Runner中. (迈伦·马斯顿)

Merge RSpec::Core::CommandLine (never formally declared public) into RSpec::Core::Runner. (Myron Marston)

但是spork取决于此代码.

But spork depends on this code.

spork的github上已经存在问题,可以在以下spork的fork中找到解决方案:

There is already an issue on spork's github and a solution can be found in a following spork's fork:

https://github.com/codecarson/spork/commit/38c79dccdf7a9f9fc9fc9f9f7a9f9f9c9fb7df7a7f9b3df3dff6e7f6e7f6e7f6e7e8f6e7e8e6e8f6e7e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8b6e8b6e7b9e7e8b6e7b9dbfdfbfdfdfd a>

https://github.com/codecarson/spork/commit/38c79dcedb246daacbadb9f18d09f50cc837de51#diff-937afaa19ccfee172d722a05112a7c6fL6

通常-替换

::RSpec::Core::CommandLine.new(argv).run(stderr, stdout)

使用

::RSpec::Core::Runner.run(argv,stderr, stdout)

在soprks源代码中

in the soprks source code

这篇关于spork 0.9.2和rspec 3.0.0 =未初始化的常量RSpec :: Core :: CommandLine(NameError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆