intersection_spec.rb 1.6 KB

12345678910111213141516171819202122
  1. require 'spec_helper'
  2. describe 'intersection' do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
  5. it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
  6. it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) }
  7. it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError) }
  8. it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError) }
  9. it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError) }
  10. it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError) }
  11. it { is_expected.to run.with_params([], []).and_return([]) }
  12. it { is_expected.to run.with_params([], ['one']).and_return([]) }
  13. it { is_expected.to run.with_params(['one'], []).and_return([]) }
  14. it { is_expected.to run.with_params(['one'], ['one']).and_return(['one']) }
  15. it { is_expected.to run.with_params(%w[one two three], %w[two three]).and_return(%w[two three]) }
  16. it { is_expected.to run.with_params(%w[ōŋể ŧשợ ţђŕẽё], %w[ŧשợ ţђŕẽё]).and_return(%w[ŧשợ ţђŕẽё]) }
  17. it { is_expected.to run.with_params(%w[one two two three], %w[two three]).and_return(%w[two three]) }
  18. it { is_expected.to run.with_params(%w[one two three], %w[two two three]).and_return(%w[two three]) }
  19. it { is_expected.to run.with_params(%w[one two three], %w[two three four]).and_return(%w[two three]) }
  20. it 'does not confuse types' do is_expected.to run.with_params(%w[1 2 3], [1, 2]).and_return([]) end
  21. end