πŸ“Š Ruby
Q. Which assertion method is commonly used in RSpec for testing if an object responds to a method?
  • (A) expect(object).to respond_to(:method)
  • (B) assert_respond_to(object, :method)
  • (C) assert(object.respond_to?(:method))
  • (D) expect(object).to have_method(:method)
πŸ’¬ Discuss
βœ… Correct Answer: (A) expect(object).to respond_to(:method)

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
162
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
98%
Success Rate