hash_spec.rb 877 B

123456789101112131415
  1. require 'spec_helper'
  2. describe 'hash' do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
  5. it {
  6. pending('Current implementation ignores parameters after the first.')
  7. is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
  8. }
  9. it { is_expected.to run.with_params(['one']).and_raise_error(Puppet::ParseError, %r{Unable to compute}) }
  10. it { is_expected.to run.with_params([]).and_return({}) }
  11. it { is_expected.to run.with_params(%w[key1 value1]).and_return('key1' => 'value1') }
  12. it { is_expected.to run.with_params(['κ℮ұ1', '√āĺűẻ1']).and_return('κ℮ұ1' => '√āĺűẻ1') }
  13. it { is_expected.to run.with_params(%w[key1 value1 key2 value2]).and_return('key1' => 'value1', 'key2' => 'value2') }
  14. end