Bird
0
0

Which method is used in Minitest to assert that a condition is true?

easy📝 Conceptual Q2 of 15
Ruby - Testing with RSpec and Minitest
Which method is used in Minitest to assert that a condition is true?
Aassert_true
Bassert
Cassert_condition
Dassert_check
Step-by-Step Solution
Solution:
  1. Step 1: Recall the basic assert method

    The assert method checks if a given expression is true.
  2. Step 2: Verify method names in Minitest

    Minitest uses assert, not assert_true or others, to verify truthiness.
  3. Final Answer:

    assert -> Option B
  4. Quick Check:

    assert method = check truthy condition [OK]
Quick Trick: Use assert to check if something is true [OK]
Common Mistakes:
  • Using assert_true which does not exist in Minitest
  • Confusing assert with assert_equal
  • Trying to use assert_condition or assert_check

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes