File tree Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 88
88
validate_string($java )
89
89
validate_string($version )
90
90
validate_string($url )
91
+ validate_string($download_timeout )
91
92
92
93
include wget
93
94
Original file line number Diff line number Diff line change 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 => '2.39.0' ,
13
- :url => '' ,
8
+ :user => 'selenium' ,
9
+ :group => 'selenium' ,
10
+ :install_root => '/opt/selenium' ,
11
+ :java => 'java' ,
12
+ :version => '2.39.0' ,
13
+ :url => '' ,
14
+ :download_timeout => '90' ,
14
15
}
15
16
16
17
if params
46
47
should contain_wget__fetch ( 'selenium-server-standalone' ) . with ( {
47
48
'source' => "https://selenium.googlecode.com/files/selenium-server-standalone-#{ p [ :version ] } .jar" ,
48
49
'destination' => "#{ p [ :install_root ] } /jars/selenium-server-standalone-#{ p [ :version ] } .jar" ,
49
- 'timeout' => '90' ,
50
+ 'timeout' => p [ :download_timeout ] ,
50
51
'execuser' => p [ :user ] ,
51
52
} )
52
53
should contain_logrotate__rule ( 'selenium' ) . with ( {
140
141
} . to raise_error
141
142
end
142
143
end
144
+
145
+ context 'download_timeout => 42' do
146
+ p = { :download_timeout => '42' }
147
+ let ( :params ) { p }
148
+
149
+ it_behaves_like 'selenium' , p
150
+ end
151
+
152
+ context 'download_timeout => []' do
153
+ p = { :download_timeout => [ ] }
154
+ let ( :params ) { p }
155
+
156
+ it 'should fail' do
157
+ expect {
158
+ should contain_class ( 'selenium' )
159
+ } . to raise_error
160
+ end
161
+ end
143
162
end
144
163
145
164
end
You can’t perform that action at this time.
0 commit comments