From 86f298c9a09252165c6d3dc0e7fd2d6e0291c049 Mon Sep 17 00:00:00 2001 From: Stas Alekseev Date: Wed, 19 Jul 2017 21:07:11 -0400 Subject: [PATCH] Added unit test for mongodb_exporter --- spec/classes/mongodb_exporter_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/classes/mongodb_exporter_spec.rb diff --git a/spec/classes/mongodb_exporter_spec.rb b/spec/classes/mongodb_exporter_spec.rb new file mode 100644 index 000000000..b9a8c28a3 --- /dev/null +++ b/spec/classes/mongodb_exporter_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe 'prometheus::mongodb_exporter' do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts + end + + context 'with version specified' do + let(:params) do + { + version: '0.3.0', + arch: 'amd64', + os: 'linux' + } + end + + describe 'install correct binary' do + it { is_expected.to contain_file('/usr/local/bin/mongodb_exporter').with('target' => '/opt/mongodb_exporter-0.3.0.linux-amd64/mongodb_exporter') } + end + end + end + end +end