Skip to content

Commit 0eeb75d

Browse files
committed
Fix CI with latest yard
Monkey patching libraries is a bad idea. Latest version of yard changed some internal details, which broke CI. A workaround was proposed in #401 but the root cause was not addressed. In this commit, we replace the private `io` object with an instance of a class that provide the expected `IO#write` method instead of `nil` which does not provide this interface in CI, so that the issue is not raised anymore.
1 parent a4be216 commit 0eeb75d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

puppet-strings.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
2323
s.files = Dir['CHANGELOG.md', 'README.md', 'LICENSE', 'lib/**/*', 'exe/**/*']
2424

2525
s.add_runtime_dependency 'rgen', '~> 0.9'
26-
s.add_runtime_dependency 'yard', '~> 0.9', '< 0.9.37'
26+
s.add_runtime_dependency 'yard', '~> 0.9'
2727
s.requirements << 'puppet, >= 7.0.0'
2828
end

spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
require 'spec_helper'
44
require 'puppet-strings/yard'
55

6+
class NullLogger
7+
def write(_message); end
8+
end
9+
610
describe PuppetStrings::Yard::Handlers::Ruby::DataTypeHandler, if: TEST_PUPPET_DATATYPES do
711
subject(:spec_subject) do
812
YARD::Parser::SourceParser.parse_string(source, :ruby)
@@ -19,7 +23,7 @@
1923
end
2024

2125
def suppress_yard_logging
22-
YARD::Logger.instance.io = nil
26+
YARD::Logger.instance.io = NullLogger.new
2327
end
2428

2529
describe 'parsing source without a data type definition' do

0 commit comments

Comments
 (0)