It would probably be better like this:
```ruby
expect(table.find_by_tag("tr").first.to_s.split("\n").first.lstrip).
  to eq '<tr class="row custom_row" style="custom_style">'