-
Notifications
You must be signed in to change notification settings - Fork 49
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
Joshua Hoblitt
committed
Oct 2, 2013
1 parent
0904127
commit df6cc77
Showing
3 changed files
with
119 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# == Class: selenium::hub | ||
# | ||
# simple template | ||
# | ||
# | ||
# === Examples | ||
# | ||
# include selenium::hub | ||
# | ||
# | ||
# === Authors | ||
# | ||
# Joshua Hoblitt <[email protected]> | ||
# | ||
# | ||
class selenium::hub( | ||
$options = $selenium::params::hub_options, | ||
) inherits selenium::params { | ||
validate_string($options) | ||
|
||
include selenium | ||
|
||
anchor { 'selenium::hub::begin': } | ||
Class[ 'selenium' ] -> | ||
selenium::config{ 'hub': | ||
user => $selenium::user, | ||
group => $selenium::group, | ||
install_root => $selenium::install_root, | ||
options => $options, | ||
java => $selenium::java, | ||
} -> | ||
anchor { 'selenium::hub::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,46 @@ | ||
require 'spec_helper' | ||
|
||
describe 'selenium::hub', :type => :class do | ||
|
||
shared_examples 'hub' do |params| | ||
p = { | ||
:options => '-role hub' | ||
} | ||
|
||
p.merge!(params) if params | ||
|
||
it do | ||
should include_class('selenium') | ||
should contain_selenium__config('hub').with({ | ||
'options' => p[:options], | ||
}) | ||
should contain_class('selenium::hub') | ||
end | ||
end | ||
|
||
context 'for osfamily RedHat' do | ||
let(:facts) {{ :osfamily => 'RedHat' }} | ||
|
||
context 'no params' do | ||
it_behaves_like 'hub', {} | ||
end | ||
|
||
context 'options => -foo' do | ||
p = { :options => '-foo' } | ||
let(:params) { p } | ||
|
||
it_behaves_like 'hub', p | ||
end | ||
|
||
context 'options => []' do | ||
let(:params) {{ :options => [] }} | ||
|
||
it 'should fail' do | ||
expect { | ||
should contain_class('selenium::hub') | ||
}.to raise_error | ||
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