stimulus_spec 0.8.0 → 0.8.2
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/CHANGELOG.md +15 -1
- data/README.md +11 -2
- data/lib/stimulus_spec/version.rb +1 -1
- data/lib/stimulus_spec.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef80da08dc9b698e7dacdfc817d65d167413a951981c464fde32fa88d50ddcbe
|
|
4
|
+
data.tar.gz: dc9bd14543dc39afd541b88446d2969e08258cd15f191b856ce61cfcda391d5c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe01f8b9ae913f652c07de9e461228a11505dc70713d076d1f74e17fd707bb759c1e27f6b9baa42f8fbb47917d8a66ab1784458e15eef6634db4c64186b8fbbd
|
|
7
|
+
data.tar.gz: 0f98d741c26ae35cf8d5fdbc04e5a130c0c2f4f18f56d3262b37ad6c139517f419b4ba67086cf13436fcffed61862c80cc6383810f64f88dc2af6f5e7328d185
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.8.2] - 2026-08-11
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Recommend `require: false` in the Gemfile install snippet, with an explicit `require "stimulus_spec"` in `rails_helper.rb`/`spec_helper.rb`, matching the convention used by `shoulda-matchers` and `database_cleaner`.
|
|
15
|
+
|
|
16
|
+
## [0.8.1] - 2026-06-30
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Guard matcher requires and `RSpec.configure` behind `defined?(RSpec::Core)` so the gem is safe to auto-require in non-test contexts (e.g. asset precompilation). Previously, a partial load of `rspec-expectations` or `rspec-mocks` could define the `RSpec` constant without `RSpec::Core`, causing a `NoMethodError` when `RSpec.configure` was called. Nokogiri is now also only required when RSpec::Core is present.
|
|
21
|
+
|
|
10
22
|
## [0.8.0] - 2026-06-23
|
|
11
23
|
|
|
12
24
|
### Added
|
|
@@ -70,7 +82,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
70
82
|
- `have_stimulus_action(descriptor)` matcher — full descriptor (`~=`) and shorthand without event (`*=`)
|
|
71
83
|
- `have_stimulus_target(controller, target)` matcher — asserts `[data-{controller}-target~="target"]`
|
|
72
84
|
|
|
73
|
-
[Unreleased]: https://github.com/eclectic-coding/stimulus_spec/compare/v0.8.
|
|
85
|
+
[Unreleased]: https://github.com/eclectic-coding/stimulus_spec/compare/v0.8.2...HEAD
|
|
86
|
+
[0.8.2]: https://github.com/eclectic-coding/stimulus_spec/releases/tag/v0.8.2
|
|
87
|
+
[0.8.1]: https://github.com/eclectic-coding/stimulus_spec/releases/tag/v0.8.1
|
|
74
88
|
[0.8.0]: https://github.com/eclectic-coding/stimulus_spec/releases/tag/v0.8.0
|
|
75
89
|
[0.7.0]: https://github.com/eclectic-coding/stimulus_spec/releases/tag/v0.7.0
|
|
76
90
|
[0.6.0]: https://github.com/eclectic-coding/stimulus_spec/releases/tag/v0.6.0
|
data/README.md
CHANGED
|
@@ -45,17 +45,26 @@ Add to your application's `Gemfile`:
|
|
|
45
45
|
|
|
46
46
|
```ruby
|
|
47
47
|
group :test do
|
|
48
|
-
gem "stimulus_spec"
|
|
48
|
+
gem "stimulus_spec", require: false
|
|
49
49
|
end
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
Then require it explicitly in `spec/rails_helper.rb` (or `spec/spec_helper.rb`), after RSpec is loaded:
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
require "rspec/rails"
|
|
56
|
+
require "stimulus_spec"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`require: false` avoids Bundler auto-requiring the gem during app boot, before RSpec itself is loaded — the same convention used by `shoulda-matchers`, `database_cleaner`, and other RSpec extension gems.
|
|
60
|
+
|
|
52
61
|
[Back to top](#stimulusspec)
|
|
53
62
|
|
|
54
63
|
## Setup
|
|
55
64
|
|
|
56
65
|
### Rails + stimulus-rails (automatic)
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
Once required (see [Installation](#installation)), no further setup is needed. When `stimulus-rails` is in your bundle:
|
|
59
68
|
|
|
60
69
|
- `StimulusSpec::Matchers` is automatically included in `type: :request` and `type: :controller` example groups
|
|
61
70
|
- `StimulusSpec::Capybara::Matchers` is automatically included in `type: :system` and `type: :feature` example groups when `capybara` is also present
|
data/lib/stimulus_spec.rb
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "stimulus_spec/version"
|
|
4
4
|
require_relative "stimulus_spec/configuration"
|
|
5
|
-
require_relative "stimulus_spec/matchers"
|
|
6
|
-
require_relative "stimulus_spec/capybara/matchers"
|
|
7
5
|
|
|
8
6
|
# RSpec matchers for testing Stimulus controller wiring in Rails applications.
|
|
9
7
|
#
|
|
@@ -62,7 +60,10 @@ module StimulusSpec
|
|
|
62
60
|
end
|
|
63
61
|
|
|
64
62
|
# :nocov:
|
|
65
|
-
if defined?(RSpec)
|
|
63
|
+
if defined?(RSpec::Core)
|
|
64
|
+
require_relative "stimulus_spec/matchers"
|
|
65
|
+
require_relative "stimulus_spec/capybara/matchers"
|
|
66
|
+
|
|
66
67
|
RSpec.configure do |config|
|
|
67
68
|
StimulusSpec.install_rspec_integration(config)
|
|
68
69
|
end
|