使用Rails 2.3.14,rspec-1.3.2失败并且参数数量错误

时间:2012-02-28 18:49:24

标签: ruby-on-rails rspec

将rvm与ree-1.8.7-2011.03和rspec-1.3.2一起使用,尝试使用Rails 2.3.14运行spec文件时出错

任何帮助都表示赞赏,因为我无法运行任何规范测试。谢谢!

从我的Rails文件夹运行spec文件,如: spec spec / models / assignment_spec.rb

〜/ .rvm / gems / ree-1.8.7-2011.03 / gems / rspec-1.3.2 / lib / spec / runner / options.rb:247:in`initialize':错误的参数个数(1个用于2)(ArgumentError)

from ~/.rvm/gems/ree-1.8.7-2011.03/gems/rspec-1.3.2/lib/spec/runner/options.rb:247:in `new'
from ~/.rvm/gems/ree-1.8.7-2011.03/gems/rspec-1.3.2/lib/spec/runner/options.rb:247:in `load_formatters'

...

〜/ .rvm /宝石/ REE-1.8.7-2011.03 /宝石/ rspec的-1.3.2 / LIB /规格/流道/ .RB:

...

 def load_formatters(format_options, formatters)
    format_options.map do |format, where|
      formatter_type = if formatters[format]
        require formatters[format][0]
        eval(formatters[format][1], binding, __FILE__, __LINE__)
      else
        load_class(format, 'formatter', '--format')
      end

      formatter_type.new(formatter_options) # <-- 247
    end
  end

  def formatter_options
    @formatter_options ||= OpenStruct.new(
      :colour   => colour,
      :autospec => autospec,
      :dry_run  => dry_run
    )
  end

...

编辑:

spec_helper.rb: https://github.com/instructure/canvas-lms/blob/stable/spec/spec_helper.rb

./ spec.opts:

- 色

- 要求spec / nested_instafail_formatter

- 格式化RSpec :: NestedInstafailFormatter

- 格式化html:tmp / spec_html / index.html

1 个答案:

答案 0 :(得分:1)

“你试过ree-1.8.7-2012.02吗?” - 昨天的mpapis

Mpapis回答了这个问题,使用ree-1.8.7-2012.02和rspec-1.3.2进行了规范测试。