From 1f5827661b7d24893b67cbaf5a025daa8802aba0 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Sat, 5 Aug 2023 09:44:40 -0400 Subject: [PATCH] Added code coverage. --- .coveralls.yml | 2 ++ .github/workflows/test.yml | 6 ++++++ .gitignore | 1 + Gemfile | 1 + README.md | 1 + spec/spec_helper.rb | 7 +++++++ 6 files changed, 18 insertions(+) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 00000000..3501cd0a --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: github + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26c27ed3..3d37be2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,3 +35,9 @@ jobs: run: | bundle install bundle exec rake + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Coveralls Finished + uses: coverallsapp/github-action@master \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1f4d35ad..48c3e669 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ .rspec_status Gemfile.lock pkg +coverage diff --git a/Gemfile b/Gemfile index bfd457f1..67ad4467 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :test do gem 'rubocop-performance' gem 'rubocop-rake' gem 'rubocop-rspec' + gem 'simplecov-lcov' gem 'timecop' gem 'vcr' gem 'webmock' diff --git a/README.md b/README.md index 5729a19f..27c79d74 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Slack Ruby Client [![Integration Tests](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integration_test.yml/badge.svg?branch=master)](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integration_test.yml) [![Tests](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/test.yml) [![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client) +[![Coverage Status](https://coveralls.io/repos/github/slack-ruby/slack-ruby-client/badge.svg?branch=master)](https://coveralls.io/github/slack-ruby/slack-ruby-client?branch=master) A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messaging](https://api.slack.com/rtm) and [Events](https://api.slack.com/events-api) APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html). diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f57133b5..d890b5f2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,13 @@ require 'rspec' require 'timecop' +require 'simplecov-lcov' +SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = 'coverage/lcov.info' +end +SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter + require 'slack_ruby_client' Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each do |file|