From 4fbdef67d038ff59e4cf8845c5ba57304ddf3832 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sun, 2 Feb 2014 21:01:18 +0100 Subject: [PATCH] Using Coveralls --- .coveralls.yml | 1 + .travis.yml | 2 ++ Gemfile | 1 + README.md | 2 ++ graphs.gemspec | 5 +++++ tests/tests.rb | 8 ++++++-- 6 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..9160059 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis-ci diff --git a/.travis.yml b/.travis.yml index d003ad0..335939e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,5 @@ rvm: - 1.9.3 - 2.0.0 - ruby-head +notifications: + email: false diff --git a/Gemfile b/Gemfile index fe92dd4..1f98e67 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +gem 'coveralls', require: false gem 'rake', :group => :test gem 'simplecov', :require => false, :group => :test gem 'test-unit', :group => :test diff --git a/README.md b/README.md index 56a3117..5094512 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Graphs.rb [![Build Status](https://travis-ci.org/bfontaine/Graphs.rb.png)](https://travis-ci.org/bfontaine/Graphs.rb) +[![Gem Version](https://badge.fury.io/rb/graphs.png)](http://badge.fury.io/rb/graphs) +[![Coverage Status](https://coveralls.io/repos/bfontaine/Graphs.rb/badge.png)](https://coveralls.io/r/bfontaine/Graphs.rb) This library allows you to perform some basic operations on graphs, with import/export from/to JSON and [GDF][gdf-format] files. diff --git a/graphs.gemspec b/graphs.gemspec index 612f268..b1f1ef5 100644 --- a/graphs.gemspec +++ b/graphs.gemspec @@ -17,4 +17,9 @@ Gem::Specification.new do |s| s.files = ['lib/graph.rb', 'lib/graphs/gdf.rb', 'lib/graphs/json.rb'] s.test_files = Dir.glob('tests/*tests.rb') s.require_path = 'lib' + + s.add_development_dependency 'simplecov' + s.add_development_dependency 'rake' + s.add_development_dependency 'test-unit' + s.add_development_dependency 'coveralls' end diff --git a/tests/tests.rb b/tests/tests.rb index 8120548..027c34d 100755 --- a/tests/tests.rb +++ b/tests/tests.rb @@ -1,13 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- +require 'coveralls' +Coveralls.wear! + require 'test/unit' -require 'tempfile' require 'simplecov' +require 'tempfile' test_dir = File.expand_path( File.dirname(__FILE__) ) -SimpleCov.start { add_filter '/tests/' } if ENV['COVERAGE'] +SimpleCov.formatter = Coveralls::SimpleCov::Formatter +SimpleCov.start { add_filter '/tests/' } require_relative '../lib/graph' require_relative '../lib/graphs/gdf'