crawlscope 0.8.1 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89be661c49b5f2148a9d7962d81d522eedaedbba89c1f9dcf8474d62cfffd5f2
4
- data.tar.gz: d27a26792cc5cfdab191371c3d005cf43298b02896cb7cbdf2113a5f341e6c12
3
+ metadata.gz: 98bf07eeaad6b7d357c0df661e1c2194b8c8dbfff9a78aeba1df98e99b3bba0d
4
+ data.tar.gz: f6a1c2848ffce1bae4175be567788f853df6f2fc583e324b7fbe6258429a8471
5
5
  SHA512:
6
- metadata.gz: 5c90219d9430a09a3c95c5cb6367817cbc996f4ba69857781ddf6d2050373c9bfef2ad3de545a328542fa7362494df05be85cfa2c5e11f359b84870c8bee2ea6
7
- data.tar.gz: 632ddff7f77d1c0eb62e6f9db0c9a36f8c3c080d2ac3b6b93bc03fcea65453d916ecbf7b39eb34e9b16d750309e7814586e2a84b4cd0157609a47402bcccf8ef
6
+ metadata.gz: be3fb58b969d7b46081c31b000048c6f58e934ad8d44444dd4d71d017cd5fd5119e6efd669bf024e7a769900942381bd6938edd434ed3d82754773b3f613578c
7
+ data.tar.gz: 9c9a67eee2092834bbb4bd6ac285e277dd6ef22dfcb1083fc9fc2aa2e39ace412376c2b0929306ff367cf1ba8f70e3cd787f31bbc2336217ac64d0e4de488e79
data/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.1] - 2026-11-04
9
+
10
+
11
+ ### Documentation
12
+
13
+ - adopt Gemkit 0.2 and shorten shared guidance
14
+
15
+
16
+
17
+ ## [0.9.0] - 2026-11-04
18
+
19
+ ### Changed
20
+
21
+ - Require Ruby 4.0 or newer.
22
+ - Use published Gemkit 0.1.0 for shared verification and release PRs, with workflow callers pinned to the same release commit.
23
+
24
+ ### Added
25
+
26
+ - Support optional host-installed Rails 8 (`>= 8.0`, `< 9`), including explicit `crawlscope/rails` loading after the core.
27
+ - Reuse all packaged audit tasks in the repository, including indexability and content-quality checks.
28
+
29
+ ### Removed
30
+
31
+ - Remove Railties as a runtime dependency so the Ruby library and CLI work without Rails.
32
+ - Replace local tagging and hook bypasses with reviewed release PRs published by GitHub Actions.
33
+
8
34
  ## [0.8.1] - 2026-10-06
9
35
 
10
36
 
data/README.md CHANGED
@@ -32,7 +32,8 @@ The default rule set includes:
32
32
 
33
33
  ## Installation
34
34
 
35
- Crawlscope requires Ruby 3.3 or newer.
35
+ Crawlscope requires Ruby 4.0 or newer. Rails is optional; the CLI and Ruby
36
+ library run without it. Rails integration requires host-installed Rails 8.
36
37
 
37
38
  Add this line to your application's Gemfile:
38
39
 
@@ -222,6 +223,10 @@ metric names and reports each metric independently.
222
223
 
223
224
  ## Rails Usage
224
225
 
226
+ Install Rails 8 in the host application; Crawlscope does not install Railties.
227
+ For a process that loads Crawlscope before Rails, require `crawlscope/rails`
228
+ after Rails is available. The Ruby and CLI entry points remain independent of Rails.
229
+
225
230
  Run the install generator after adding the gem:
226
231
 
227
232
  ```bash
@@ -430,71 +435,6 @@ end
430
435
 
431
436
  That makes `crawlscope` useful as the audit engine while the app remains the owner of stricter product-specific schema rules.
432
437
 
433
- ## Development
434
-
435
- ```bash
436
- git clone https://github.com/ethos-link/crawlscope.git
437
- cd crawlscope
438
-
439
- bundle install
440
- bundle exec rake test
441
- bundle exec rake standard
442
- bundle exec rake
443
- ```
444
-
445
- ### Git hooks
446
-
447
- We use [lefthook](https://lefthook.dev/) with the Ruby
448
- [commitlint](https://github.com/arandilopez/commitlint) gem to enforce
449
- Conventional Commits on every commit. We also use
450
- [Standard Ruby](https://standardrb.com/) to keep code style consistent. CI
451
- validates commit messages, Standard Ruby, tests, and git-cliff changelog
452
- generation on pull requests and pushes to main/master.
453
-
454
- Run the hook installer once per clone:
455
-
456
- ```bash
457
- bundle exec lefthook install
458
- ```
459
-
460
- ### Install locally
461
-
462
- ```bash
463
- rake install
464
- ```
465
-
466
- ## Release
467
-
468
- Releases are tag-driven and published by GitHub Actions to RubyGems.
469
- Local release commands never publish directly.
470
-
471
- Install [git-cliff](https://git-cliff.org/) locally before preparing a
472
- release. The release task prepends the next `CHANGELOG.md` section from
473
- Conventional Commits.
474
-
475
- Before preparing a release, make sure you are on `main` or `master` with a
476
- clean worktree. If the release contains a breaking public-contract change,
477
- update `UPGRADE.md` with the host-app migration steps first.
478
-
479
- Then run one of:
480
-
481
- ```bash
482
- bundle exec rake 'release:prepare[patch]'
483
- bundle exec rake 'release:prepare[minor]'
484
- bundle exec rake 'release:prepare[major]'
485
- bundle exec rake 'release:prepare[0.1.0]'
486
- ```
487
-
488
- The task will:
489
-
490
- 1. Prepend the next `CHANGELOG.md` section with `git-cliff`.
491
- 1. Update `lib/crawlscope/version.rb`.
492
- 1. Commit the release changes.
493
- 1. Create and push the `vX.Y.Z` tag.
494
-
495
- The `Release` workflow then runs tests, publishes the gem to RubyGems,
496
- and creates the GitHub release from the changelog entry.
497
-
498
438
  ## Contributing
499
439
 
500
440
  1. Fork it
@@ -509,9 +449,31 @@ Please use [Conventional Commits](https://www.conventionalcommits.org/) for comm
509
449
 
510
450
  MIT License, see [LICENSE.txt](LICENSE.txt)
511
451
 
512
- ## About
452
+ ## Development and releases
453
+
454
+ Use published [Ethos Gemkit](https://github.com/ethos-link/ethos-gemkit) for shared
455
+ tooling. Keep the exact Gemfile version and workflow commit pins on the same release.
456
+
457
+ ```sh
458
+ bundle install
459
+ bundle exec lefthook install
460
+ bundle exec rake verify
461
+ ```
462
+
463
+ Tests use controlled local fixtures and need no service account. From clean,
464
+ current main, run `bundle exec rake 'release:prepare[patch]'`; review and merge
465
+ the generated PR to publish through Actions. Shared prerequisites, publisher
466
+ settings and failed-job recovery are in the [Gemkit guide](https://github.com/ethos-link/ethos-gemkit#releasing-a-gem).
467
+
468
+ ## Built by Ethos Link
513
469
 
514
- Made by the team at [Ethos Link](https://www.ethos-link.com) — practical software for growing businesses. We build tools for hospitality operators who need clear workflows, fast onboarding, and real human support.
470
+ [Ethos Link](https://www.ethos-link.com) builds business software and integrations
471
+ that replace manual handoffs with connected workflows. We help teams automate
472
+ routine work, use their data and improve the processes their business runs on.
515
473
 
516
- We also build [Reviato](https://www.reviato.com), “Capture. Interpret. Act.”.
517
- Turn guest feedback into clear next steps for your team. Collect private appraisals, spot patterns across reviews, and act before small issues turn into public ones.
474
+ - [Reviato](https://www.reviato.com): Read public review trends and collect
475
+ private customer feedback, so your team can decide what to improve.
476
+ - [EthosPlaces](https://www.ethos.place): Give customers the details they need to
477
+ choose and visit your business, from opening hours to directions.
478
+ - [Nuntio](https://www.nuntiohq.com): Draft, review and schedule social posts in
479
+ one workspace, then track each publishing result.
data/UPGRADE.md ADDED
@@ -0,0 +1,144 @@
1
+ # Upgrade Guide
2
+
3
+ ## 0.9.1
4
+
5
+ Development and release tooling uses Gemkit 0.2.0. Update the gem and workflow
6
+ pins together; see the [Gemkit upgrade guide](https://github.com/ethos-link/ethos-gemkit/blob/main/UPGRADE.md).
7
+ Runtime APIs are unchanged.
8
+
9
+ Use this file for host-app migration notes when a release changes public
10
+ contracts, required setup, component locals, generated assets, or runtime
11
+ behavior.
12
+
13
+ ## 0.9.0
14
+
15
+ ### Ruby 4 and optional Rails 8
16
+
17
+ Upgrade Ruby to 4.0 or newer before updating Crawlscope. Rails integrations now
18
+ require Rails 8 (`>= 8.0`, `< 9`). Upgrade the host Rails application when using
19
+ the generator or Railtie; plain Ruby and CLI callers do not need Rails.
20
+
21
+ Railties is no longer a runtime dependency. Rails applications must declare
22
+ Rails or Railties themselves. If Crawlscope loads before Rails, explicitly
23
+ require `crawlscope/rails` after the framework is available. Existing generated
24
+ initializers and `require "crawlscope/tasks"` loaders remain supported.
25
+
26
+ ### Release preparation
27
+
28
+ Development uses published Gemkit 0.1.0. Install the bundle and hooks with
29
+ `bundle install` and `bundle exec lefthook install`.
30
+ Run `release:prepare` from current main to open a verified release PR; merging
31
+ that PR triggers workflow publication. Local preparation no longer tags, pushes
32
+ main or bypasses hooks. Configure Crawlscope's RubyGems publisher as documented
33
+ in the README; the shared workflow does not inherit another gem's permission.
34
+
35
+ ## Next Release
36
+
37
+ ### Structured-data length errors include the measured size
38
+
39
+ String-length schema errors now include an optional `length` field with the
40
+ actual character count. Text reports show the measurement and limit, such as
41
+ `Article.headline: 125 characters; maximum 110`. Existing `field`, `issue`, and
42
+ `type` fields remain available, and `issue` retains the original validator
43
+ message. Applications that enforce exact error-object keys must accept `length`.
44
+
45
+ ### One warning per redirect or canonical mismatch
46
+
47
+ Sitemap redirects now emit only `sitemap_redirect_url`, rather than also emitting
48
+ `redirected_page`. Applications that match `redirected_page` must switch to
49
+ `sitemap_redirect_url`; `final_url` and final HTTP `status` remain in details.
50
+
51
+ Metadata and canonical-target checks skip redirect aliases, so the destination's
52
+ canonical is not compared with the redirect's original URL. Metadata checks still
53
+ run when the destination is itself in the crawl.
54
+
55
+ A directly served page with a different canonical emits one warning:
56
+ `non_canonical_page_in_sitemap` when it is in the sitemap, or `canonical_mismatch`
57
+ otherwise. Applications that previously counted both warnings should handle
58
+ either code as one mismatch.
59
+
60
+ Metadata length reports put the field and limit in the group heading; rows show
61
+ only the measured length. Server timing's page list now includes only durations
62
+ strictly greater than 50 ms. Aggregate timing statistics still include all
63
+ responses, and `result.server_timing_summary` retains all timing data.
64
+
65
+ ### Redirect URLs are excluded from uniqueness checks
66
+
67
+ Uniqueness checks now compare only HTML pages whose normalized requested and
68
+ final URLs match. Redirect aliases no longer produce duplicate-title,
69
+ duplicate-description, duplicate-text, or similar-text warnings from the
70
+ destination's content. Redirect issues remain in the crawl report. Separate
71
+ pages that serve identical content without a redirect are still checked.
72
+
73
+ No host-app configuration changes are required. Applications that count
74
+ uniqueness issues should expect fewer warnings when sitemap URLs redirect.
75
+
76
+ ### Clearer audit messages
77
+
78
+ Text reports now use plain-language group headings with severity counts and
79
+ show errors before warnings and notices. The repeated category summary is
80
+ removed. Structured-data errors show the type, field, and constraint on separate
81
+ lines (for example, `Article.headline: 125 characters; maximum 110`). Sitemap
82
+ redirects show the destination and its final HTTP status once, without the host
83
+ for same-origin URLs.
84
+ Canonical warnings now identify the canonical target and explain the mismatch.
85
+ Link warnings use `linked from` and `links to` to identify each URL's role.
86
+ Length and ratio warnings include the limit and units. Reports show every issue
87
+ and every related URL on separate lines. Duplicate-title and description values
88
+ are shown in full. Link rules retain all source and target URLs rather than
89
+ three samples. Missing-sitemap issues keep `source_url` and also provide
90
+ `source_urls` with all pages that link to the missing URL. Server timing retains
91
+ full descriptions and lists every page whose duration exceeds 50 ms.
92
+
93
+ Host applications that parse report text or issue messages must update their
94
+ matching patterns. Prefer issue codes and structured `details` for automation;
95
+ these retain their existing fields, including the original schema errors,
96
+ redirect status and final URL, and canonical href. No configuration changes are
97
+ required.
98
+
99
+ The former report limits `Reporter::MAX_ISSUES_PER_GROUP` and
100
+ `Rules::Links::MAX_SOURCES_IN_ERROR` are removed. Host applications that reference
101
+ these constants must remove those references.
102
+
103
+ ### Default sitemap is fetched over HTTP
104
+
105
+ Crawlscope no longer prefers `public/sitemap.xml` when validating a localhost
106
+ application. Without an explicit `SITEMAP` or configured `sitemap_path`, it now
107
+ fetches `/sitemap.xml` from the configured base URL so the crawl observes the
108
+ live application and database state.
109
+
110
+ The Rails installer now generates the same HTTP default. Regenerate or update
111
+ existing initializers that use `Rails.public_path.join("sitemap.xml")`.
112
+ Explicit local sitemap paths remain supported through `SITEMAP`, `--sitemap`,
113
+ or `config.sitemap_path`.
114
+
115
+ `CRAWLSCOPE_PROFILE_TOKEN` is now the portable default for standalone CLI, Rake,
116
+ Rails, and plain Ruby usage. Explicit `config.profile_token` values still take
117
+ precedence.
118
+
119
+ ### Server-Timing report output
120
+
121
+ No host configuration is required. When one or more responses publish a
122
+ `Server-Timing` header, the text report now includes an optional `Server Timing`
123
+ section. Host applications that parse report text should accept this additional
124
+ section.
125
+
126
+ Parsed metrics are available through `page.server_timing`, and aggregate data is
127
+ available through `result.server_timing_summary`. Crawlscope interprets `dur`
128
+ values as milliseconds and ignores malformed entries while reporting their
129
+ count.
130
+
131
+ ### Ruby 3.3 is now required
132
+
133
+ Crawlscope now depends on the current Async runtime for production async HTTP
134
+ fetching. Host applications must run Ruby 3.3 or newer before upgrading.
135
+
136
+ Recommended migration:
137
+
138
+ 1. Upgrade the host application runtime to Ruby 3.3 or newer.
139
+ 2. Run `bundle update crawlscope async async-http async-http-faraday`.
140
+ 3. Crawlscope now uses `FETCH_EXECUTOR=async` by default for HTTP crawling.
141
+ 4. Set `FETCH_EXECUTOR=threaded` or pass `--fetch-executor threaded` for a
142
+ conservative rollout or for explicit thread-pool execution.
143
+ 5. Browser rendering continues to use threaded execution by default because
144
+ async fetch execution is only supported with HTTP rendering.
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+ require "rails/railtie"
5
+ require "crawlscope"
6
+ require "crawlscope/railtie"
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rails"
4
+ require "rails/railtie"
5
+
6
+ unless Gem::Requirement.new(">= 8.0", "< 9").satisfied_by?(Gem.loaded_specs.fetch("railties").version)
7
+ raise LoadError, "crawlscope integration requires Rails 8.0 or newer within Rails 8"
8
+ end
9
+
3
10
  module Crawlscope
4
11
  class Railtie < Rails::Railtie
5
12
  rake_tasks do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crawlscope
4
- VERSION = "0.8.1"
4
+ VERSION = "0.9.1"
5
5
  end
data/lib/crawlscope.rb CHANGED
@@ -29,7 +29,7 @@ end
29
29
  Crawlscope.instance_variable_set(:@loader, Zeitwerk::Loader.for_gem)
30
30
  Crawlscope.loader.ignore("#{__dir__}/generators")
31
31
  Crawlscope.loader.ignore("#{__dir__}/tasks")
32
- Crawlscope.loader.ignore("#{__dir__}/crawlscope/railtie.rb")
32
+ Crawlscope.loader.ignore("#{__dir__}/crawlscope/railtie.rb", "#{__dir__}/crawlscope/rails.rb")
33
33
  Crawlscope.loader.ignore("#{__dir__}/crawlscope/tasks.rb")
34
34
  Crawlscope.loader.setup
35
35
 
@@ -15,6 +15,7 @@ class CrawlscopeLoaderTest < Minitest::Test
15
15
  script = <<~RUBY
16
16
  require "crawlscope"
17
17
 
18
+ abort "Rails loaded by the core" if defined?(Rails)
18
19
  loaded = $LOADED_FEATURES.grep(%r{/(?:async|faraday|json-schema|nokogiri)(?:/|\\.rb)})
19
20
  abort loaded.join("\\n") unless loaded.empty?
20
21
  RUBY
@@ -29,6 +30,30 @@ class CrawlscopeLoaderTest < Minitest::Test
29
30
  assert status.success?, stderr
30
31
  end
31
32
 
33
+ def test_explicit_rails_integration_loads_after_the_core_and_registers_tasks
34
+ script = <<~RUBY
35
+ require "crawlscope"
36
+ require "crawlscope/rails"
37
+
38
+ abort "Railtie missing" unless Crawlscope::Railtie < Rails::Railtie
39
+ app = Class.new(Rails::Application)
40
+ app.config.eager_load = false
41
+ app.load_tasks
42
+ %w[validate validate:ldjson validate:indexability validate:content_quality].each do |task|
43
+ abort "task missing: \#{task}" unless Rake::Task.task_defined?("crawlscope:\#{task}")
44
+ end
45
+ RUBY
46
+
47
+ _stdout, stderr, status = Open3.capture3(
48
+ RbConfig.ruby,
49
+ "-I#{File.expand_path("../../lib", __dir__)}",
50
+ "-e",
51
+ script
52
+ )
53
+
54
+ assert status.success?, stderr
55
+ end
56
+
32
57
  def test_task_entrypoint_registers_tasks
33
58
  script = <<~RUBY
34
59
  require "crawlscope/tasks"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crawlscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Fidalgo
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.16'
111
- - !ruby/object:Gem::Dependency
112
- name: railties
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '7.1'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '7.1'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: zeitwerk
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -150,20 +136,6 @@ dependencies:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
138
  version: '5.0'
153
- - !ruby/object:Gem::Dependency
154
- name: rake
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '13.0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '13.0'
167
139
  - !ruby/object:Gem::Dependency
168
140
  name: simplecov
169
141
  requirement: !ruby/object:Gem::Requirement
@@ -178,20 +150,6 @@ dependencies:
178
150
  - - "~>"
179
151
  - !ruby/object:Gem::Version
180
152
  version: '0.22'
181
- - !ruby/object:Gem::Dependency
182
- name: standard
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '1.0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '1.0'
195
153
  - !ruby/object:Gem::Dependency
196
154
  name: webmock
197
155
  requirement: !ruby/object:Gem::Requirement
@@ -219,6 +177,7 @@ files:
219
177
  - CHANGELOG.md
220
178
  - LICENSE.txt
221
179
  - README.md
180
+ - UPGRADE.md
222
181
  - exe/crawlscope
223
182
  - lib/crawlscope.rb
224
183
  - lib/crawlscope/browser.rb
@@ -235,6 +194,7 @@ files:
235
194
  - lib/crawlscope/issue.rb
236
195
  - lib/crawlscope/issue_collection.rb
237
196
  - lib/crawlscope/page.rb
197
+ - lib/crawlscope/rails.rb
238
198
  - lib/crawlscope/railtie.rb
239
199
  - lib/crawlscope/rake_tasks.rb
240
200
  - lib/crawlscope/reporter.rb
@@ -301,7 +261,6 @@ files:
301
261
  - test/performance/async_fetch_benchmark.rb
302
262
  - test/performance/fetch_executor_matrix.rb
303
263
  - test/performance/sitemap_expansion_benchmark.rb
304
- - test/release_task_test.rb
305
264
  - test/test_helper.rb
306
265
  homepage: https://www.ethos-link.com/opensource/crawlscope
307
266
  licenses:
@@ -323,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
323
282
  requirements:
324
283
  - - ">="
325
284
  - !ruby/object:Gem::Version
326
- version: 3.3.0
285
+ version: '4.0'
327
286
  required_rubygems_version: !ruby/object:Gem::Requirement
328
287
  requirements:
329
288
  - - ">="
@@ -1,86 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "test_helper"
4
- require "rake"
5
-
6
- unless respond_to?(:release_version, true)
7
- load File.expand_path("../Rakefile", __dir__)
8
- end
9
-
10
- class ReleaseTaskTest < Minitest::Test
11
- def test_release_version_increments_patch_from_current_version
12
- major, minor, patch = Crawlscope::VERSION.split(".").map(&:to_i)
13
-
14
- assert_equal "#{major}.#{minor}.#{patch + 1}", release_version("patch")
15
- end
16
-
17
- def test_release_version_accepts_explicit_semantic_version
18
- assert_equal "0.3.0", release_version("0.3.0")
19
- end
20
-
21
- def test_validate_release_version_rejects_current_version
22
- error = assert_raises(ArgumentError) do
23
- validate_release_version!("0.2.7", "0.2.7")
24
- end
25
-
26
- assert_equal(
27
- "Release version 0.2.7 must be newer than current version 0.2.7.",
28
- error.message
29
- )
30
- end
31
-
32
- def test_validate_release_version_rejects_existing_local_tag
33
- @local_release_tag_exists = true
34
- @remote_release_tag_exists = false
35
-
36
- error = assert_raises(ArgumentError) do
37
- validate_release_version!("0.2.8", "0.2.7")
38
- end
39
-
40
- assert_equal "Release tag v0.2.8 already exists locally.", error.message
41
- end
42
-
43
- def test_validate_release_version_rejects_existing_remote_tag
44
- @local_release_tag_exists = false
45
- @remote_release_tag_exists = true
46
-
47
- error = assert_raises(ArgumentError) do
48
- validate_release_version!("0.2.8", "0.2.7")
49
- end
50
-
51
- assert_equal "Release tag v0.2.8 already exists on origin.", error.message
52
- end
53
-
54
- def test_remote_release_tag_command_asks_git_to_fail_when_no_tag_matches
55
- assert_equal(
56
- "git ls-remote --exit-code --tags origin refs/tags/v0.2.8",
57
- remote_release_tag_command("v0.2.8")
58
- )
59
- end
60
-
61
- def test_changelog_command_prepends_the_next_release
62
- assert_equal(
63
- [
64
- "git-cliff",
65
- "-c",
66
- "cliff.toml",
67
- "--unreleased",
68
- "--tag",
69
- "v0.2.8",
70
- "--prepend",
71
- "CHANGELOG.md"
72
- ],
73
- changelog_command("0.2.8")
74
- )
75
- end
76
-
77
- private
78
-
79
- def local_release_tag_exists?(_tag)
80
- @local_release_tag_exists || false
81
- end
82
-
83
- def remote_release_tag_exists?(_tag)
84
- @remote_release_tag_exists || false
85
- end
86
- end