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

Chores/matcher cleanup #1181

Merged
merged 2 commits into from
Jan 13, 2020
Merged

Chores/matcher cleanup #1181

merged 2 commits into from
Jan 13, 2020

Conversation

shamus
Copy link
Contributor

@shamus shamus commented Jan 13, 2020

Prior to this PR, the matchers used a simplified interface to make assertions, but this proved difficult to extend.

This PR brings the k8s matchers closer to the underlying structure of the data resulting from parsing the resulting YAML. This should ease both the extension of the matchers and their expressiveness.

This file is required for the tests to pass.
Bringing the matchers closer to the underlying structure of the parsed
YAML. This should ease both the extension of the matchers and their
expressiveness.
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/170669099

The labels on this github issue will be updated when the story is started.

@andrewedstrom
Copy link
Contributor

I like this. I like that the structure of the matcher calls mimics the structure of the generated yaml.

I think this is quite readable:

		Expect(ctx).To(
			ProduceYAML(
				RepresentingDeployment().WithPodMatching(func(pod *PodMatcher) {
					pod.WithContainerMatching(func(container *ContainerMatcher) {
						container.WithName("uaa")
					})
				}),
			),
		)

@andrewedstrom andrewedstrom merged commit 9ccfc69 into develop Jan 13, 2020
@thausler786 thausler786 deleted the chores/matcher-cleanup branch June 8, 2020 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants