spec_forge 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/CHANGELOG.md +139 -9
- data/README.md +125 -203
- data/bin/spec_forge +1 -1
- data/flake.lock +76 -4
- data/flake.nix +5 -4
- data/lib/spec_forge/attribute/chainable.rb +6 -6
- data/lib/spec_forge/attribute/environment.rb +45 -0
- data/lib/spec_forge/attribute/factory.rb +26 -17
- data/lib/spec_forge/attribute/faker.rb +6 -1
- data/lib/spec_forge/attribute/generate.rb +114 -0
- data/lib/spec_forge/attribute/literal.rb +1 -14
- data/lib/spec_forge/attribute/matcher.rb +6 -2
- data/lib/spec_forge/attribute/parameterized.rb +20 -22
- data/lib/spec_forge/attribute/resolvable_array.rb +16 -16
- data/lib/spec_forge/attribute/resolvable_hash.rb +17 -16
- data/lib/spec_forge/attribute/resolvable_struct.rb +67 -0
- data/lib/spec_forge/attribute/template.rb +118 -0
- data/lib/spec_forge/attribute/transform.rb +14 -19
- data/lib/spec_forge/attribute/variable.rb +31 -31
- data/lib/spec_forge/attribute.rb +54 -100
- data/lib/spec_forge/blueprint.rb +27 -0
- data/lib/spec_forge/cli/docs/generate.rb +28 -8
- data/lib/spec_forge/cli/docs.rb +5 -2
- data/lib/spec_forge/cli/init.rb +4 -4
- data/lib/spec_forge/cli/new.rb +78 -27
- data/lib/spec_forge/cli/run.rb +84 -52
- data/lib/spec_forge/cli/serve.rb +6 -0
- data/lib/spec_forge/cli.rb +6 -14
- data/lib/spec_forge/configuration.rb +212 -78
- data/lib/spec_forge/documentation/{loader → builder}/cache.rb +26 -23
- data/lib/spec_forge/documentation/builder/compiler.rb +373 -0
- data/lib/spec_forge/documentation/builder/extractor.rb +75 -0
- data/lib/spec_forge/documentation/builder.rb +77 -329
- data/lib/spec_forge/documentation/document/operation.rb +4 -4
- data/lib/spec_forge/documentation/document.rb +0 -6
- data/lib/spec_forge/documentation/generator.rb +88 -0
- data/lib/spec_forge/documentation/{generators/openapi → openapi/v3_0}/error_formatter.rb +2 -2
- data/lib/spec_forge/documentation/openapi/v3_0/example.rb +1 -1
- data/lib/spec_forge/documentation/openapi/v3_0/media_type.rb +1 -1
- data/lib/spec_forge/documentation/openapi/v3_0/operation.rb +22 -6
- data/lib/spec_forge/documentation/openapi/v3_0/response.rb +29 -7
- data/lib/spec_forge/documentation/openapi/v3_0/schema.rb +20 -2
- data/lib/spec_forge/documentation/openapi/v3_0/tag.rb +1 -1
- data/lib/spec_forge/documentation/openapi/v3_0.rb +116 -0
- data/lib/spec_forge/documentation/openapi.rb +40 -12
- data/lib/spec_forge/documentation.rb +1 -7
- data/lib/spec_forge/error.rb +215 -41
- data/lib/spec_forge/factory.rb +38 -18
- data/lib/spec_forge/forge/action.rb +41 -0
- data/lib/spec_forge/forge/actions/call.rb +33 -0
- data/lib/spec_forge/forge/actions/debug.rb +47 -0
- data/lib/spec_forge/forge/actions/expect.rb +44 -0
- data/lib/spec_forge/forge/actions/request.rb +65 -0
- data/lib/spec_forge/forge/actions/store.rb +31 -0
- data/lib/spec_forge/forge/callbacks.rb +80 -0
- data/lib/spec_forge/forge/context.rb +41 -0
- data/lib/spec_forge/forge/display.rb +503 -0
- data/lib/spec_forge/forge/hooks.rb +131 -0
- data/lib/spec_forge/forge/runner/array_io.rb +81 -0
- data/lib/spec_forge/forge/runner/content_validator.rb +92 -0
- data/lib/spec_forge/forge/runner/header_validator.rb +66 -0
- data/lib/spec_forge/forge/runner/reporter.rb +56 -0
- data/lib/spec_forge/forge/runner/schema_validator.rb +113 -0
- data/lib/spec_forge/forge/runner.rb +118 -0
- data/lib/spec_forge/forge/timer.rb +94 -0
- data/lib/spec_forge/forge/variables.rb +38 -0
- data/lib/spec_forge/forge.rb +207 -133
- data/lib/spec_forge/http/backend.rb +49 -143
- data/lib/spec_forge/http/client.rb +14 -17
- data/lib/spec_forge/http/request.rb +37 -84
- data/lib/spec_forge/http/verb.rb +4 -0
- data/lib/spec_forge/http.rb +0 -5
- data/lib/spec_forge/loader/filter.rb +85 -0
- data/lib/spec_forge/loader/step_processor.rb +282 -0
- data/lib/spec_forge/loader.rb +105 -220
- data/lib/spec_forge/normalizer/default.rb +1 -1
- data/lib/spec_forge/normalizer/structure.rb +140 -0
- data/lib/spec_forge/normalizer/transformers.rb +168 -0
- data/lib/spec_forge/normalizer/validators.rb +50 -8
- data/lib/spec_forge/normalizer.rb +76 -119
- data/lib/spec_forge/normalizers/callback.yml +38 -0
- data/lib/spec_forge/normalizers/configuration.yml +59 -9
- data/lib/spec_forge/normalizers/factory.yml +53 -2
- data/lib/spec_forge/normalizers/factory_reference.yml +63 -2
- data/lib/spec_forge/normalizers/json_schema.yml +79 -0
- data/lib/spec_forge/normalizers/step.yml +506 -0
- data/lib/spec_forge/step/call.rb +36 -0
- data/lib/spec_forge/step/expect.rb +110 -0
- data/lib/spec_forge/step/source.rb +22 -0
- data/lib/spec_forge/step.rb +129 -0
- data/lib/spec_forge/type.rb +115 -66
- data/lib/spec_forge/version.rb +1 -1
- data/lib/spec_forge.rb +44 -106
- data/lib/templates/forge_helper.rb.tt +43 -22
- data/lib/templates/new_blueprint.yml.tt +54 -0
- metadata +75 -44
- data/lib/spec_forge/attribute/global.rb +0 -96
- data/lib/spec_forge/attribute/store.rb +0 -65
- data/lib/spec_forge/backtrace_formatter.rb +0 -50
- data/lib/spec_forge/callbacks.rb +0 -88
- data/lib/spec_forge/context/callbacks.rb +0 -91
- data/lib/spec_forge/context/global.rb +0 -72
- data/lib/spec_forge/context/store.rb +0 -131
- data/lib/spec_forge/context/variables.rb +0 -91
- data/lib/spec_forge/context.rb +0 -36
- data/lib/spec_forge/core_ext/rspec.rb +0 -55
- data/lib/spec_forge/core_ext.rb +0 -5
- data/lib/spec_forge/documentation/generators/base.rb +0 -81
- data/lib/spec_forge/documentation/generators/openapi/base.rb +0 -100
- data/lib/spec_forge/documentation/generators/openapi/v3_0.rb +0 -65
- data/lib/spec_forge/documentation/generators/openapi.rb +0 -59
- data/lib/spec_forge/documentation/generators.rb +0 -17
- data/lib/spec_forge/documentation/loader.rb +0 -159
- data/lib/spec_forge/documentation/openapi/base.rb +0 -33
- data/lib/spec_forge/filter.rb +0 -86
- data/lib/spec_forge/normalizer/definition.rb +0 -248
- data/lib/spec_forge/normalizers/_shared.yml +0 -74
- data/lib/spec_forge/normalizers/constraint.yml +0 -8
- data/lib/spec_forge/normalizers/expectation.yml +0 -47
- data/lib/spec_forge/normalizers/global_context.yml +0 -28
- data/lib/spec_forge/normalizers/spec.yml +0 -50
- data/lib/spec_forge/runner/adapter.rb +0 -183
- data/lib/spec_forge/runner/callbacks.rb +0 -246
- data/lib/spec_forge/runner/debug_proxy.rb +0 -213
- data/lib/spec_forge/runner/listener.rb +0 -54
- data/lib/spec_forge/runner/metadata.rb +0 -58
- data/lib/spec_forge/runner/state.rb +0 -98
- data/lib/spec_forge/runner.rb +0 -75
- data/lib/spec_forge/spec/expectation/constraint.rb +0 -127
- data/lib/spec_forge/spec/expectation.rb +0 -68
- data/lib/spec_forge/spec.rb +0 -68
- data/lib/templates/new_spec.yml.tt +0 -43
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a63a7870c53ed507204c4848b271094c53a5be8d2925e7b04b359f6885b61cc
|
|
4
|
+
data.tar.gz: 12684cb3c690072fe1ead4c4ef5d4e9b2fb13d2e40f27c5eeea75fba9cdbff0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f656557492767c8f2391f334461ee4efbcad40118f7608b9d26ba6e5ee1492c3adddce4d76565a79b145b4d2f017de9f43aabbdfdf7e9e837fc71c77b54a4555
|
|
7
|
+
data.tar.gz: dbaf154a1d50d7399d7c25d5655ad9809185dd410de71d3f2b62809435dfdf75b1d0948ddcc848059c2ee0b7053fc31c148dac164c63636edf2b823c5562a963
|
data/CHANGELOG.md
CHANGED
|
@@ -15,14 +15,122 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
### Removed
|
|
16
16
|
-->
|
|
17
17
|
|
|
18
|
+
## [1.0.0] - 12026-01-29
|
|
19
|
+
|
|
20
|
+
### ⚠️ Breaking Changes
|
|
21
|
+
|
|
22
|
+
This release is a complete architectural redesign. See the [Migration Guide](https://github.com/itsthedevman/spec_forge/wiki/Migration-Guide) for detailed upgrade instructions.
|
|
23
|
+
|
|
24
|
+
**Core changes:**
|
|
25
|
+
- Directory renamed: `spec_forge/specs/` → `spec_forge/blueprints/`
|
|
26
|
+
- CLI renamed: `spec_forge new spec` → `spec_forge new blueprint`
|
|
27
|
+
- YAML structure rewritten from spec-based to sequential step-based workflows
|
|
28
|
+
- Variable syntax changed: `variables.name` → `{{ name }}` template syntax
|
|
29
|
+
- Execution architecture changed: Forge now orchestrates workflows and delegates validation to RSpec, replacing the previous fully RSpec-driven approach
|
|
30
|
+
|
|
31
|
+
**Configuration:**
|
|
32
|
+
- Removed: `config.headers`, `config.query` (use explicit inheritance instead)
|
|
33
|
+
- Changed: `config.specs` → `config.rspec`
|
|
34
|
+
- Changed: `config.on_debug = proc` → `config.on_debug { block }`
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- **Step-based workflows**: Tests execute as sequential steps with explicit data flow between them. See [Writing Tests](https://github.com/itsthedevman/spec_forge/wiki/Writing-Tests).
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
- name: "Create user"
|
|
42
|
+
request:
|
|
43
|
+
url: /users
|
|
44
|
+
http_verb: POST
|
|
45
|
+
json:
|
|
46
|
+
email: "{{ faker.internet.email }}"
|
|
47
|
+
expect:
|
|
48
|
+
- status: 201
|
|
49
|
+
store:
|
|
50
|
+
user_id: "{{ response.body.id }}"
|
|
51
|
+
|
|
52
|
+
- name: "Fetch created user"
|
|
53
|
+
request:
|
|
54
|
+
url: "/users/{{ user_id }}"
|
|
55
|
+
expect:
|
|
56
|
+
- status: 200
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- **Template variable system**: New `{{ }}` syntax for dynamic values—supports variables, Faker, factories, and environment variables. See [Dynamic Features](https://github.com/itsthedevman/spec_forge/wiki/Dynamic-Features).
|
|
60
|
+
|
|
61
|
+
- **JSON validation modes**: Three modes for response validation—`shape:` for type checking with nullable/optional flags, `content:` for value matching, and `schema:` for explicit structure control. See [Validating Responses](https://github.com/itsthedevman/spec_forge/wiki/Validating-Responses).
|
|
62
|
+
|
|
63
|
+
- **Configuration inheritance**: The `shared:` wrapper applies request configuration and hooks to nested steps, making auth flows and grouped operations cleaner.
|
|
64
|
+
|
|
65
|
+
- **Lifecycle hooks**: Register callbacks for `before`/`after` events at forge, blueprint, and step levels. See [Callbacks](https://github.com/itsthedevman/spec_forge/wiki/Callbacks).
|
|
66
|
+
|
|
67
|
+
- **Tag-based filtering**: Organize steps with tags and run subsets via `--tags` and `--skip-tags` CLI options. See [Running Tests](https://github.com/itsthedevman/spec_forge/wiki/Running-Tests).
|
|
68
|
+
|
|
69
|
+
- **Improved output display**: Verbosity levels (`--verbose`, `--debug`, `--trace`) with colorized terminal output, detailed failure context, and YAML line number tracking in error messages.
|
|
70
|
+
|
|
71
|
+
- **File includes**: Extract common workflows into separate files and inject them with `include:`.
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
|
|
75
|
+
- Request options now nested under `request:` key
|
|
76
|
+
- Expectations simplified from `expectations: [{ expect: ... }]` to `expect: [...]`
|
|
77
|
+
- Error messages now include YAML line numbers and source file context
|
|
78
|
+
- Factory references now support traits and attribute overrides via expanded syntax
|
|
79
|
+
- Global variables defined in `forge_helper.rb` via `config.global_variables` instead of YAML
|
|
80
|
+
|
|
81
|
+
### Removed
|
|
82
|
+
|
|
83
|
+
- Global context system (`Context::Global`, `Context::Store`, `Context::Variables`)
|
|
84
|
+
- Spec and Expectation classes (replaced with Step-based architecture)
|
|
85
|
+
- Global headers/query configuration (use `shared:` inheritance instead)
|
|
86
|
+
|
|
87
|
+
**[Full documentation](https://github.com/itsthedevman/spec_forge/wiki)** | **[Migration Guide](https://github.com/itsthedevman/spec_forge/wiki/Migration-Guide)**
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## [0.7.1] - 12025-10-08
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- **Configuration alias**: `base_path` can now be used as an alias for `base_url` in spec definitions
|
|
96
|
+
- **Improved debug configuration**: New `config.on_debug { }` block syntax for cleaner configuration
|
|
97
|
+
|
|
98
|
+
```ruby
|
|
99
|
+
# New cleaner syntax (recommended)
|
|
100
|
+
config.on_debug { binding.pry }
|
|
101
|
+
|
|
102
|
+
# Old syntax still works with deprecation warning
|
|
103
|
+
config.on_debug = -> { binding.pry }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
|
|
108
|
+
- **Fixed path handling in HTTP requests**: Paths with leading slashes (e.g., `/users`) now properly append to base URLs instead of replacing the entire path
|
|
109
|
+
- Previously, a base URL like `http://api.example.com/v1` with path `/users` would incorrectly resolve to `http://api.example.com/users`
|
|
110
|
+
- Now correctly resolves to `http://api.example.com/v1/users`
|
|
111
|
+
- This matches user expectations and common API patterns
|
|
112
|
+
- **Note**: If you need to replace the entire path, use absolute URLs like `https://api.example.com/users`
|
|
113
|
+
- **CI/CD improvements**: Updated to GitHub Actions checkout v5 and streamlined Ruby version testing
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
|
|
117
|
+
- **Transform.join resolution**: Now properly generates fresh values instead of using cached results
|
|
118
|
+
- **Test adapter optimization**: Removed JSON class validation check to allow matchers to be used
|
|
119
|
+
|
|
120
|
+
### Deprecated
|
|
121
|
+
|
|
122
|
+
- `config.on_debug = proc` syntax - use `config.on_debug { }` block syntax instead
|
|
123
|
+
|
|
18
124
|
## [0.7.0] - 12025-06-22
|
|
19
125
|
|
|
20
126
|
### Added
|
|
21
127
|
|
|
22
128
|
#### 🚀 Documentation-First Architecture
|
|
129
|
+
|
|
23
130
|
**The Big Picture**: SpecForge now generates OpenAPI documentation from your tests automatically!
|
|
24
131
|
|
|
25
132
|
- **Primary Documentation Workflow**: New `docs` command (now the default!) generates OpenAPI specs from test execution
|
|
133
|
+
|
|
26
134
|
- Smart caching system with `--fresh` flag for forced regeneration
|
|
27
135
|
- Multiple output formats: YAML (default) or JSON via `--format`
|
|
28
136
|
- Custom output paths with `--output` option
|
|
@@ -30,6 +138,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
30
138
|
- Optional validation skip with `--skip-validation` for faster iterations
|
|
31
139
|
|
|
32
140
|
- **Live Documentation Server**: `spec_forge serve` command for immediate feedback
|
|
141
|
+
|
|
33
142
|
- Local web server with Swagger UI (default) or Redoc (`--ui redoc`)
|
|
34
143
|
- Configurable port with `--port` (defaults to 8080)
|
|
35
144
|
- Auto-generated HTML templates for both UI options
|
|
@@ -44,17 +153,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
44
153
|
#### 🧪 Enhanced Testing Capabilities
|
|
45
154
|
|
|
46
155
|
- **HTTP Header Testing**: Comprehensive header validation
|
|
156
|
+
|
|
47
157
|
```yaml
|
|
48
158
|
headers:
|
|
49
159
|
Content-Type: "application/json"
|
|
50
160
|
X-Request-ID: /^[0-9a-f-]{36}$/
|
|
51
161
|
Cache-Control:
|
|
52
162
|
matcher.and:
|
|
53
|
-
|
|
54
|
-
|
|
163
|
+
- matcher.include: "max-age="
|
|
164
|
+
- matcher.include: "private"
|
|
55
165
|
```
|
|
56
166
|
|
|
57
167
|
- **Flexible Store System**: Store anything, access everything
|
|
168
|
+
|
|
58
169
|
- OpenStruct-based entries for maximum flexibility
|
|
59
170
|
- Custom data via callbacks (config, metadata, computed values)
|
|
60
171
|
- Same familiar `store.id.attribute` syntax
|
|
@@ -67,12 +178,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
67
178
|
#### ⚙️ Architecture Improvements
|
|
68
179
|
|
|
69
180
|
- **YAML-Driven Normalizers**: Configuration over code
|
|
181
|
+
|
|
70
182
|
- Structure definitions in `lib/spec_forge/normalizers/*.yml`
|
|
71
183
|
- Powerful `reference:` system for reusable components
|
|
72
184
|
- Wildcard support (`*`) for catch-all schemas
|
|
73
185
|
- Centralized validation logic in dedicated module
|
|
74
186
|
|
|
75
187
|
- **Enhanced CLI Experience**:
|
|
188
|
+
|
|
76
189
|
- Improved `init` command with `--skip-openapi` and `--skip-factories` flags
|
|
77
190
|
- Better help text and examples throughout
|
|
78
191
|
- Clearer error messages with actionable context
|
|
@@ -87,6 +200,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
87
200
|
#### 🎯 User Experience Overhaul
|
|
88
201
|
|
|
89
202
|
- **New Default Behavior**: `spec_forge` without arguments now shows help instead of running tests
|
|
203
|
+
|
|
90
204
|
- **Breaking Change**: Use `spec_forge docs` for documentation or `spec_forge run` for test-only execution
|
|
91
205
|
- Safer default that guides users to the right command for their needs
|
|
92
206
|
|
|
@@ -98,11 +212,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
98
212
|
#### 🏗️ Internal Refactoring
|
|
99
213
|
|
|
100
214
|
- **Normalizer Architecture**: YAML-based instead of class-heavy approach
|
|
215
|
+
|
|
101
216
|
- Consolidated shared definitions in `_shared.yml`
|
|
102
217
|
- Easier maintenance and extension
|
|
103
218
|
- Better error context with attribute path tracking
|
|
104
219
|
|
|
105
220
|
- **Test Execution Pipeline**:
|
|
221
|
+
|
|
106
222
|
- Clean separation between test preparation and execution
|
|
107
223
|
- Enhanced RSpec adapter pattern
|
|
108
224
|
- Better reusability for documentation generation
|
|
@@ -119,6 +235,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
119
235
|
---
|
|
120
236
|
|
|
121
237
|
**Migration Notes**:
|
|
238
|
+
|
|
122
239
|
- Update any scripts using bare `spec_forge` - now shows help instead of running tests
|
|
123
240
|
- Use `spec_forge docs` for documentation generation or `spec_forge run` for testing
|
|
124
241
|
- Store access patterns remain the same, but internal structure is more flexible
|
|
@@ -134,6 +251,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
134
251
|
- `Context::Variables` for managing variables with overlay support
|
|
135
252
|
- `Context::Store` for storing the results of the tests
|
|
136
253
|
- Added support for defining and referencing global variables
|
|
254
|
+
|
|
137
255
|
```yaml
|
|
138
256
|
global:
|
|
139
257
|
variables:
|
|
@@ -145,13 +263,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
145
263
|
query:
|
|
146
264
|
api_version: "global.variables.api_version"
|
|
147
265
|
```
|
|
266
|
+
|
|
148
267
|
- Added compound matcher support via `matcher.and` for combining multiple matchers
|
|
149
268
|
```yaml
|
|
150
269
|
email:
|
|
151
270
|
matcher.and:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
271
|
+
- kind_of.string
|
|
272
|
+
- /@/
|
|
273
|
+
- matcher.end_with: ".com"
|
|
155
274
|
```
|
|
156
275
|
- Added custom RSpec matcher `have_size` for checking an object's size via `matcher.have_size`
|
|
157
276
|
- Added new `Loader` class for improved spec file processing
|
|
@@ -159,6 +278,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
159
278
|
- Added normalizer for global context validation
|
|
160
279
|
- Added line number tracking for specs and expectations
|
|
161
280
|
- Added support for defining and referencing callbacks
|
|
281
|
+
|
|
162
282
|
```ruby
|
|
163
283
|
# Configuration level
|
|
164
284
|
SpecForge.configure do |config|
|
|
@@ -171,14 +291,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
171
291
|
# Module level (no aliases)
|
|
172
292
|
SpecForge.register_callback("callback_name") { |context| }
|
|
173
293
|
```
|
|
294
|
+
|
|
174
295
|
Once defined, callbacks can be referenced in spec files via the global context
|
|
296
|
+
|
|
175
297
|
```yaml
|
|
176
298
|
global:
|
|
177
299
|
callbacks:
|
|
178
|
-
|
|
179
|
-
|
|
300
|
+
- before: callback_name
|
|
301
|
+
after: cleanup_database_state
|
|
180
302
|
```
|
|
303
|
+
|
|
181
304
|
- Added support for storing and retrieving test data via the `store_as` directive and `store` attribute
|
|
305
|
+
|
|
182
306
|
```yaml
|
|
183
307
|
create_user:
|
|
184
308
|
path: "/users"
|
|
@@ -198,6 +322,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
198
322
|
- expect:
|
|
199
323
|
status: 200
|
|
200
324
|
```
|
|
325
|
+
|
|
201
326
|
- Added `UndefinedMatcherError` for clearer error messaging when invalid matchers are used
|
|
202
327
|
- Enhanced debugging capabilities with improved DebugProxy methods and store access
|
|
203
328
|
- Added HTTP status descriptions for better error messages
|
|
@@ -248,7 +373,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
248
373
|
variables:
|
|
249
374
|
users:
|
|
250
375
|
factory.user:
|
|
251
|
-
size: 10
|
|
376
|
+
size: 10 # Creates 10 user records
|
|
252
377
|
```
|
|
253
378
|
- All FactoryBot list methods now supported:
|
|
254
379
|
- `create_list` (default)
|
|
@@ -307,6 +432,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
307
432
|
### Added
|
|
308
433
|
|
|
309
434
|
- Core Infrastructure
|
|
435
|
+
|
|
310
436
|
- Configuration management
|
|
311
437
|
- User input validation and normalization
|
|
312
438
|
- Factory registration
|
|
@@ -316,11 +442,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
316
442
|
- Debugging tooling
|
|
317
443
|
|
|
318
444
|
- CLI
|
|
445
|
+
|
|
319
446
|
- Project initialization (`init`)
|
|
320
447
|
- Spec/factory generation (`new`)
|
|
321
448
|
- Test execution (`run`)
|
|
322
449
|
|
|
323
450
|
- Attributes
|
|
451
|
+
|
|
324
452
|
- Chainable attribute handling (through `Chainable`)
|
|
325
453
|
- Expanded attribute handling (through `Parameterized`)
|
|
326
454
|
- Factory (with chainable support) - `factories.`
|
|
@@ -339,7 +467,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
339
467
|
|
|
340
468
|
- Initial commit
|
|
341
469
|
|
|
342
|
-
[unreleased]: https://github.com/itsthedevman/spec_forge/compare/
|
|
470
|
+
[unreleased]: https://github.com/itsthedevman/spec_forge/compare/v1.0.0...HEAD
|
|
471
|
+
[1.0.0]: https://github.com/itsthedevman/spec_forge/compare/v0.7.1...v1.0.0
|
|
472
|
+
[0.7.1]: https://github.com/itsthedevman/spec_forge/compare/v0.7.0...v0.7.1
|
|
343
473
|
[0.7.0]: https://github.com/itsthedevman/spec_forge/compare/v0.6.0...v0.7.0
|
|
344
474
|
[0.6.0]: https://github.com/itsthedevman/spec_forge/compare/v0.5.0...v0.6.0
|
|
345
475
|
[0.5.0]: https://github.com/itsthedevman/spec_forge/compare/v0.4.0...v0.5.0
|