mirror of
https://github.com/usetrmnl/trmnl-liquid.git
synced 2026-04-29 13:43:18 -07:00
This simplfies the date/time logic so only `Time` is used since `DateTime` is more of a relic because it's less performant, doesn't handle daylight savings time, and isn't based on the Gregorian calendar (which is what is most used these days). These changes allow us to reach 95% line coverage as a minimum. The reason branch converage isn't there is because of all of the fallback logic which still needs to be addressed. Milestone: patch
48 lines
1.2 KiB
Ruby
48 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require "simplecov"
|
|
|
|
unless ENV["COVERAGE"] == "no"
|
|
SimpleCov.start do
|
|
add_filter %r(^/spec/)
|
|
enable_coverage :branch
|
|
enable_coverage_for_eval
|
|
minimum_coverage_by_file line: 95, branch: 69
|
|
end
|
|
end
|
|
|
|
Bundler.require :tools
|
|
|
|
require "refinements"
|
|
require "trmnl/liquid"
|
|
|
|
SPEC_ROOT = Pathname(__dir__).realpath.freeze
|
|
|
|
using Refinements::Pathname
|
|
|
|
RSpec.configure do |config|
|
|
config.color = true
|
|
config.disable_monkey_patching!
|
|
config.example_status_persistence_file_path = "./tmp/rspec-examples.txt"
|
|
config.filter_run_when_matching :focus
|
|
config.formatter = ENV.fetch("CI", false) == "true" ? :progress : :documentation
|
|
config.order = :random
|
|
config.pending_failure_output = :no_backtrace
|
|
config.shared_context_metadata_behavior = :apply_to_host_groups
|
|
config.warnings = true
|
|
|
|
config.expect_with :rspec do |expectations|
|
|
expectations.syntax = :expect
|
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
end
|
|
|
|
config.mock_with :rspec do |mocks|
|
|
mocks.verify_doubled_constant_names = true
|
|
mocks.verify_partial_doubles = true
|
|
end
|
|
|
|
config.before(:suite) { TRMNL::Liquid.load :rails }
|
|
|
|
Kernel.srand config.seed
|
|
end
|