0

所以我有这些宝石供开发人员使用:

  gem 'autotest'
  gem 'ZenTest'
  gem 'autotest-growl'

在我的 .autotest 文件中:

require 'active_support'
require 'active_support/core_ext'
require 'autotest/restart'
require 'redgreen/autotest'


begin
  require 'autotest/growl'
rescue LoadError
  warn "Error loading autotest/growl. Run '[sudo] gem install autotest-growl' first."
end

 Autotest::Growl::show_modified_files = false
 Autotest::Growl::hide_label = true
 Autotest::Growl::remote_notification = true

Autotest.add_hook :initialize do |at|
  %w{.git .svn .hg .DS_Store ._* log}.each {|exception|at.add_exception(exception)}
end

如果我使用 require 'redgreen/autotest' 或 'autotest/redgreen' 运行,我会收到以下错误:

C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:419:in `run_tests'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:394:in `get_to_green'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:367:in `block in run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:365:in `loop'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:365:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:248:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/bin/autotest:6:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/bin/autotest:22:in `load'
C:/RailsInstaller/Ruby2.3.3/bin/autotest:22:in `<main>'
Quitting

我也尝试过 kule/redgreen gem,但没有?如果我单独运行 rspec 它有颜色。在多个终端上尝试过,安装了 ansi 等。

编辑1:我的gemfile https://gist.github.com/bbtdev/2c511c4741749db7fbffb02b6d72d9ad

编辑 2:我还有一个 app/autotest/discovery.rb 和 Autotest.add_discovery { "rspec" } 我的 rspec 版本是 3.7

编辑3:我安装了

gem 'rspec-autotest' gem 'autotest-rails'

当尝试添加 require 'redgreen/autotest' 或 require 'redgreen/autotest' 除非 ENV['RSPEC'] 它给了我

捆绑器:找不到命令:C:\RailsInstaller\Ruby2.3.​​3\bin\ruby -rrubygems -e 要求

4

1 回答 1

0

尝试改变,

require 'redgreen/autotest'

require 'redgreen/autotest' unless ENV['RSPEC']

在你的.autotest文件中。

于 2017-12-21T23:38:58.387 回答