Bird
0
0

In a Ruby TDD project, you notice some tests are skipped when running 'ruby -Ilib:test test/test_all.rb'. What could cause this?

hard📝 Application Q9 of 15
Ruby - Testing with RSpec and Minitest
In a Ruby TDD project, you notice some tests are skipped when running 'ruby -Ilib:test test/test_all.rb'. What could cause this?
AThe Ruby version is outdated
BThe test files are not in the test directory
CMinitest is not installed
DTests are marked with 'skip' or 'skip' method is called inside them
Step-by-Step Solution
Solution:
  1. Step 1: Understand why tests might be skipped

    In Minitest, tests can be skipped by calling 'skip' inside test methods or marking them to skip.
  2. Step 2: Evaluate other options

    Test location, missing gem, or Ruby version usually cause errors, not skipping tests silently.
  3. Final Answer:

    Tests are marked with 'skip' or 'skip' method is called inside them -> Option D
  4. Quick Check:

    Skipped tests use 'skip' method [OK]
Quick Trick: Use 'skip' to temporarily disable tests [OK]
Common Mistakes:
  • Assuming missing tests due to file location
  • Confusing skipped tests with missing tests
  • Blaming Ruby version for skipped tests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes