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/CHANGELOG.md b/CHANGELOG.md index 79c8093a..d4af22f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * [#481](https://github.com/slack-ruby-client/pulls/481): Update API from [slack-api-ref@7c22d0b](https://github.com/slack-ruby/slack-api-ref/commit/7c22d0b) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#488](https://github.com/slack-ruby-client/pulls/488): Update API from [slack-api-ref@a45def2](https://github.com/slack-ruby/slack-api-ref/commit/a45def2) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#490](https://github.com/slack-ruby/slack-ruby-client/pull/490): Add changelog uri to gemspec - [@MatheusRich](https://github.com/MatheusRich). +* [#491](https://github.com/slack-ruby/slack-ruby-client/pull/491): Added code coverage - [@dblock](https://github.com/dblock). * Your contribution here. ### 2.1.0 (2023/03/17) diff --git a/Gemfile b/Gemfile index bfd457f1..52d9fd2d 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,8 @@ group :test do gem 'rubocop-performance' gem 'rubocop-rake' gem 'rubocop-rspec' + gem 'simplecov' + 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..119ef7d4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,15 @@ require 'rspec' require 'timecop' +require 'simplecov' +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 +SimpleCov.start + require 'slack_ruby_client' Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each do |file|