Skip to content

Add a few options to "assert_line" to simplify checks #92

@Pierstoval

Description

@Pierstoval

I'd like to make two suggestions:

1. Add -t|--trim to assert_line

The goal here would be to trim input before comparing it, so that all whitespaces before and after are removed. That's sometimes useful when you don't know how many spaces will be in the content, because it's sometimes based on terminal width. And in some cases, when lines are smaller, or empty, comparison checks can be done on just an empty string and it'll work.

2. Add -q|--quotes to assert_line

This would prevent things like that:

   -- line differs --
   index    : 1
   expected : 
   actual   : 
   --

And allow displaying errors like that for instance:

   -- line differs --
   index    : 1
   expected : ""
   actual   : "                                                                "
   --

Easier debugging for string that are not trimmed beforehand.

I'm not sure yet how to contribute this, but I can help :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions