mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add f-prefix variants of groups and examples
For instance: `fit` for `it "...", :focus`
This commit is contained in:
parent
2b27ea5a01
commit
21d14bd814
3 changed files with 22 additions and 0 deletions
|
@ -29,6 +29,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Allow named arguments and assignments for `provided` (`given`) block.
|
||||
- Add `aggregate_failures` to capture and report multiple failed expectations. [#24](https://gitlab.com/arctic-fox/spectator/-/issues/24)
|
||||
- Supports matching groups. [#25](https://gitlab.com/arctic-fox/spectator/-/issues/25) [#24](https://github.com/icy-arctic-fox/spectator/issues/24)
|
||||
- Add `filter_run_including`, `filter_run_excluding`, and `filter_run_when_matching` to config block.
|
||||
- By default, only run tests when any are marked with `focus: true`.
|
||||
- Add "f-prefix" blocks for examples and groups (`fit`, `fdescribe`, etc.) as a short-hand for specifying `focus: true`.
|
||||
|
||||
### Changed
|
||||
- `given` (now `provided`) blocks changed to produce a single example. `it` can no longer be nested in a `provided` block.
|
||||
|
|
|
@ -137,6 +137,12 @@ module Spectator::DSL
|
|||
|
||||
define_example :specify
|
||||
|
||||
define_example :fexample, focus: true
|
||||
|
||||
define_example :fit, focus: true
|
||||
|
||||
define_example :fspecify, focus: true
|
||||
|
||||
@[Deprecated("Behavior of pending blocks will change in Spectator v0.11.0. Use `skip` instead.")]
|
||||
define_pending_example :pending
|
||||
|
||||
|
|
|
@ -181,6 +181,12 @@ module Spectator::DSL
|
|||
|
||||
define_example_group :xcontext, skip: "Temporarily skipped with xcontext"
|
||||
|
||||
define_example_group :fexample_group, focus: true
|
||||
|
||||
define_example_group :fdescribe, focus: true
|
||||
|
||||
define_example_group :fcontext, focus: true
|
||||
|
||||
# Defines a new iterative example group.
|
||||
# This type of group duplicates its contents for each element in *collection*.
|
||||
#
|
||||
|
@ -197,6 +203,8 @@ module Spectator::DSL
|
|||
# :ditto:
|
||||
define_iterative_group :xsample, skip: "Temporarily skipped with xsample"
|
||||
|
||||
define_iterative_group :fsample, focus: true
|
||||
|
||||
# Defines a new iterative example group.
|
||||
# This type of group duplicates its contents for each element in *collection*.
|
||||
# This is the same as `#sample` except that the items are shuffled.
|
||||
|
@ -218,5 +226,10 @@ module Spectator::DSL
|
|||
define_iterative_group :xrandom_sample, skip: "Temporarily skipped with xrandom_sample" do |collection|
|
||||
collection.to_a.shuffle(::Spectator.random)
|
||||
end
|
||||
|
||||
# :ditto:
|
||||
define_iterative_group :frandom_sample, focus: true do |collection|
|
||||
collection.to_a.shuffle(::Spectator.random)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue