spec/unit/health_check_spec.rb in omnibus-5.2.0 vs spec/unit/health_check_spec.rb in omnibus-5.3.0
- old
+ new
@@ -137,20 +137,22 @@
/lib64/ld-linux-x86-64.so.2 (0x00007fe869252000)
EOH
)
end
+ let(:regexp) {".*(\\.[ch]|\\.e*rb|\\.gemspec|\\.gitignore|\\.h*h|\\.java|\\.js|\\.json|\\.lock|\\.log|\\.lua|\\.md|\\.mkd|\\.out|\\.pl|\\.pm|\\.png|\\.py[oc]*|\\.r*html|\\.rdoc|\\.ri|\\.sh|\\.sql|\\.toml|\\.ttf|\\.txt|\\.xml|\\.yml|Gemfile|LICENSE|README|Rakefile|VERSION)$|.*\\/share\\/doc\\/.*|.*\\/share\\/postgresql\\/.*|.*\\/share\\/terminfo\\/.*|.*\\/terminfo\\/.*"}
+
it 'raises an exception when there are external dependencies' do
allow(subject).to receive(:shellout)
- .with("find #{project.install_dir}/ -type f | xargs ldd")
+ .with("find #{project.install_dir}/ -type f -regextype posix-extended ! -regex '#{regexp}' | xargs ldd")
.and_return(bad_healthcheck)
expect { subject.run! }.to raise_error(HealthCheckFailed)
end
it 'does not raise an exception when the healthcheck passes' do
allow(subject).to receive(:shellout)
- .with("find #{project.install_dir}/ -type f | xargs ldd")
+ .with("find #{project.install_dir}/ -type f -regextype posix-extended ! -regex '#{regexp}' | xargs ldd")
.and_return(good_healthcheck)
expect { subject.run! }.to_not raise_error
end