Debian Codegraph @

spec/classes/ceph_conf_spec.rb

raw
1 #
2 # Copyright (C) 2013 Cloudwatt <[email protected]>
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # Author: Loic Dachary <[email protected]>
17 #
18 require 'spec_helper'
19
20 describe 'ceph::conf' do
21 let :params do
22 {
23 :args => {
24 'A' => {
25 'value' => 'AA VALUE',
26 },
27 'B' => { }
28 },
29 :defaults => {
30 'value' => 'DEFAULT',
31 },
32 }
33 end
34
35 shared_examples 'ceph::conf' do
36 context 'with specified parameters' do
37 it {
38 should contain_ceph_config('A').with_value('AA VALUE')
39 should contain_ceph_config('B').with_value('DEFAULT')
40 }
41 end
42 end
43
44 on_supported_os({
45 :supported_os => OSDefaults.get_supported_os
46 }).each do |os,facts|
47 context "on #{os}" do
48 let (:facts) do
49 facts.merge!(OSDefaults.get_facts())
50 end
51
52 it_behaves_like 'ceph::conf'
53 end
54 end
55 end