Skip to content

Commit f8057d9

Browse files
committed
(PUP-10928) Fix indirected_routes_spec.rb for puppet#main
Unlike puppet#7.x (where the :allow_pson_serialization setting was first added), by default in puppet#main, pson is not a supported format so the rspec tests for :allow_pson_serialization were not able to test the desired behavior. This commit stubs out Puppet.features.pson? in those tests to stimulate that the puppet-pson library is present so pson is a supported format returned by accepted_response_formatters.
1 parent ea38db5 commit f8057d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/unit/network/http/api/indirected_routes_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
data = Puppet::IndirectorTesting.new("my data")
217217
indirection.save(data, "my data")
218218
request = a_request_that_finds(data, :accept_header => "unknown, text/pson")
219+
allow(Puppet.features).to receive(:pson?).and_return(true)
219220
allow(data).to receive(:to_pson).and_raise(Puppet::Network::FormatHandler::FormatError, 'Could not render to Puppet::Network::Format[pson]: source sequence is illegal/malformed utf-8')
220221

221222
expect {
@@ -267,6 +268,7 @@
267268
data = Puppet::IndirectorTesting.new("my data")
268269
indirection.save(data, "my data")
269270
request = a_request_that_searches(Puppet::IndirectorTesting.new("my"), :accept_header => "unknown, text/pson")
271+
allow(Puppet.features).to receive(:pson?).and_return(true)
270272
allow(data).to receive(:to_pson).and_raise(Puppet::Network::FormatHandler::FormatError, 'Could not render to Puppet::Network::Format[pson]: source sequence is illegal/malformed utf-8')
271273

272274
expect {

0 commit comments

Comments
 (0)