| 1 |
# Copyright (C) 2013 Mirantis Inc. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
# |
| 15 |
# Author: Andrew Woodward <xarses> |
| 16 |
|
| 17 |
require 'puppet' |
| 18 |
require 'puppet/type/ceph_config' |
| 19 |
|
| 20 |
describe 'Puppet::Type.type(:ceph_config)' do |
| 21 |
|
| 22 |
before :each do |
| 23 |
@ceph_config = Puppet::Type.type(:ceph_config).new( |
| 24 |
:name => 'global/ceph_is_foo', :value => 'bar') |
| 25 |
end |
| 26 |
|
| 27 |
it 'should work bascily' do |
| 28 |
@ceph_config[:value] = 'max' |
| 29 |
expect(@ceph_config[:value]).to eq('max') |
| 30 |
end |
| 31 |
|
| 32 |
it 'should convert true to true' do |
| 33 |
@ceph_config[:value] = 'tRuE' |
| 34 |
expect(@ceph_config[:value]).to eq('true') |
| 35 |
end |
| 36 |
|
| 37 |
it 'should convert false to false' do |
| 38 |
@ceph_config[:value] = 'fAlSe' |
| 39 |
expect(@ceph_config[:value]).to eq('false') |
| 40 |
end |
| 41 |
end |