【发布时间】:2015-09-15 19:15:19
【问题描述】:
我有一个脚本已经演变成需要进行一些断言和匹配。
它是用 ruby 编写的,我在 Gemfile 中包含了rspec 并需要它。
我发现这篇关于如何在irb 中使用的非常有用的 SO 帖子:
How to use RSpec expectations in irb
我还发现了以下内容:
Use RSpec's "expect" etc. outside a describe ... it block
class BF
include ::Rspec::Matchers
def self.test
expect(1).to eq(1)
end
end
BF.test
expect 行出现错误。
【问题讨论】:
-
...你得到什么错误?
标签: ruby rspec rspec-expectations