Reputation: 105193
I'm trying this:
require 'minitest'
Minitest::Assertions::assert_equal(1, 1)
Doesn't work:
NoMethodError: undefined method `assert_equal' for Minitest::Assertions:Module
What is the right way? The method does exist.
Upvotes: 1
Views: 468
Reputation: 2405
module Assertions
extend Minitest::Assertions
class << self
attr_accessor :assertions
end
self.assertions = 0
end
Assertions.assert(true)
Assertions.assert(false)
The Minitest::Assertions module expects to be able to increment an instance accessor named assertions
.
http://docs.seattlerb.org/minitest/Minitest/Assertions.html
Upvotes: 1