Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Ruby 和 Rails 编写测试脚本。我必须验证是否突出显示了正确的关键字。我该怎么擦。例如。“机密”是我的关键字,想验证它是否被突出显示。
假设您使用 -tags 突出显示您的关键字<em>并有一个 HighLighter 类来突出显示:
<em>
assert_contains "<em>confidential</em>", HighLighter.highlight(text)