Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (23 sloc) 700 Bytes
require 'rspec/core/rake_task'
desc 'Check code coverage'
task :coverage do
require_relative 'ohm'
err = ''
'components' => '',
'arithmetic' => 'Æ',
'constants' => 'α',
'extras' => '·',
'time' => 'υ'
}.each do |str, char|
file ="spec/#{str}_spec.rb", encoding: 'utf-8')
not_found = (
Ohm::COMPONENTS[char] ||
Ohm::COMPONENTS.reject {|_, h| h.keys.all? {|k| k.is_a?(String)}}
) {|c| char + c}.reject {|c| file.include?(c)}
err << "No tests found for #{not_found.join(', ')} in #{str} spec\n" unless not_found.empty?
abort err unless err.empty?
task default: [:test]
You can’t perform that action at this time.