Module: Eaco::Coverage
Overview
Integration with code coverage tools.
Loading this module will start collecting coverage data.
Instance Method Summary collapse
-
#format! ⇒ String
Formats coverage results using the default formatter.
-
#report! ⇒ nil
Reports coverage data to the remote service.
-
#result ⇒ SimpleCov::Result
private
The coverage result.
-
#simplecov ⇒ Class
private
Configures simplecov using #simplecov_configuration.
-
#simplecov_configuration ⇒ Proc
private
Configures
SimpleCovto use a different directory for each different appraisalGemfile. -
#start! ⇒ nil
Starts collecting coverage data.
Instance Method Details
#format! ⇒ String
Formats coverage results using the default formatter.
43 44 45 46 47 |
# File 'lib/eaco/coverage.rb', line 43 def format! Rake::Utils.capture_stdout do result && result.format! end.strip end |
#report! ⇒ nil
Reports coverage data to the remote service
31 32 33 34 35 36 |
# File 'lib/eaco/coverage.rb', line 31 def report! simplecov Coveralls.push! nil end |
#result ⇒ SimpleCov::Result (private)
The coverage result
56 57 58 |
# File 'lib/eaco/coverage.rb', line 56 def result simplecov.result end |
#simplecov ⇒ Class (private)
Configures simplecov using #simplecov_configuration
65 66 67 |
# File 'lib/eaco/coverage.rb', line 65 def simplecov SimpleCov.configure(&simplecov_configuration) end |
#simplecov_configuration ⇒ Proc (private)
Configures SimpleCov to use a different directory for each different appraisal Gemfile.
75 76 77 78 79 80 |
# File 'lib/eaco/coverage.rb', line 75 def simplecov_configuration proc do gemfile = Eaco::Rake::Utils.gemfile coverage_dir "coverage/#{gemfile}" end end |
#start! ⇒ nil
Starts collecting coverage data.
20 21 22 23 24 |
# File 'lib/eaco/coverage.rb', line 20 def start! Coveralls.wear_merged!(&simplecov_configuration) nil end |