Vidyalelo
Ruby Programming · Q31

Testing in Ruby (RSpec, MiniTest, etc.)

Programming · Ruby Programming · question 31

Q31

Which assertion method is commonly used in RSpec for testing if an object responds to a method?

A.
expect(object).to respond_to(:method)
Answer
B.
assert_respond_to(object, :method)
C.
assert(object.respond_to?(:method))
D.
expect(object).to have_method(:method)

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board