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 +4 -4
- data/.github/workflows/ci.yml +6 -1
- data/CHANGELOG.md +9 -0
- data/README.md +17 -1
- data/ROADMAP.md +0 -14
- data/lib/generators/turbo_rspec/install_generator.rb +26 -0
- data/lib/generators/turbo_rspec/templates/README +13 -0
- data/lib/generators/turbo_rspec/templates/turbo_rspec.rb +13 -0
- data/lib/turbo_rspec/version.rb +1 -1
- metadata +10 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '036718d6f9e9e1960f6e12b668a288c6562ec914aa87eaaaddacfbccb47fc2fd'
|
|
4
|
+
data.tar.gz: 6f0345d41a0803871c89fbbbaa9e7e1e30b7ca155e9d60b8c41052a1fe0c59e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2269c5a1df90467e5487cb8b029e75591a91c07df1a5af5182af6075d0803dbbc8f8d97418bfbfb89232f63d0fc09646e894533d78cea61fd6937550707dfca
|
|
7
|
+
data.tar.gz: 0b4c4d7ed1c62e796b03eaed49edb1449e0ea265952f8b6a97f055a49f3c1708fee739a0fc47e99282e7e222d090690859bf540b3bfe3893fd8a523c00657640
|
data/.github/workflows/ci.yml
CHANGED
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
|
[](https://rubygems.org/gems/turbo_rspec)
|
|
7
7
|
[](https://codecov.io/gh/eclectic-coding/turbo_rspec)
|
|
8
8
|
|
|
9
|
-
|
|
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
|
data/lib/turbo_rspec/version.rb
CHANGED
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.
|
|
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
|
|
27
|
-
responses, Turbo Frame content,
|
|
28
|
-
|
|
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
|
|
93
|
+
summary: RSpec matchers and Minitest assertions for hotwired/turbo-rails.
|
|
89
94
|
test_files: []
|