From 0aa5829e64d02bfc25b39dc53864b2cc73b52436 Mon Sep 17 00:00:00 2001 From: Alexander Senko Date: Thu, 10 Oct 2024 17:25:05 +0700 Subject: [PATCH] Tests: added coverage Use Code Climate for maintainability and coverage reports. --- .github/workflows/main.yml | 7 +++++-- Gemfile | 2 ++ README.md | 9 ++++++--- spec/spec_helper.rb | 5 +++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91c7d48..153e2ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,5 +28,8 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Run the default task - run: bundle exec rake + - uses: paambaati/codeclimate-action@master + env: + CC_TEST_REPORTER_ID: ce74ee3bee3aafbc805ece084e5e9a497bad09b089e2a7529e6087f926bc6f71 + with: + coverageCommand: bundle exec rake diff --git a/Gemfile b/Gemfile index 81e34af..19751df 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,8 @@ gem 'rake' group :test do gem 'rspec' gem 'rspec-its' + + gem 'simplecov', require: false end group :development do diff --git a/README.md b/README.md index 28c12ba..b1f05b4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # Magic::Lookup -TODO: Delete this and the text below, and describe your gem - -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/magic/lookup`. To experiment with that code, run `bin/console` for an interactive prompt. +![Code Climate maintainability]( + https://img.shields.io/codeclimate/maintainability-percentage/Alexander-Senko/magic-lookup +) +![Code Climate coverage]( + https://img.shields.io/codeclimate/coverage/Alexander-Senko/magic-lookup +) ## Installation diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4200cf9..1abc467 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,11 @@ # frozen_string_literal: true require 'rspec/its' +require 'simplecov' + +SimpleCov.start do + add_filter 'spec' +end require 'magic/lookup'