Module: RSpec::Support::Coverage
- Defined in:
- lib/hanami/devtools/integration/coverage.rb
Overview
Code coverage support
Class Method Summary collapse
- .ci? ⇒ Boolean
- .configure! ⇒ Object
- .configure_simplecov! ⇒ Object
- .cover_as!(suite_name) ⇒ Object
- .enabled? ⇒ Boolean
Class Method Details
.ci? ⇒ Boolean
26 27 28 |
# File 'lib/hanami/devtools/integration/coverage.rb', line 26 def self.ci? !ENV["TRAVIS"].nil? end |
.configure! ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/hanami/devtools/integration/coverage.rb', line 9 def self.configure! return unless enabled? require "simplecov" require "coveralls" configure_simplecov! end |
.configure_simplecov! ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/hanami/devtools/integration/coverage.rb', line 35 def self.configure_simplecov! SimpleCov.formatter = Coveralls::SimpleCov::Formatter if ci? SimpleCov.start do add_filter "spec/" add_filter "script/" add_filter "tmp/" add_filter "vendor/" end end |
.cover_as!(suite_name) ⇒ Object
18 19 20 21 22 |
# File 'lib/hanami/devtools/integration/coverage.rb', line 18 def self.cover_as!(suite_name) return unless enabled? SimpleCov.command_name(suite_name) end |
.enabled? ⇒ Boolean
30 31 32 33 |
# File 'lib/hanami/devtools/integration/coverage.rb', line 30 def self.enabled? # !ENV['COVERAGE'].nil? false end |