Skip to content

Add a test helper that exercises regexes#4

Merged
bhuga merged 4 commits intomasterfrom
regex-tests
Jun 6, 2016
Merged

Add a test helper that exercises regexes#4
bhuga merged 4 commits intomasterfrom
regex-tests

Conversation

@bhuga
Copy link
Contributor

@bhuga bhuga commented May 31, 2016

This came up on CI: How do we test some of these regexes?

This gives us a new test helper, chat, that actually parses a chat message, matches it against parsed regexes, turns it into parameters, and lets us compare that everything's fine.

cc @jakedouglas, who mentioned this on the CI pull https://github.com/github/ci/pull/1013

metadata
}
matcher = matchers.first { |matcher| matcher["regex"].match(message) }
matcher = matchers.find { |matcher| matcher["regex"].match(message) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both of these supposed to be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both of these supposed to be here?

Nope, fixed. Thanks.

@jakedouglas
Copy link
Contributor

Fairly quirky implementation as you mentioned, but I dig the result.

@bhuga
Copy link
Contributor Author

bhuga commented Jun 3, 2016

This is working great over in https://github.com/github/heaven/pull/2597, better than I hoped! I don't think testing could be more intuitive. I will land this when that branch lands.

@bhuga bhuga merged commit 63cbafa into master Jun 6, 2016
@bhuga bhuga deleted the regex-tests branch June 6, 2016 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants