turbo_rspec 0.7.0 → 1.0.0

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: 3049c79cdd7a1c8b6dc2447fb2034458f129b900343dcc759e5f8b1ae200189b
4
- data.tar.gz: ca51420063475b7870a6d77e95d0e4b33f5d2b0e725c4f9b2419acdd4dbb4cd9
3
+ metadata.gz: '036718d6f9e9e1960f6e12b668a288c6562ec914aa87eaaaddacfbccb47fc2fd'
4
+ data.tar.gz: 6f0345d41a0803871c89fbbbaa9e7e1e30b7ca155e9d60b8c41052a1fe0c59e6
5
5
  SHA512:
6
- metadata.gz: 3e096c87e0b36b9c291308e95a30f075c4c3761d25c9b2d6779647a5e6ace92ed7ff60b5e04cd31b837611dfe92098067a9cb7a4c302e8c12d26eba7bd0d6840
7
- data.tar.gz: 82fcd0aaf837b61d78c079619d52ab99d79d99bc6d2eafec7cd1ce56f0a6558e3b69748928fadbc81fc0651b8910c4b0d44d45795f623c183b012ff423bf44e2
6
+ metadata.gz: e2269c5a1df90467e5487cb8b029e75591a91c07df1a5af5182af6075d0803dbbc8f8d97418bfbfb89232f63d0fc09646e894533d78cea61fd6937550707dfca
7
+ data.tar.gz: 0b4c4d7ed1c62e796b03eaed49edb1449e0ea265952f8b6a97f055a49f3c1708fee739a0fc47e99282e7e222d090690859bf540b3bfe3893fd8a523c00657640
@@ -57,4 +57,9 @@ jobs:
57
57
 
58
58
  - run: bundle exec rspec
59
59
  env:
60
- RAILS_VERSION: ${{ matrix.rails }}
60
+ RAILS_VERSION: ${{ matrix.rails }}
61
+
62
+ - name: Upload coverage to Codecov
63
+ uses: codecov/codecov-action@v6
64
+ with:
65
+ token: ${{ secrets.CODECOV_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.0] - 2026-05-28
4
+
5
+ ### Added
6
+
7
+ - `rails generate turbo_rspec:install` — scaffolds `spec/support/turbo_rspec.rb` with sensible defaults
8
+ - `bin/benchmark` — measures matcher overhead against a 100-element response body
9
+ - Semver format enforced via spec (`TurboRspec::VERSION` must match `MAJOR.MINOR.PATCH`)
10
+ - SimpleCov minimum coverage enforced: 100% line and branch required for CI to pass
11
+
3
12
  ## [0.7.0] - 2026-05-28
4
13
 
5
14
  ### Added
data/README.md CHANGED
@@ -6,7 +6,15 @@
6
6
  [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.3-ruby)](https://rubygems.org/gems/turbo_rspec)
7
7
  [![codecov](https://codecov.io/gh/eclectic-coding/turbo_rspec/branch/main/graph/badge.svg)](https://codecov.io/gh/eclectic-coding/turbo_rspec)
8
8
 
9
- RSpec matchers for [Turbo](https://github.com/hotwired/turbo-rails) — assert Turbo Stream responses, Turbo Frame content, and ActionCable broadcasts without hand-rolling helpers in every project.
9
+ Drop-in test matchers for [hotwired/turbo-rails](https://github.com/hotwired/turbo-rails) — replace every hand-rolled Turbo helper in your test suite with a single gem.
10
+
11
+ - **Request/controller specs** — `have_turbo_stream`, `have_turbo_frame`, `have_turbo_streams`
12
+ - **Broadcast specs** — `have_broadcasted_turbo_stream_to` with count qualifiers
13
+ - **System/feature specs** — Capybara matchers: `have_turbo_frame`, `have_turbo_stream_tag`, `within_turbo_frame`
14
+ - **Minitest** — `assert_turbo_stream`, `refute_turbo_stream`, `assert_turbo_frame`, `refute_turbo_frame`
15
+ - **Factory helpers** — `turbo_stream_html`, `turbo_frame_html`
16
+ - **Shared examples** — `it_behaves_like "a turbo stream response"`
17
+ - **Auto-included** — zero setup required when `turbo-rails` is in your bundle
10
18
 
11
19
  **Docs:** [API Reference](https://rubydoc.info/gems/turbo_rspec) · [Migration Guide](docs/migration_guide.md) · [Cookbook](docs/cookbook.md)
12
20
 
@@ -22,6 +30,14 @@ end
22
30
 
23
31
  ## Setup
24
32
 
33
+ ### Generator
34
+
35
+ Run the install generator to scaffold a `spec/support/turbo_rspec.rb` configuration file:
36
+
37
+ ```bash
38
+ rails generate turbo_rspec:install
39
+ ```
40
+
25
41
  ### Rails + turbo-rails (automatic)
26
42
 
27
43
  No setup needed. When `turbo-rails` is in your bundle:
data/ROADMAP.md CHANGED
@@ -4,24 +4,10 @@ RSpec matchers for [Turbo](https://github.com/hotwired/turbo-rails): Turbo Strea
4
4
 
5
5
  ---
6
6
 
7
- ## v1.0.0 — Stable API
8
-
9
- **Goal:** API freeze. Commit to semver stability. Make the gem the obvious default choice.
10
-
11
- - API stability guarantee: no breaking changes without a major version bump
12
- - `TurboRspec::VERSION` semantic versioning enforced via CI check
13
- - 100% branch coverage enforced in CI (`simplecov`)
14
- - Performance: benchmark matcher overhead to keep it negligible in large suites
15
- - `bin/release` script (mirrors solid_queue_web pattern): bump version, update CHANGELOG, tag, push; CI publishes via Trusted Publishing
16
- - `turbo_rspec` generator (`rails generate turbo_rspec:install`) to scaffold `spec/support/turbo.rb`
17
-
18
- ---
19
-
20
7
  ## Post-1.0 ideas (not scheduled)
21
8
 
22
9
  - VS Code / RubyMine snippet pack for common patterns
23
10
  - Playwright/Puppeteer bridge for headless assertions outside Capybara
24
- - Shared examples: `it_behaves_like "a turbo stream response"` for controller testing
25
11
 
26
12
  ---
27
13
 
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators"
4
+
5
+ module TurboRspec
6
+ module Generators
7
+ # Rails generator that scaffolds a spec/support/turbo_rspec.rb file
8
+ # with sensible defaults for TurboRspec configuration.
9
+ #
10
+ # @example
11
+ # rails generate turbo_rspec:install
12
+ class InstallGenerator < Rails::Generators::Base
13
+ source_root File.expand_path("templates", __dir__)
14
+
15
+ desc "Creates a spec/support/turbo_rspec.rb configuration file"
16
+
17
+ def create_support_file
18
+ template "turbo_rspec.rb", "spec/support/turbo_rspec.rb"
19
+ end
20
+
21
+ def show_readme
22
+ readme "README" if behavior == :invoke
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,13 @@
1
+ TurboRspec installed!
2
+
3
+ A configuration file has been created at spec/support/turbo_rspec.rb.
4
+
5
+ Make sure it is required in your spec/rails_helper.rb:
6
+
7
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
8
+
9
+ Matchers are automatically included in request, controller, system,
10
+ and feature specs when turbo-rails is present.
11
+
12
+ See the docs for usage examples:
13
+ https://github.com/eclectic-coding/turbo_rspec
@@ -0,0 +1,13 @@
1
+ # TurboRspec configuration
2
+ # See: https://github.com/eclectic-coding/turbo_rspec
3
+
4
+ TurboRspec.configure do |config|
5
+ # Set to false to disable automatic inclusion of matchers into
6
+ # request, controller, system, and feature example groups.
7
+ # config.auto_include = false
8
+ end
9
+
10
+ # Uncomment to include Minitest assertions in integration tests:
11
+ # class ActionDispatch::IntegrationTest
12
+ # include TurboRspec::Assertions
13
+ # end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurboRspec
4
- VERSION = "0.7.0"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Smith
@@ -23,9 +23,11 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '1.13'
26
- description: 'Drop-in RSpec matchers for hotwired/turbo-rails: assert Turbo Stream
27
- responses, Turbo Frame content, and ActionCable broadcasts without hand-rolling
28
- helpers in every project.'
26
+ description: 'Drop-in test matchers for hotwired/turbo-rails: assert Turbo Stream
27
+ responses, Turbo Frame content, ActionCable broadcasts, and Capybara page assertions.
28
+ Includes RSpec matchers (have_turbo_stream, have_turbo_frame, have_broadcasted_turbo_stream_to),
29
+ Minitest assertions, factory helpers, shared examples, and a Rails generator — all
30
+ auto-included with zero setup.'
29
31
  email:
30
32
  - eclectic-coding@users.noreply.github.com
31
33
  executables: []
@@ -45,6 +47,9 @@ files:
45
47
  - codecov.yml
46
48
  - docs/cookbook.md
47
49
  - docs/migration_guide.md
50
+ - lib/generators/turbo_rspec/install_generator.rb
51
+ - lib/generators/turbo_rspec/templates/README
52
+ - lib/generators/turbo_rspec/templates/turbo_rspec.rb
48
53
  - lib/turbo_rspec.rb
49
54
  - lib/turbo_rspec/assertions.rb
50
55
  - lib/turbo_rspec/capybara/matchers.rb
@@ -85,5 +90,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
90
  requirements: []
86
91
  rubygems_version: 3.6.9
87
92
  specification_version: 4
88
- summary: RSpec matchers for Turbo Streams, Turbo Frames, and ActionCable broadcasts.
93
+ summary: RSpec matchers and Minitest assertions for hotwired/turbo-rails.
89
94
  test_files: []