Module: Shoulda::Context::TestFrameworkDetection
- Defined in:
- lib/shoulda/context/test_framework_detection.rb
Class Method Summary collapse
- .detected_test_framework_test_cases ⇒ Object
- .possible_test_frameworks ⇒ Object
- .resolve_framework(future_framework) ⇒ Object
- .test_framework_test_cases ⇒ Object
Class Method Details
.detected_test_framework_test_cases ⇒ Object
19 20 21 22 23 |
# File 'lib/shoulda/context/test_framework_detection.rb', line 19 def self.detected_test_framework_test_cases possible_test_frameworks. map { |future_framework| resolve_framework(future_framework) }. compact end |
.possible_test_frameworks ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/shoulda/context/test_framework_detection.rb', line 4 def self.possible_test_frameworks [ -> { ActiveSupport::TestCase }, -> { Minitest::Test }, -> { MiniTest::Unit::TestCase }, -> { Test::Unit::TestCase } ] end |
.resolve_framework(future_framework) ⇒ Object
13 14 15 16 17 |
# File 'lib/shoulda/context/test_framework_detection.rb', line 13 def self.resolve_framework(future_framework) future_framework.call rescue NameError nil end |
.test_framework_test_cases ⇒ Object
25 26 27 |
# File 'lib/shoulda/context/test_framework_detection.rb', line 25 def self.test_framework_test_cases @_test_framework_test_case ||= detected_test_framework_test_cases end |