Skip to content

Commit

Permalink
improve contexts in pureftpd::config rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Aug 5, 2013
1 parent d50e2af commit c3e8fdd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,22 @@

# accumutate all of the params and content strings as we test each individual
# option so we can use them for the next test
config_options.each do |option|
params = {}
params[option.downcase.to_sym] = value
content = sprintf("%-19s %s\n", option, value)
context 'one option at a time' do
config_options.each do |option|
params = {}
params[option.downcase.to_sym] = value
content = sprintf("%-19s %s\n", option, value)

all_params.merge!(params)
all_content += content
all_params.merge!(params)
all_content += content

it_behaves_like 'config', params, content
it_behaves_like 'config', params, content
end
end

# test all of the known options at once this works because the ordering of
# options values in the output file is fixed
context 'all parameters' do
context 'all options' do
it_behaves_like 'config', all_params, all_content
end

Expand Down

0 comments on commit c3e8fdd

Please sign in to comment.