Skip to content

Commit

Permalink
Loading minitest without initializing the plugin should work
Browse files Browse the repository at this point in the history
  • Loading branch information
paulca committed Jun 16, 2022
1 parent 4a1d0fb commit 17648d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/minitest/buildkite_collector_plugin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Minitest
def self.plugin_buildkite_collector_init(options)
if Buildkite::TestCollector.respond_to?(:uploader)
if defined?(Buildkite::TestCollector::MinitestPlugin) && Buildkite::TestCollector.respond_to?(:uploader)
self.reporter << Buildkite::TestCollector::MinitestPlugin::Reporter.new(options[:io], options)
end
end
Expand Down
9 changes: 9 additions & 0 deletions spec/test_collector/minitest_plugin/without_plugin_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "minitest"

RSpec.describe "don’t break minitest when the plugin isn’t loaded" do
describe "running minitest" do
it "should not raise an error" do
expect { Minitest.run }.not_to raise_error
end
end
end

0 comments on commit 17648d7

Please sign in to comment.