diff --git a/.gitignore b/.gitignore index cc9f0f9..84c0cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ www Tests/*/actual -spec/examples.txt diff --git a/AGENTS.md b/AGENTS.md index 6ecd80c..23ee274 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,14 +5,14 @@ This repository is a single Ruby static-site generator project (the legacy Swift - Generator code: `lib/pressa/` (entrypoint: `lib/pressa.rb`) - Build/deploy/draft tasks: `bake.rb` -- Tests: `spec/` +- Tests: `test/` - Site config: `site.toml`, `projects.toml` - Published posts: `posts/YYYY/MM/*.md` - Static and renderable public content: `public/` - Draft posts: `public/drafts/` - Generated output: `www/` (safe to delete/regenerate) -Keep new code under the existing `Pressa` module structure (for example `lib/pressa/posts`, `lib/pressa/projects`, `lib/pressa/views`, `lib/pressa/config`, `lib/pressa/utils`) and add matching specs under `spec/`. +Keep new code under the existing `Pressa` module structure (for example `lib/pressa/posts`, `lib/pressa/projects`, `lib/pressa/views`, `lib/pressa/config`, `lib/pressa/utils`) and add matching tests under `test/`. ## Setup, Build, Test, and Development Commands - Use `rbenv exec` for Ruby commands in this repository (for example `rbenv exec bundle exec ...`) to ensure the project Ruby version is used. @@ -52,8 +52,8 @@ Optional keys include `Tags`, `Link`, `Scripts`, and `Styles`. - Do not hand-edit generated files in `www/`. ## Testing Guidelines -- Use Minitest under `spec/` (for example `spec/posts`, `spec/config`, `spec/views`). -- Add regression specs for parser, rendering, feed, and generator behavior changes. +- Use Minitest under `test/` (for example `test/posts`, `test/config`, `test/views`). +- Add regression tests for parser, rendering, feed, and generator behavior changes. - Before submitting, run: - `rbenv exec bundle exec bake test` - `rbenv exec bundle exec bake coverage` diff --git a/Readme.md b/Readme.md index 9bb553f..e262e04 100644 --- a/Readme.md +++ b/Readme.md @@ -10,7 +10,7 @@ If what you want is an artisanal, hand-crafted, static site generator for your p - Generator core: `lib/pressa/` (entrypoint: `lib/pressa.rb`) - Build tasks and utility workflows: `bake.rb` -- Tests: `spec/` +- Tests: `test/` - Config: `site.toml` and `projects.toml` - Content: `posts/` and `public/` - Output: `www/` diff --git a/bake.rb b/bake.rb index 68cd709..be19b18 100644 --- a/bake.rb +++ b/bake.rb @@ -13,7 +13,7 @@ PUBLISH_HOST = "mudge".freeze PRODUCTION_PUBLISH_DIR = "/var/www/samhuri.net/public".freeze BETA_PUBLISH_DIR = "/var/www/beta.samhuri.net/public".freeze WATCHABLE_DIRECTORIES = %w[public posts lib].freeze -LINT_TARGETS = %w[bake.rb Gemfile lib spec].freeze +LINT_TARGETS = %w[bake.rb Gemfile lib test].freeze BUILD_TARGETS = %w[debug mudge beta release].freeze # Generate the site in debug mode (localhost:8000) @@ -217,7 +217,7 @@ end private def run_test_suite(test_files) - run_command("ruby", "-Ilib", "-Ispec", "-e", "ARGV.each { |file| require File.expand_path(file) }", *test_files) + run_command("ruby", "-Ilib", "-Itest", "-e", "ARGV.each { |file| require File.expand_path(file) }", *test_files) end def run_coverage(test_files:, lowest_count:) @@ -226,8 +226,8 @@ def run_coverage(test_files:, lowest_count:) end def test_file_list(chdir: Dir.pwd) - test_files = Dir.chdir(chdir) { Dir.glob("spec/**/*_test.rb").sort } - abort "Error: no tests found in spec/**/*_test.rb under #{chdir}" if test_files.empty? + test_files = Dir.chdir(chdir) { Dir.glob("test/**/*_test.rb").sort } + abort "Error: no tests found in test/**/*_test.rb under #{chdir}" if test_files.empty? test_files end @@ -277,7 +277,7 @@ def coverage_script(lowest_count:) end def capture_coverage_output(test_files:, lowest_count:, chdir:) - capture_command("ruby", "-Ilib", "-Ispec", "-e", coverage_script(lowest_count:), *test_files, chdir:) + capture_command("ruby", "-Ilib", "-Itest", "-e", coverage_script(lowest_count:), *test_files, chdir:) end def parse_coverage_percent(output) diff --git a/spec/config/loader_test.rb b/test/config/loader_test.rb similarity index 100% rename from spec/config/loader_test.rb rename to test/config/loader_test.rb diff --git a/spec/config/simple_toml_test.rb b/test/config/simple_toml_test.rb similarity index 100% rename from spec/config/simple_toml_test.rb rename to test/config/simple_toml_test.rb diff --git a/spec/plugin_test.rb b/test/plugin_test.rb similarity index 100% rename from spec/plugin_test.rb rename to test/plugin_test.rb diff --git a/spec/posts/json_feed_test.rb b/test/posts/json_feed_test.rb similarity index 100% rename from spec/posts/json_feed_test.rb rename to test/posts/json_feed_test.rb diff --git a/spec/posts/metadata_test.rb b/test/posts/metadata_test.rb similarity index 100% rename from spec/posts/metadata_test.rb rename to test/posts/metadata_test.rb diff --git a/spec/posts/models_test.rb b/test/posts/models_test.rb similarity index 100% rename from spec/posts/models_test.rb rename to test/posts/models_test.rb diff --git a/spec/posts/plugin_test.rb b/test/posts/plugin_test.rb similarity index 100% rename from spec/posts/plugin_test.rb rename to test/posts/plugin_test.rb diff --git a/spec/posts/repo_test.rb b/test/posts/repo_test.rb similarity index 100% rename from spec/posts/repo_test.rb rename to test/posts/repo_test.rb diff --git a/spec/posts/rss_feed_test.rb b/test/posts/rss_feed_test.rb similarity index 100% rename from spec/posts/rss_feed_test.rb rename to test/posts/rss_feed_test.rb diff --git a/spec/posts/writer_test.rb b/test/posts/writer_test.rb similarity index 100% rename from spec/posts/writer_test.rb rename to test/posts/writer_test.rb diff --git a/spec/projects/models_test.rb b/test/projects/models_test.rb similarity index 100% rename from spec/projects/models_test.rb rename to test/projects/models_test.rb diff --git a/spec/projects/plugin_test.rb b/test/projects/plugin_test.rb similarity index 100% rename from spec/projects/plugin_test.rb rename to test/projects/plugin_test.rb diff --git a/spec/site_generator_rendering_test.rb b/test/site_generator_rendering_test.rb similarity index 100% rename from spec/site_generator_rendering_test.rb rename to test/site_generator_rendering_test.rb diff --git a/spec/site_generator_test.rb b/test/site_generator_test.rb similarity index 100% rename from spec/site_generator_test.rb rename to test/site_generator_test.rb diff --git a/spec/site_test.rb b/test/site_test.rb similarity index 100% rename from spec/site_test.rb rename to test/site_test.rb diff --git a/spec/test_helper.rb b/test/test_helper.rb similarity index 100% rename from spec/test_helper.rb rename to test/test_helper.rb diff --git a/spec/utils/file_writer_test.rb b/test/utils/file_writer_test.rb similarity index 100% rename from spec/utils/file_writer_test.rb rename to test/utils/file_writer_test.rb diff --git a/spec/utils/markdown_renderer_test.rb b/test/utils/markdown_renderer_test.rb similarity index 100% rename from spec/utils/markdown_renderer_test.rb rename to test/utils/markdown_renderer_test.rb diff --git a/spec/views/layout_test.rb b/test/views/layout_test.rb similarity index 100% rename from spec/views/layout_test.rb rename to test/views/layout_test.rb diff --git a/spec/views/rendering_test.rb b/test/views/rendering_test.rb similarity index 100% rename from spec/views/rendering_test.rb rename to test/views/rendering_test.rb