Skip to content

Commit

Permalink
Rubocop cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
svanzoest committed Mar 25, 2016
1 parent aa1946e commit 7b3b985
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
19 changes: 10 additions & 9 deletions attributes/mod_auth_openid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
default['apache']['mod_auth_openid']['cache_dir'] = '/var/cache/mod_auth_openid'
default['apache']['mod_auth_openid']['dblocation'] = "#{node['apache']['mod_auth_openid']['cache_dir']}/mod_auth_openid.db"

case node['platform_family']
when 'freebsd'
default['apache']['mod_auth_openid']['configure_flags'] = [
'CPPFLAGS=-I/usr/local/include',
'LDFLAGS=-I/usr/local/lib -lsqlite3'
]
else
default['apache']['mod_auth_openid']['configure_flags'] = []
end
default['apache']['mod_auth_openid']['configure_flags'] =
case node['platform_family']
when 'freebsd'
[
'CPPFLAGS=-I/usr/local/include',
'LDFLAGS=-I/usr/local/lib -lsqlite3'
]
else
[]
end
10 changes: 5 additions & 5 deletions recipes/mod_fastcgi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
backup false
end

if platform_family?('debian')
top_dir = node['apache']['build_dir']
else
top_dir = node['apache']['lib_dir']
end
top_dir = if platform_family?('debian')
node['apache']['build_dir']
else
node['apache']['lib_dir']
end
include_recipe 'apache2::default'
bash 'compile fastcgi source' do
notifies :run, 'execute[generate-module-list]', :immediately if platform_family?('rhel')
Expand Down
12 changes: 6 additions & 6 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
:group => property[:apache][:root_group],
:mode => '0644'
)
expect(chef_run).to render_file("#{property[:apache][:conf]}").with_content(/AccessFileName[\s]*\.htaccess/)
expect(chef_run).to render_file("#{property[:apache][:conf]}").with_content(/Files ~ \"\^\\\.ht\"/)
expect(chef_run).to render_file(property[:apache][:conf]).with_content(/AccessFileName[\s]*\.htaccess/)
expect(chef_run).to render_file(property[:apache][:conf]).with_content(/Files ~ \"\^\\\.ht\"/)
end

subject(:apacheconf) { chef_run.template(property[:apache][:conf]) }
Expand Down Expand Up @@ -150,8 +150,8 @@
:source => "#{config}.conf.erb",
:owner => 'root',
:group => property[:apache][:root_group],
:mode => '0644',
:backup => false
:mode => '0644',
:backup => false
)
end

Expand Down Expand Up @@ -297,8 +297,8 @@
:group => property[:apache][:root_group],
:mode => '0644'
)
expect(chef_run).to render_file("#{property[:apache][:conf]}").with_content(/AccessFileName[\s]*\.customaccess/)
expect(chef_run).to render_file("#{property[:apache][:conf]}").with_content(/Files ~ \"\^\(\.cu\|\\\.ht\)\"/)
expect(chef_run).to render_file(property[:apache][:conf]).with_content(/AccessFileName[\s]*\.customaccess/)
expect(chef_run).to render_file(property[:apache][:conf]).with_content(/Files ~ \"\^\(\.cu\|\\\.ht\)\"/)
end
end

Expand Down
6 changes: 2 additions & 4 deletions spec/modules/mod_authn_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
it 'writes to the log' do
expect(chef_run).to write_log('Ignoring apache2::mod_authn_core. not available until apache 2.4')
end
else
if property[:apache][:version] == '2.4'
# it_should_behave_like 'an apache2 module', 'authn_core', false
end
elsif property[:apache][:version] == '2.4'
# it_should_behave_like 'an apache2 module', 'authn_core', false
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/support/shared_examples_for_apache_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
it "creates <apache_dir>/mods-available/#{module_name}.conf" do
expect(chef_run).to create_template("#{chef_run.node[:apache][:dir]}/mods-available/#{module_name}.conf").with(
:source => "mods/#{module_name}.conf.erb",
:mode => '0644'
:mode => '0644'
)
end

Expand All @@ -33,7 +33,7 @@

it "creates <apache_dir>/mods-available/#{module_name}.load" do
expect(chef_run).to create_file("#{chef_run.node[:apache][:dir]}/mods-available/#{module_name}.load").with(
:content => "LoadModule #{module_name}_module #{chef_run.node[:apache][:libexec_dir]}/#{module_filename}\n",
:content => "LoadModule #{module_name}_module #{chef_run.node[:apache][:libexec_dir]}/#{module_filename}\n",
:mode => '0644'
)
end
Expand Down

0 comments on commit 7b3b985

Please sign in to comment.