Skip to content
This repository has been archived by the owner on Jan 9, 2021. It is now read-only.

Commit

Permalink
update geoip tests, remove focus
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman committed Nov 23, 2014
1 parent d83f333 commit 2dff9bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 6 additions & 7 deletions spec/unit/recipes/http_geoip_module_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Encoding: utf-8
require 'spec_helper'
# encoding: utf-8

describe 'nginx::http_geoip_module', :focus do
let(:chef_run) do
describe 'nginx::http_geoip_module' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['nginx']['source']['modules'] = ['nginx::http_geoip_module']
end.converge(described_recipe)
end

# TODO: additional resources are cloned during ChefSpec runs,
# leading to inaccurate counts.
it 'retrieves remote files to cache' do
expect(chef_run).to create_remote_file("#{Chef::Config['file_cache_path']}/GeoIP-1.6.3.tar.gz")
geoip_version = chef_run.node.attributes['nginx']['geoip']['lib_version']

expect(chef_run).to create_remote_file("#{Chef::Config['file_cache_path']}/GeoIP-#{geoip_version}.tar.gz")
expect(chef_run).to create_remote_file("#{Chef::Config['file_cache_path']}/GeoIP.dat.gz")
expect(chef_run).to create_remote_file("#{Chef::Config['file_cache_path']}/GeoLiteCity.dat.gz")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
require_relative 'spec_helper'

describe file('/etc/nginx/conf.d/http_geoip.conf') do
it { should be_file }
it { should be_a_file }

its(:content) { should match(%r{/srv/geoip/GeoIP.dat}) }
end

describe file('/usr/local/lib/libGeoIP.so') do
it { should be_a_file }
end

# FIXME: This will not sustain a version update
describe command('/opt/nginx-1.4.4/sbin/nginx -V') do
its(:stdout) { should match(/--with-http_geoip_module/) }
Expand Down

0 comments on commit 2dff9bf

Please sign in to comment.