makandra/spreewald

Mails: Strip whitespace from the beginning of lines

Closed this issue · 3 comments

I want to test the content of a mail with the following HTML:

<dt>
  What is your name?
</dt>
<dt>
  Foo Bar
</dt>

However, Spreewald evaluates the text of the email to "\n What is your name?\n\n\n Foo Bar\n\n" (note the extra whitespace at the beginning of the lines)
As either Cucumber or Spreewald strips away any whitespace from the beginning of the line, the only way to match this is by saying

*What is your name?



*Foo Bar

The asterisks at the beginning of the line shouldn't be necessary in my opinion.

Suggestion

In both text and HTML mails, any whitespace after a newline should be stripped away.

Hi,

I could not reproduce this string evaluation. We have analogue HTML-examples in Spreewald's features that would have to show the same behavior, but work as you would expect. In case there still is any difference, we would need the project-specific code that tested this (including the concrete HTML). The branches of the project you provided me over Slack do not seem to contain any code with this step that actually checks a HTML body. At this point, we would need further insights.

Okay, I was provided with more details and could reproduce the error.

Fixed in fdb9a00.