Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
195 additions
and
1 deletion.
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
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,51 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Confluence::Tomcat_attributes' do | ||
describe 'valid attributes' do | ||
[ | ||
{ 'URIEncoding' => 'UTF-8' }, | ||
{ 'secure' => true }, | ||
{ 'proxyPort' => 8443 }, | ||
{ | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '8123', | ||
'secure' => true, | ||
'scheme' => 'https' | ||
}, | ||
{} | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid attributes' do | ||
context 'with garbage inputs' do | ||
[ | ||
{ %w[foo blah] => 'bar' }, | ||
{ true => 'false' }, | ||
{ 'proxyPort' => %w[8443 1234] }, | ||
{ 'schema' => { 'https' => 'false' } }, | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
%w[yes no], | ||
'', | ||
'ネット', | ||
'55555', | ||
'0x123', | ||
'yess', | ||
'nooo' | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
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,80 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Confluence::Tomcat_connectors' do | ||
describe 'valid connector specifications' do | ||
[ | ||
{ | ||
8081 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
}, | ||
8443 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '443', | ||
'secure' => true, | ||
'scheme' => 'https' | ||
} | ||
} | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid connector specifications' do | ||
context 'with garbage inputs' do | ||
[ | ||
{ | ||
'8081' => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
} | ||
}, | ||
{ | ||
1023 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
} | ||
}, | ||
{ %w[foo blah] => 'bar' }, | ||
{ true => 'false' }, | ||
{ 'proxyPort' => %w[8443 1234] }, | ||
{ 'schema' => { 'https' => 'false' } }, | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
%w[yes no], | ||
'', | ||
'ネット', | ||
'55555', | ||
'0x123', | ||
'yess', | ||
'nooo' | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
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
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 @@ | ||
type Confluence::Tomcat_attributes = Hash[String[1], Scalar] |
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 @@ | ||
type Confluence::Tomcat_connectors = Hash[Stdlib::Port::Unprivileged, Confluence::Tomcat_attributes] |