Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringSpec #32

Closed
sksamuel opened this issue Jun 15, 2016 · 7 comments
Closed

StringSpec #32

sksamuel opened this issue Jun 15, 2016 · 7 comments
Assignees
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Milestone

Comments

@sksamuel
Copy link
Member

Was thinking of adding a new spec, called StringSpec which just requires a single string, eg,

"haveKey should test that a map has a key" {
        val map = mapOf(Pair(1, "a"), Pair(2, "b"))
        map should haveValue("a")
}

Wdyt @helmbold

@helmbold
Copy link
Contributor

I like it! It is clean and simple, a piece of beauty.

@sksamuel
Copy link
Member Author

I'll add it tonight then.

@sksamuel
Copy link
Member Author

It might become my preferred way of testing actually

@lenguyenthanh
Copy link
Contributor

lenguyenthanh commented Jun 16, 2016

It looks awesome!

@helmbold
Copy link
Contributor

It could become my favourite style, too!

@sksamuel sksamuel added this to the 1.3 milestone Jun 16, 2016
@sksamuel sksamuel self-assigned this Jun 16, 2016
@sksamuel sksamuel added the enhancement ✨ Suggestions for adding new features or improving existing ones. label Jun 21, 2016
sksamuel added a commit that referenced this issue Jun 21, 2016
sksamuel added a commit that referenced this issue Jun 21, 2016
@sksamuel
Copy link
Member Author

This is in on the 1.3 branch. See changelog in that branch.

@helmbold
Copy link
Contributor

Awesome! I'll add the style to the documentation.

sksamuel added a commit that referenced this issue Jul 3, 2016
sksamuel added a commit that referenced this issue Jul 3, 2016
github-merge-queue bot pushed a commit that referenced this issue Feb 24, 2024
whenever `haveUpperBound` and/or `haveLowerBound` fail, provide in more
detail what exactly failed. For instance, instead of "Sequence should
have upper bound 9"
output the following:
"Sequence should have upper bound 9, **but element at index 10 was:
10**"

Co-authored-by: Emil Kantis <emil.kantis@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

No branches or pull requests

3 participants