Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

(GH-50) Specs to verify Chocolatey Package Dependency #56

Merged
merged 1 commit into from Dec 7, 2015

Conversation

gep13
Copy link
Member

@gep13 gep13 commented Dec 6, 2015

@gep13
Copy link
Member Author

gep13 commented Dec 6, 2015

@ferventcoder before you say anything...

This isn't pretty, and I know it isn't pretty, but I wanted to get something out there in the last few minutes I had on the computer before switching off for the night 😄

In general, what are your comments on the approach? Couldn't think, off the top of my head, a nice way to Mock to package and it's dependencies in a re-usable way, hence the duplication of the various elements.

If we go ahead with something like this, we should probably do something for testing existence of dependencies that don't have a version, and possibly others as well.

var packageDependenciesWithoutChocolatey = new List<PackageDependency> { fiddlerPackageDependency };
var packageDependenciesWithChocolatey = new List<PackageDependency> { fiddlerPackageDependency, chocolateyPackageDependency };
var dependencySetWithoutChocolatey = new PackageDependencySet(new FrameworkName(".NETFramework, Version = 4.0"), packageDependenciesWithoutChocolatey);
var dependencySetWithChocolatey = new PackageDependencySet(new FrameworkName(".NETFramework, Version = 4.0"), packageDependenciesWithChocolatey);
Copy link
Member

Choose a reason for hiding this comment

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

can we leave out framework here? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. I notice that you left it in as well, so guessing there wasn't a way without it?

@ferventcoder
Copy link
Member

This isn't pretty, and I know it isn't pretty, but I wanted to get something out there in the last few minutes I had on the computer before switching off for the night 😄

It's actually not that bad.

@ferventcoder
Copy link
Member

In general, what are your comments on the approach? Couldn't think, off the top of my head, a nice way to Mock to package and it's dependencies in a re-usable way, hence the duplication of the various elements.

Context() is overridable in each spec class, this is likely a good place to do that. That way you have 1 IPackage setup and each class takes the base context and determines how it will go by overriding Context(). Then you are not creating a bunch of unreusable logic in the base class.

@ferventcoder
Copy link
Member

I'll take this and update it so you can see what I mean.

ferventcoder added a commit that referenced this pull request Dec 7, 2015
(GH-50) Specs to verify Chocolatey Package Dependency
@ferventcoder ferventcoder merged commit b77d5a3 into chocolatey:master Dec 7, 2015
@ferventcoder
Copy link
Member

Here you go sir, take a look - 1cdcb06

@gep13 gep13 deleted the Issue-52 branch December 7, 2015 21:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants