Skip to content

Commit

Permalink
Add additional test for foreman::foreman()
Browse files Browse the repository at this point in the history
This is to make sure using Puppet::ParseError is still valid to raise.
  • Loading branch information
ekohl committed Nov 13, 2023
1 parent b32cfdf commit 71c411c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/functions/foreman_foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
is_expected.to run.with_params().and_raise_error(ArgumentError)
end

it 'should throw an error with filter_result=true' do
is_expected.to run.with_params('hosts', 'hostgroup=Grid', '20', 'https://foreman.example.com', 'my_api_foreman_user', 'my_api_foreman_pass', 10, true).and_raise_error(Puppet::ParseError, /Foreman: Invalid filter_result/)
end

it 'should succeed with no timeout specified' do
stub_request(:get, "https://foreman.example.com/api/hosts?per_page=20&search=hostgroup=Grid").
with(basic_auth: ['my_api_foreman_user', 'my_api_foreman_pass']).
Expand Down

0 comments on commit 71c411c

Please sign in to comment.