-
Notifications
You must be signed in to change notification settings - Fork 70
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
(MODULES-4418) Add bypass_proxy to chocolateysource #132
(MODULES-4418) Add bypass_proxy to chocolateysource #132
Conversation
Working on the acceptance tests, will remove WIP when they pass. Don't have a new enough version of Chocolatey in the CI artifactory to test, rectifying. |
@@ -66,6 +99,7 @@ | |||
assert_match(/bob/, get_xml_value("//sources/source[@id='test']/@user", result.output).to_s, 'User did not match') | |||
assert_match(/.+/, get_xml_value("//sources/source[@id='test']/@password", result.output).to_s, 'Password was not saved') | |||
assert_match(/false/, get_xml_value("//sources/source[@id='test']/@disabled", result.output).to_s, 'Disabled did not match') | |||
assert_match(/true/, get_xml_value("//sources/source[@id='test']/@bypassProxy", result.output).to_s, 'Bypass Proxy did not match') | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more recent idiom is to use rspec's expect(some_var).to match(/true/)
although with all the other assert_match
s continuing in that way is fine.
spec/acceptance/sources_spec.rb
Outdated
end | ||
end | ||
|
||
it 'Should apply a manifest to change the priority' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Should apply manifest to set bypass_proxy to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -444,6 +489,26 @@ | |||
resource.flush | |||
end | |||
|
|||
it "should set bypass_proxy when present" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this test and the one starting at line 596?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally none, I don't think, this is an artifact of copying the tests over.
Prior to this commit the `chocolateysource` type and provider did not support the option to specify the `--bypass-proxy` flag when managing a source. This option causes Chocolatey to ignore any system proxies and was introduced in Chocolatey `0.10.4`. This commit adds the `bypass_proxy` property to the type and provider of `chocolateysource` to ensure that this property can be configured on versions which support it. This commit also updates the README documentation and CHANGELOG, as well as providing new unit and acceptance tests and updating any unit and acceptance tests which should include the new setting. As new features are added which depend on particular versions of Chocolatey, it may be useful to refactor the tests and provider to manage the addition of such features with less duplicated code, but that is considered out-of-scope for this improvement.
Prior to this commit the
chocolateysource
type and provider didnot support the option to specify the
--bypass-proxy
flag whenmanaging a source. This option causes Chocolatey to ignore any
system proxies and was introduced in Chocolatey
0.10.4
.This commit adds the
bypass_proxy
property to the type andprovider of
chocolateysource
to ensure that this propertycan be configured on versions which support it.
This commit also updates the README documentation and CHANGELOG,
as well as providing new unit and acceptance tests and updating
any unit and acceptance tests which should include the new
setting.
As new features are added which depend on particular versions of
Chocolatey, it may be useful to refactor the tests and provider
to manage the addition of such features with less duplicated
code, but that is considered out-of-scope for this improvement.