|
5 | 5 | shared_examples 'selenium' do |params|
|
6 | 6 | # XXX need to test $url
|
7 | 7 | p = {
|
8 |
| - :user => 'selenium', |
9 |
| - :group => 'selenium', |
10 |
| - :install_root => '/opt/selenium', |
11 |
| - :java => 'java', |
12 |
| - :version => DEFAULT_VERSION, |
13 |
| - :url => '', |
14 |
| - :download_timeout => '90', |
| 8 | + :user => 'selenium', |
| 9 | + :group => 'selenium', |
| 10 | + :install_root => '/opt/selenium', |
| 11 | + :java => 'java', |
| 12 | + :version => DEFAULT_VERSION, |
| 13 | + :url => '', |
| 14 | + :download_timeout => '90', |
| 15 | + :nocheckcertificate => false, |
15 | 16 | }
|
16 | 17 |
|
17 | 18 | if params
|
|
52 | 53 | 'target' => "#{p[:install_root]}/log",
|
53 | 54 | })
|
54 | 55 | should contain_wget__fetch('selenium-server-standalone').with({
|
55 |
| - 'source' => "https://selenium-release.storage.googleapis.com/#{path_version}/selenium-server-standalone-#{p[:version]}.jar", |
56 |
| - 'destination' => "#{p[:install_root]}/jars/selenium-server-standalone-#{p[:version]}.jar", |
57 |
| - 'timeout' => p[:download_timeout], |
58 |
| - 'execuser' => p[:user], |
| 56 | + 'source' => "https://selenium-release.storage.googleapis.com/#{path_version}/selenium-server-standalone-#{p[:version]}.jar", |
| 57 | + 'destination' => "#{p[:install_root]}/jars/selenium-server-standalone-#{p[:version]}.jar", |
| 58 | + 'timeout' => p[:download_timeout], |
| 59 | + 'nocheckcertificate' => p[:nocheckcertificate], |
| 60 | + 'execuser' => p[:user], |
59 | 61 | })
|
60 | 62 | should contain_logrotate__rule('selenium').with({
|
61 | 63 | :path => "#{p[:install_root]}/log",
|
|
166 | 168 | }.to raise_error
|
167 | 169 | end
|
168 | 170 | end
|
| 171 | + |
| 172 | + context 'nocheckcertificate => true' do |
| 173 | + p = { :nocheckcertificate => true } |
| 174 | + let(:params) { p } |
| 175 | + |
| 176 | + it_behaves_like 'selenium', p |
| 177 | + end |
| 178 | + |
| 179 | + context 'nocheckcertificate => []' do |
| 180 | + p = { :nocheckcertificate => [] } |
| 181 | + let(:params) { p } |
| 182 | + |
| 183 | + it 'should fail' do |
| 184 | + expect { |
| 185 | + should contain_class('selenium') |
| 186 | + }.to raise_error |
| 187 | + end |
| 188 | + end |
169 | 189 | end
|
170 | 190 |
|
171 | 191 | end
|
0 commit comments