Generate the test fixtures from a rake task - #63
Merged
Conversation
`rake fixtures:build` now builds every file in `spec/fixtures`. The shapefiles are squares on a regular grid in NAD83 / UTM zone 11N, written with `ogr2ogr`; the KML and GeoJSON documents are the same squares in round degrees; and the JPEGs embedded in `kmz_with_images.kmz` come from a constant, so the task needs no image tooling. Each fixture keeps the structure its specs exercise — the missing component, the `.shx` whose basename does not match the `.shp`, the `__MACOSX` decoy carrying a real extension, the single-vertex LineString, the null geometry, the name longer than the name column — and every feature count is unchanged, so the assertions that were about behaviour still are. Layer, placemark and attribute names are generic, and the three specs that named a component file or an overlay were updated to match. `tasks/` is outside the gemspec's `s.files`, so the task stays in the repository, and the `Dir[]` that loads it from the `Rakefile` finds nothing when the gem is unpacked on its own. The fixture directory drops from 3.2 MB to 116 KB. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bundle exec rake fixtures:buildnow builds every file inspec/fixtures.The shapefiles are squares on a regular grid in NAD83 / UTM zone 11N, written with
ogr2ogr. The KML and GeoJSON documents are the same squares in round degrees. The JPEGs embedded inkmz_with_images.kmzcome from a constant in the task, so the only external tool involved isogr2ogr, which is already needed to run the suite.Each fixture keeps the structure its specs exercise — the missing component, the
.shxwhose basename does not match the.shp, the__MACOSXdecoy carrying a real extension, the single-vertex LineString, the null geometry, the name longer than the name column. Every feature count is unchanged, so the assertions that were about behaviour still are. Layer, placemark and attribute names are generic, and three specs that named a component file or an overlay were updated to match.tasks/sits outside the gemspec'ss.files, so the task stays in the repository. TheDir[]that loads it from theRakefilereturns an empty array when the gem is unpacked on its own, so nothing changes for consumers.The fixture directory drops from 3.2 MB to 116 KB. Full suite is green locally: 266 examples, 0 failures.
🤖 Generated with Claude Code
https://claude.ai/code/session_017uHh49RG66T3qNFNRnPY6s