-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix downloading when passwords contain spaces
This also adds our first acceptance tests to this module.
- Loading branch information
1 parent
ac5a8a4
commit b7423d2
Showing
7 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
.travis.yml: | ||
secure: "S8pxtUQSCxezeHuMTOa2nmbOC1Ln37evcDBd6rcAPse4DhrwzdJ7Ijme2tE+cPcdyYgO66jL0wWUBNia+10vOoYs1mCMj3mUq2bgySRhML0CQxGIvKYu8R6PbijljSK7LYplD1THQRgFLyHQ+f4Mh7+8yFpjXSmxuAQMdCPfPv8=" | ||
spec/spec_helper.rb: | ||
unmanaged: true | ||
spec/spec_helper_acceptance.rb: | ||
unmanaged: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'spec_helper_acceptance' | ||
require 'uri' | ||
|
||
context 'authenticated download' do | ||
let(:source) do | ||
URI.escape("http://httpbin.org/basic-auth/user/#{password}") | ||
end | ||
let(:pp) do | ||
<<-EOS | ||
archive { '/tmp/testfile': | ||
source => '#{source.gsub("'") { "\\'" }}', | ||
username => 'user', | ||
password => '#{password.gsub("'") { "\\'" }}', | ||
provider => #{provider}, | ||
} | ||
EOS | ||
end | ||
|
||
%w[curl wget ruby].each do |provider| | ||
context "with provider #{provider}" do | ||
let(:provider) { provider } | ||
|
||
[ | ||
'hunter2', | ||
'pass word with spaces', | ||
'y^%88_', | ||
"passwordwithsinglequote'!", | ||
].each do |password| | ||
context "with password '#{password}'" do | ||
let(:password) { password } | ||
|
||
it 'applies idempotently with no errors' do | ||
shell('/bin/rm -f /tmp/testfile') | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
describe file('/tmp/testfile') do | ||
it { is_expected.to be_file } | ||
its(:content_as_json) { is_expected.to include('authenticated' => true, 'user' => 'user') } | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This file is completely managed via modulesync | ||
require 'voxpupuli/acceptance/spec_helper_acceptance' | ||
|
||
configure_beaker | ||
|
||
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters