Skip to content

Commit

Permalink
Merge pull request #125 from paulca/main
Browse files Browse the repository at this point in the history
Loading minitest without initializing the plugin should work
  • Loading branch information
swebb authored Jun 20, 2022
2 parents 4a1d0fb + 17648d7 commit 04d19c0
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 04d19c0

Please sign in to comment.