DBDelve
DBDelve는 Rust 기반 빠른 다중 엔진 데이터베이스 클라이언트, 무료 오픈소스, 텔레메트리 없음
Ruby 코드 커버리지를 제공하고 강력한 설정 라이브러리와 테스트 간 자동 병합을 지원합니다
Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites
개발 도구Ruby · TypeScriptGitHub @simplecov-ruby직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Code coverage for Ruby
SimpleCov is a code coverage analysis tool for Ruby. It uses Ruby's built-in Coverage library to gather coverage data, but makes processing the results much easier by providing a clean API to filter, group, merge, format, and display them. You can get a full coverage setup running in a couple of lines of code.
SimpleCov tracks covered Ruby code.
In most cases you'll want overall coverage results spanning all of your tests (unit, integration, etc.). SimpleCov handles this automatically by caching and merging results as it generates reports, so a report reflects coverage across your whole test suite and gives you a truer picture of your blank spots.
SimpleCov bundles two formatters: the default HTML formatter (which renders the
browsable report) and a JSON formatter. Both were once separate gems
(simplecov-html and simplecov_json_formatter) but are now built into
SimpleCov and configured automatically when you launch it. A wide variety of
alternate formatters are distributed as gems.
Add SimpleCov to your Gemfile and bundle install:
gem 'simplecov', require: false, group: :test
Load and launch SimpleCov at the very top of your test helper, whether
that's test/test_helper.rb, spec/spec_helper.rb, rails_helper.rb, or
Cucumber's features/support/env.rb. SimpleCov doesn't care which framework
you run. It watches what code executes and reports on it, so the same two
lines work everywhere:
require 'simplecov'
SimpleCov.start
# Previous content of test helper now starts here
Important:
SimpleCov.startmust run before any of your application code is required. Otherwise SimpleCov (and the underlying Coverage library) can't track those files. This bites hardest with tools that keep your app loaded between runs, like Spring. See the Spring section.
SimpleCov must run in the process you want to analyze. When you test a
server process (e.g. a JSON API) from a separate test process (e.g. via
Selenium) and want to see all the code the rails server executes, not just
the code in your test files, require SimpleCov in the server process. For
Rails, add this near the top of bin/rails, below the shebang and after
config/boot is required:
if ENV['RAILS_ENV'] == 'test'
require 'simplecov'
SimpleCov.start 'rails'
end
Run your full test suite to see your application's coverage.
Open the HTML report in your default browser:
simplecov open
(The bundled simplecov CLI picks the right opener for your platform:
open on macOS, xdg-open on Linux/BSD, start on Windows. Pass
--report PATH to open a non-default location. See the
command-line interface for the full set of subcommands.)
Optionally, keep coverage results out of Git:
echo coverage >> .gitignore
For Rails applications, SimpleCov ships a built-in rails
profile that sets up groups for your
Controllers, Models, Helpers, and Libraries:
require 'simplecov'
SimpleCov.start 'rails'
Configuration goes in your start block, or in a .simplecov file at the
project root when several test suites share it. The API is built around a
small set of consistent verbs: formatters are picked by name, thresholds
live in a per-criterion coverage block where scope is a uniform per:
argument, and misses can be capped as absolute counts rather than ratios:
SimpleCov.start do
enable_coverage :branch # track branches as well as lines
cover "{app,lib}/**/*.rb" # report on these files, even if never loaded
skip "app/legacy" # ...but leave these out
group "Models", "app/models" # organize the report into groups
coverage :line do
minimum 90 # fail the suite below 90% line coverage
maximum_drop 1 # ...or when coverage drops more than 1%
maximum_missed 5, per: :file # no file may carry more than 5 uncovered lines
end
coverage :branch, minimum: 80, ignore: :implicit_else
end
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗