module Shoulda::Matchers::Integrations::NUnitTestCaseDetection

Public Class Methods

detected_test_case_constants() click to toggle source
# File lib/shoulda/matchers/integrations/nunit_test_case_detection.rb, line 20
def self.detected_test_case_constants
  possible_test_case_constants.
    map { |future_constant| resolve_constant(future_constant) }.
    compact
end
possible_test_case_constants() click to toggle source
# File lib/shoulda/matchers/integrations/nunit_test_case_detection.rb, line 5
def self.possible_test_case_constants
  [
    -> { ActiveSupport::TestCase },
    -> { Minitest::Test },
    -> { MiniTest::Unit::TestCase },
    -> { Test::Unit::TestCase }
  ]
end
resolve_constant(future_constant) click to toggle source
# File lib/shoulda/matchers/integrations/nunit_test_case_detection.rb, line 14
def self.resolve_constant(future_constant)
  future_constant.call
rescue NameError
  nil
end
test_case_constants() click to toggle source
# File lib/shoulda/matchers/integrations/nunit_test_case_detection.rb, line 26
def self.test_case_constants
  @_test_case_constants ||= detected_test_case_constants
end