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.
ビルダーを使用して XML を生成しており、その結果をファイルの内容と比較したいと考えています。ただし、文字列が非常に長いため、文字列が異なると出力が読みにくくなります。
ルビーで文字列を比較するためのライブラリがいくつかあることは知っていますが、読みやすい複数行の文字列比較エラーを生成するための機能が rspec に組み込まれていますか?
わかりました。--diff オプションを次のように使用する必要があります。
actual_multiline_string.should == expected_multiline_string
いいえ
actual_multiline_string.should eql(expected_multiline_string)