为什么color_enabled在Ruby的rspec 3.0.3中工作,会抛出NoMethodError?

萨奇布·阿里(Saqib Ali)

我有一个名为的红宝石规格文件mySpec在规格文件中,我要运行的第37行有一个特定的测试。但是,当我运行该测试时,我得到了NoMethodError

$ rspec -v
3.0.3

$ bundle exec rspec myspec.rb:37
Coverage report generated for RSpec to coverage. 79 / 223 LOC (35.43%) covered.
spec_helper.rb:10:in `block in <top (required)>': undefined method `color_enabled=' for #<RSpec::Core::Configuration:0x007f905e2ea2c0> (NoMethodError)

spec_helper.rb文件的相关部分如下所示:

RSpec.configure do |config|
    # Use color in STDOUT
    config.color_enabled = true
    config.tty = true
    config.order = "random"
end

那为什么找不到color_enabled呢?我尝试按照此处的建议rspec-rails添加rspec-console到我的Gemfile中但这没什么区别。

尼克·维斯

好了,color_enabled?但是没有color_enabled=试试这个:

RSpec.configure do |config|
  config.color = true
  config.tty = true
  config.order = "random"
end

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Why does color_enabled work in Ruby's rspec 3.0.3 throw a NoMethodError?

来自分类Dev

为什么“数字&(〜(1 << 3))”对0无效?

来自分类Dev

为什么3 [0]和3 [1]在Ruby中产生1?

来自分类Dev

reg [7:0] a [3:0] 和 reg [7:0] a [0:3] 有什么区别

来自分类Dev

有人可以解释为什么printf(“%s”,str + str [0]-str [3]); 在C中工作?

来自分类Dev

为什么朱莉娅2 ^ 3 ^ 4 = 0?

来自分类Dev

为什么临时指针指向 0 而不是 3?

来自分类Dev

为什么m [1]-m [0]返回3,其中m是3x3矩阵?

来自分类Dev

为什么3.toString()抛出语法异常而3..toString()正常工作?

来自分类Dev

为什么2a0 ++等于2a1,但2e0 ++等于3?

来自分类Dev

为什么-webkit-transform:translate3d(0,0,0)与固定子项混淆

来自分类Dev

在d3中创建AngularJS指令时,为什么要使用element [0]而不是element?

来自分类Dev

为什么range(0)== range(2,2,2)在Python 3中为true?

来自分类Dev

为什么无法检出c3p0中的资源?

来自分类Dev

Vue 3-数字0增加(++)在模板中不是1而是101,为什么?

来自分类Dev

为什么从列表[-1]而不是列表[0]开始计算此列表中的元素?(Python 3)

来自分类Dev

为什么当我的数组中的对象数应该为 3 时,count 返回 0?

来自分类Dev

/ dev / fsevents中的0x3F 0xB3字节是什么?

来自分类Dev

/ dev / fsevents中的0x3F 0xB3字节是什么?

来自分类Dev

Ruby排序-为什么“预期:[7、6、5、5、4、3、3]”时rspec错误似乎与“获得:[7、6、5、5、4、3、3]”相同?

来自分类Dev

为什么0%0会产生1?

来自分类Dev

NoMethodError:在Rails控制台中运行Capybara测试时,未定义方法`color_enabled ='

来自分类Dev

NoMethodError:在Rails控制台中运行Capybara测试时未定义方法`color_enabled ='

来自分类Dev

Ruby-将'(3)'解析为整数将返回0

来自分类Dev

为什么0x55555556除以3 hack起作用?

来自分类Dev

为什么Julia>(1,2,3)返回(1,2,0)

来自分类Dev

为什么Unix权限系统使用1 2 3 4 ...值而不是1或0?

来自分类Dev

CakePHP 3:findById大于0

来自分类Dev

Java脚本:3 + 0 = 30

Related 相关文章

  1. 1

    Why does color_enabled work in Ruby's rspec 3.0.3 throw a NoMethodError?

  2. 2

    为什么“数字&(〜(1 << 3))”对0无效?

  3. 3

    为什么3 [0]和3 [1]在Ruby中产生1?

  4. 4

    reg [7:0] a [3:0] 和 reg [7:0] a [0:3] 有什么区别

  5. 5

    有人可以解释为什么printf(“%s”,str + str [0]-str [3]); 在C中工作?

  6. 6

    为什么朱莉娅2 ^ 3 ^ 4 = 0?

  7. 7

    为什么临时指针指向 0 而不是 3?

  8. 8

    为什么m [1]-m [0]返回3,其中m是3x3矩阵?

  9. 9

    为什么3.toString()抛出语法异常而3..toString()正常工作?

  10. 10

    为什么2a0 ++等于2a1,但2e0 ++等于3?

  11. 11

    为什么-webkit-transform:translate3d(0,0,0)与固定子项混淆

  12. 12

    在d3中创建AngularJS指令时,为什么要使用element [0]而不是element?

  13. 13

    为什么range(0)== range(2,2,2)在Python 3中为true?

  14. 14

    为什么无法检出c3p0中的资源?

  15. 15

    Vue 3-数字0增加(++)在模板中不是1而是101,为什么?

  16. 16

    为什么从列表[-1]而不是列表[0]开始计算此列表中的元素?(Python 3)

  17. 17

    为什么当我的数组中的对象数应该为 3 时,count 返回 0?

  18. 18

    / dev / fsevents中的0x3F 0xB3字节是什么?

  19. 19

    / dev / fsevents中的0x3F 0xB3字节是什么?

  20. 20

    Ruby排序-为什么“预期:[7、6、5、5、4、3、3]”时rspec错误似乎与“获得:[7、6、5、5、4、3、3]”相同?

  21. 21

    为什么0%0会产生1?

  22. 22

    NoMethodError:在Rails控制台中运行Capybara测试时,未定义方法`color_enabled ='

  23. 23

    NoMethodError:在Rails控制台中运行Capybara测试时未定义方法`color_enabled ='

  24. 24

    Ruby-将'(3)'解析为整数将返回0

  25. 25

    为什么0x55555556除以3 hack起作用?

  26. 26

    为什么Julia>(1,2,3)返回(1,2,0)

  27. 27

    为什么Unix权限系统使用1 2 3 4 ...值而不是1或0?

  28. 28

    CakePHP 3:findById大于0

  29. 29

    Java脚本:3 + 0 = 30

热门标签

归档