Skip to content

Commit

Permalink
Add spec to test exit hook for Minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
adam12 committed Dec 1, 2019
1 parent 45e95cd commit 72ec647
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/defaults_spec.rb
Expand Up @@ -38,4 +38,11 @@ def filtered?(config, filename)
expect(filtered?(config, "config/environment.rb")).to be
end
end

context "exit hook" do
it "uses Minitest if available" do
expect { system RbConfig.ruby, "spec/fixtures/frameworks/minitest.rb" }
.to output(Regexp.new(Regexp.escape("4 / 5 LOC (80.0%) covered"))).to_stdout_from_any_process
end
end
end
13 changes: 13 additions & 0 deletions spec/fixtures/frameworks/minitest.rb
@@ -0,0 +1,13 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "..", ".."))

require "minitest/autorun"
require "lib/simplecov"
SimpleCov.start

require_relative "../app/models/user"

class TestUser < Minitest::Test
def test_it_works
assert Foo.new
end
end

0 comments on commit 72ec647

Please sign in to comment.