`bundle exec rake test` (minitest, a default gem but pinned in Gemfile for reproducibility) now covers what ad-hoc scripts kept re-verifying by hand during development: Gpx/Fit/TrackStats parsing, GpxStore/LiveTrackStore file/TTL logic, LiveTrackClient's payload parsing, and app.rb's routes end to end via Rack::MockRequest. MAPTOOL_DATA_DIR (new, app.rb) lets the suite point GPX_STORE/ LIVETRACK_STORE at a throwaway directory instead of real data/ — without it every run would leave uploaded test files behind. Each lib file's old `if __FILE__ == $0` self-check is now redundant with real tests covering the same ground, so removed rather than kept as a second copy of the same assertions. Wired into ci.yml so it isn't just a local convenience.
9 lines
155 B
Ruby
9 lines
155 B
Ruby
require "rake/testtask"
|
|
|
|
Rake::TestTask.new(:test) do |t|
|
|
t.libs << "test" << "lib"
|
|
t.test_files = FileList["test/test_*.rb"]
|
|
end
|
|
|
|
task default: :test
|