What is the purpose of a setup block in MiniTest?
A. Executes code after each test case
B. Executes code before all test cases
C. Executes code after all test cases
D. Executes code before each test case
Answer: Option D
A. Executes code after each test case
B. Executes code before all test cases
C. Executes code after all test cases
D. Executes code before each test case
Answer: Option D
Which testing framework is commonly used for behavior-driven development (BDD) in Ruby?
A. MiniTest
B. Test::Unit
C. RSpec
D. Cucumber
What is the purpose of a test suite in Ruby testing?
A. A single test case
B. A group of related test cases
C. A test runner
D. None of the above
Which assertion method is commonly used in RSpec for testing equality of values?
A. expect(actual).to equal(expected)
B. assert_equal(actual, expected)
C. expect(actual).to eq(expected)
D. assert_equal(expected, actual)
What is the purpose of a mock object in Ruby testing?
A. Asserts that a particular condition is true
B. Provides a placeholder for a method that will be defined later
C. Checks if an object's methods are called with the correct arguments
D. Simulates the behavior of a real object
Join The Discussion