File tree Expand file tree Collapse file tree 5 files changed +57
-6
lines changed
Expand file tree Collapse file tree 5 files changed +57
-6
lines changed Original file line number Diff line number Diff line change 1+ Feature:
2+
3+ Scenario :
4+ Given SimpleCov for Minitest is configured with:
5+ """
6+ require 'simplecov'
7+ SimpleCov.start
8+ """
9+
10+ When I open the coverage report generated with `bundle exec rake minitest`
11+ Then I should see the groups:
12+ | name | coverage | files |
13+ | All Files | 80 .0 % | 1 |
14+
15+ And I should see the source files:
16+ | name | coverage |
17+ | lib /faked_project /some_class .rb | 80 .0 % |
18+
Original file line number Diff line number Diff line change 2121# Gotta stash this a-s-a-p, see the CommandGuesser class and i.e. #110 for further info
2222SimpleCov ::CommandGuesser . original_run_command = "#{ $PROGRAM_NAME} #{ ARGV . join ( ' ' ) } "
2323
24- at_exit do
25- if defined? ( Minitest )
26- Minitest . after_run do
27- simplecov_at_exit
28- end
29- else
24+ if defined? ( Minitest )
25+ Minitest . after_run do
26+ simplecov_at_exit
27+ end
28+ else
29+ at_exit do
3030 simplecov_at_exit
3131 end
3232end
Original file line number Diff line number Diff line change @@ -6,3 +6,9 @@ Rake::TestTask.new(:test) do |test|
66 test . test_files = FileList [ "test/**/*_test.rb" ] . sort
77 test . verbose = true
88end
9+
10+ Rake ::TestTask . new ( :minitest ) do |test |
11+ test . libs << "minitest"
12+ test . test_files = FileList [ "minitest/**/*_test.rb" ] . sort
13+ test . verbose = true
14+ end
Original file line number Diff line number Diff line change 1+ require "test_helper"
2+ require "faked_project/some_class"
3+
4+ class SomeTest < Minitest ::Test
5+ def setup
6+ @instance = SomeClass . new ( "foo" )
7+ end
8+
9+ def test_reverse
10+ assert_equal "oof" , @instance . reverse
11+ end
12+
13+ def test_comparison
14+ assert @instance . compare_with ( "foo" )
15+ end
16+ end
Original file line number Diff line number Diff line change 1+ require "bundler/setup"
2+
3+ # We're injecting simplecov_config via aruba in cucumber here
4+ # depending on what the test case is...
5+ begin
6+ require File . join ( File . dirname ( __FILE__ ) , "simplecov_config" )
7+ rescue LoadError
8+ $stderr. puts "No SimpleCov config file found!"
9+ end
10+
11+ require "minitest/autorun"
You can’t perform that action at this time.
0 commit comments