• Stars
    star
    191
  • Rank 202,877 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Covered

Development Status

Covered uses modern Ruby features to generate comprehensive coverage, including support for templates which are compiled into Ruby.

  • Incremental coverage - if you run your full test suite, and the run a subset, it will still report the correct coverage - so you can incrementally work on improving coverage.
  • Integration with RSpec, Minitest, Travis & Coveralls - no need to configure anything - out of the box support for these platforms.
  • Supports coverage of views - templates compiled to Ruby code can be tracked for coverage reporting.

Screenshot

Motivation

Existing Ruby coverage tools are unable to handle evaled code. This is because the coverage module built into Ruby doesn't expose the necessary hooks to capture it. Using the parser gem allows us to do our own source code analysis to compute executable lines, thus making it possible to compute coverage for "templates".

It's still tricky to do it correctly, but it is feasible now to compute coverage of web application "views" by using this technique. This gem is an exploration to see what is possible.

Installation

Add this line to your application's Gemfile:

gem 'covered'

RSpec Integration

In your spec/spec_helper.rb add the following before loading any other code:

require 'covered/rspec'

Ensure that you have a .rspec file with --require spec_helper:

--require spec_helper
--format documentation
--warnings

Minitest Integration

In your test/test_helper.rb add the following before loading any other code:

require 'covered/minitest'
require 'minitest/autorun'

In your test files, e.g. test/dummy_test.rb add the following at the top:

require_relative 'test_helper'

Usage

When running rspec, you can specify the kind of coverage analysis you would like:

COVERAGE=Summary rspec

If no COVERAGE is specified, coverage tracking will be finishd.

Partial Summary

COVERAGE=PartialSummary rspec

This report only shows snippets of source code with incomplete coverage.

Brief Summary

COVERAGE=BriefSummary rspec

This report lists several files in order of least coverage.l

Coveralls/Travis Integration

You can send coverage information to Coveralls by editing your .travis.yml file:

matrix:
  include:
    - rvm: 2.6
      env: COVERAGE=PartialSummary,Coveralls

This will print out a brief report and then upload the coverage data. This integrates transparently with Travis.

See Also

  • coveralls-ruby – the official Coveralls implementation for Ruby.
  • simplecov – one of the original coverage implementations for Ruby, uses the built-in coverage library.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Released under the MIT license.

Copyright, 2018, by Samuel G. D. Williams.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

relaxo

Relaxo is a transactional document database built on top of git.
Ruby
175
star
2

jquery-syntax

jQuery.Syntax is a light-weight client-side syntax highlighter.
JavaScript
129
star
3

rack-freeze

A policy framework for implementing thread-safe rack middleware.
Ruby
118
star
4

latinum

Latinum is a framework for resource and currency calculations.
Ruby
109
star
5

turbo_test

Ruby
102
star
6

bake

An alternative to rake, with all the great stuff and a sprinkling of magic dust.
Ruby
98
star
7

fingerprint

Fingerprint is a simple tool that can be used to verify the contents of a directory.
Ruby
71
star
8

script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
JavaScript
62
star
9

trenni

A fast native templating system that compiles directly to Ruby code.
Ruby
50
star
10

ffi-clang

Ruby FFI bindings for libclang 3.4+.
Ruby
43
star
11

markly

Ruby wrapper for libcmark, the CommonMark markdown parser.
C
35
star
12

samovar

Ruby
31
star
13

graphviz

A ruby interface for GraphViz graph visualisation toolkit.
Ruby
29
star
14

process-group

Manages a group of processes which can run concurrently using fibers.
Ruby
24
star
15

wtf

Ruby
24
star
16

github-actions-bin

Arch Linux package for GitHub Actions remote runner.
Shell
23
star
17

relaxo-model

A simple business logic model for Relaxo (git-backed database) written in Ruby.
Ruby
20
star
18

bake-test-external

Ruby
16
star
19

activerecord-migrations

A gem to simplify activerecord migrations in non-rails projects.
Ruby
15
star
20

universal-style-guide

14
star
21

periodical

Periodical is a simple framework for working with durations and periods.
Ruby
14
star
22

rack-test-body

Ruby
13
star
23

activerecord-rack

Ruby
13
star
24

rexec

RExec is a tool for executing ruby processes and code both locally and remotely.
Ruby
13
star
25

process-daemon

Define a daemon using a Ruby class, provides common functionality like start, stop.
Ruby
13
star
26

rubykaigi-2022

Ruby
12
star
27

geospatial

Geospatial provides abstractions for dealing with geographical locations efficiently.
Ruby
12
star
28

plotty

Ruby
12
star
29

decode

Ruby
12
star
30

mapping

Ruby
10
star
31

kai

A simple LISP style interpreter written in C++
C++
10
star
32

rubykaigi-2023

Ruby
10
star
33

vips-thumbnail

Ruby
9
star
34

boolean

Useful methods for working with Booleans
Ruby
8
star
35

vips

Ruby extension for the vips image processing library.
Ruby
8
star
36

time-zone

Ruby
8
star
37

collada

A Ruby library for loading and manipulating Collada .dae files.
Ruby
7
star
38

dream

Dream is a cross-platform framework for making games with C++.
C++
7
star
39

bake-gem

Ruby
6
star
40

bake-modernize

Ruby
6
star
41

zonestar-p802q-fan-duct

C++
6
star
42

synco

A Ruby DSL for running synchronisation and backup tasks.
Ruby
6
star
43

relaxo-query-server

The Relaxo Query Server provides support for executing CouchDB functions using Ruby.
Ruby
5
star
44

shell-environment

Provides a hook for accessing the user's login environment, e.g. PATH, etc, even when running from a non-login shell environment.
JavaScript
5
star
45

ffi-native

Ruby
5
star
46

fiber-storage

Ruby
5
star
47

hypercube2

OpenSCAD
5
star
48

parallel-merge-sort

A implementation of a fast lock-free parallel merge sort algorithm.
C++
5
star
49

git-heatmap

Ruby
4
star
50

goblin-hacker

Goblin Hacker is a save-game editor for Eschalon.
Objective-C
4
star
51

ioquatix

3
star
52

telescopic-tube-clamp

OpenSCAD
3
star
53

transform-flow-capture-ios

A tool for capturing video stream data sets for iOS devices.
Objective-C
3
star
54

presentations

Ruby
3
star
55

zork

Python
3
star
56

bake-test

Ruby
3
star
57

transform-flow

Transform Flow is a visualisation tool for mobile outdoor augmented reality data sets.
C++
3
star
58

transform-flow-capture-android

Java
3
star
59

jquery-xframe

A simple client-side include system using AJAX.
Ruby
3
star
60

tileshift

A genetic algorithm based platform game for Ludam Dare 2012.
JavaScript
3
star
61

print-agent

PrintAgent is a simple authentication system for CUPS.
Ruby
3
star
62

zonestar-p802q-bracing

OpenSCAD
3
star
63

build-environment

Ruby
3
star
64

bake-releases

Ruby
2
star
65

air-quality

C
2
star
66

jquery-syntax-dokuwiki

jQuery.Syntax DokuWiki Plugin.
PHP
2
star
67

hanging-door-roller

OpenSCAD
2
star
68

xapian-core

The latest Xapian core and Ruby bindings.
Ruby
2
star
69

transform-flow-browser-ios

An augmented reality framework using transform flow motion models for iOS.
Objective-C
2
star
70

activerecord-cursor

Ruby
2
star
71

activerecord-blanks

Ruby
2
star
72

jquery-syntax-wordpress

jQuery.Syntax WordPress Plugin
PHP
2
star
73

autocoverage

Ruby
2
star
74

fiber-annotation

Ruby
2
star
75

xapian-rack

Easily integrate Xapian with Rack.
Ruby
2
star
76

jquery-menu

jQuery.Menu is a simple pop-up menu script.
JavaScript
2
star
77

types

Ruby
2
star
78

vulkan-ruby

Ruby
2
star
79

xapian-indexer

Xapian Indexer is an indexing spider written in Ruby and based on Xapian
Ruby
2
star
80

bake-bundler

Ruby
2
star
81

geospatial-kml

Ruby
2
star
82

many

Ruby
1
star
83

utopia-gallery

An extension for utopia for displaying photo galleries.
Ruby
1
star
84

rack-go-http-client-redirect-bug

Ruby
1
star
85

dispatch-benchmark

Objective-C++
1
star
86

build-files-monitor

Ruby
1
star
87

build-makefile

Ruby
1
star
88

transform-flow-data

Sample data sets for Transform Flow.
1
star
89

build-dependency

Ruby
1
star
90

utopia-analytics

Ruby
1
star
91

activerecord-configurations

Manage multiple databases in Rails 5 and Rails 6 with elegance.
Ruby
1
star
92

bake-github-pages

Ruby
1
star
93

matx-case

OpenSCAD
1
star
94

eventplayer

EventPlayer is a simple JavaScript class to synchronise external events with <audio> and <video> tags.
JavaScript
1
star
95

www.codeotaku.com

My personal website.
JavaScript
1
star
96

computer-science-posters

1
star
97

post_remote_log

Post Remote Log is a simple multi-destination logging system.
Ruby
1
star
98

dream-examples

Examples demonstrating the various features of the Dream framework.
C++
1
star
99

build-graph

Build::Graph is a framework for build systems, with specific functionality for dealing with file based processes.
Ruby
1
star
100

Urban-Navigation

Navigation for urban environments.
Objective-C
1
star