Skip to content

Commit fdeb9b8

Browse files
author
Mattia Roccoberton
committed
test: minor test suite improvements
1 parent 694df64 commit fdeb9b8

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

lib/active_storage/service/db_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ module ActiveStorage
88
# Wraps a DB table as an Active Storage service. See ActiveStorage::Service
99
# for the generic API documentation that applies to all services.
1010
class Service::DBService < Service
11+
# :nocov:
1112
if Rails::VERSION::MAJOR >= 7
1213
include ActiveStorage::DBServiceRails70
1314
elsif Rails::VERSION::MAJOR == 6 && Rails::VERSION::MINOR == 1
1415
include ActiveStorage::DBServiceRails61
1516
else
1617
include ActiveStorage::DBServiceRails60
1718
end
19+
# :nocov:
1820

1921
def initialize(public: false, **)
2022
@chunk_size = ENV.fetch('ASDB_CHUNK_SIZE') { 1.megabytes }

spec/rails_helper.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616

1717
SimpleCov.start :rails do
1818
filters.clear
19+
20+
enable_coverage :branch
21+
1922
add_filter %r{^/lib/active_storage_db/version.rb}
2023
add_filter %r{^/spec/}
2124
add_filter %r{^/vendor/}
2225

2326
case ENV.fetch('RAILS', nil)
24-
when '6.0' then add_filter /_rails61|_rails70/
25-
when '6.1' then add_filter /_rails60|_rails70/
26-
when '7.0' then add_filter /_rails60|_rails61/
27+
when '6.1' then add_filter /_rails70|_rails71/
28+
when '7.0' then add_filter /_rails61|_rails71/
29+
when '7.1' then add_filter /_rails61|_rails70/
2730
end
2831
end
2932

spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# frozen_string_literal: true
22

33
RSpec.configure do |config|
4+
config.color = true
5+
config.default_formatter = :documentation
6+
config.tty = true
7+
config.order = :random
8+
49
config.expect_with :rspec do |expectations|
510
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
611
end

0 commit comments

Comments
 (0)