class Minitest::Checks::Controllers
Public Class Methods
call_class_methods(methods)
click to toggle source
# File lib/mimoco.rb, line 127 def self.call_class_methods(methods) methods.each { |meth| check_no_nil @klass.send(meth), "<#{meth}> should return no nil" } end
class_methods(expected)
click to toggle source
# File lib/mimoco.rb, line 120 def self.class_methods(expected) cls = @klass.methods(false).sort cls.delete_if { |x| /^_/ =~ x } cls -= %i[__callbacks helpers_path middleware_stack] check_equal expected, cls end
public_methods(expected)
click to toggle source
# File lib/mimoco.rb, line 133 def self.public_methods(expected) cls = @klass.new.public_methods(false).sort check_equal expected, cls end
respond_to(methods)
click to toggle source
# File lib/mimoco.rb, line 112 def self.respond_to(methods) instance = @klass.new methods.each { |method| msg = "#{@klass} should respond to #{method}" @minitest.assert instance.respond_to?(method), msg } end