我正在尝试:
require 'minitest'
Minitest::Assertions::assert_equal(1, 1)
不起作用:
NoMethodError: undefined method `assert_equal' for Minitest::Assertions:Module
正确的方法是什么?方法does exist。
答案 0 :(得分:1)
module Assertions
extend Minitest::Assertions
class << self
attr_accessor :assertions
end
self.assertions = 0
end
Assertions.assert(true)
Assertions.assert(false)
Minitest :: Assertions模块希望能够增加名为assertions
的实例访问器。