puppet-vswitch/spec/unit/puppet/lib/functions/range_to_mask_spec.rb
Karthik S 677415b7d3 Added test case for the function range_to_mask()
Change-Id: Id189f19616a51485b104ecbef7cb5fce6356895d
Signed-off-by: Karthik S <ksundara@redhat.com>
2017-06-14 07:11:31 -04:00

13 lines
461 B
Ruby

require 'spec_helper'
require 'puppet'
describe 'range_to_mask', :type => :puppet_function do
# run with param
it { is_expected.to run.with_params('0-7,16-23,9').and_return('ff02ff') }
it { is_expected.to run.with_params('0,16,32,48,64').and_return('10001000100010001') }
# run with empty param
it { is_expected.to run.with_params('').and_return(nil) }
#run with params undefined
it { is_expected.to run.with_params(:undef).and_return(nil) }
end