Skip to content

Ability to check for a certain # of characters #497

@TraGicCode

Description

@TraGicCode

I recently worked on a epp template where i needed to generate the following in a configuration file.

Example1

[{
	"Class": "MyNamespace.MyClass",
	"Method": "MyMethod"
},
{
	"Class": "MyNamespace.MyClass2",
	"Method": "MyMethod"
}
]

Example2

[{
	"Class": "MyNamespace.MyClass",
	"Method": "MyMethod"
}
]

It seemed very hard to write a test to actually check if i am rendering commas correctly. For example the first example is an array that contains 1 item and therefore has no commas to separate items since its a 1 item array. The second example on the other hand needs to have a comma rendered between items.

It would be nice to have a feature where you could assert that a certain character appears an expected # of times. This way i could assert my logic of comma seperation is working as i expect it to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions