rspec_in_context 1.1.0.3 → 1.2.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/test_and_publish.yml +15 -10
- data/.github/workflows/test_only.yml +12 -7
- data/.github/workflows/verify_version_change.yml +6 -2
- data/.gitignore +7 -0
- data/.rubocop-remote-fc7fff8f41d19bde0dcc446ded612e75.yml +153 -0
- data/.rubocop.yml +8 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +27 -1
- data/README.md +26 -7
- data/TODO.md +44 -0
- data/lib/rspec_in_context/context_management.rb +1 -1
- data/lib/rspec_in_context/in_context.rb +137 -33
- data/lib/rspec_in_context/version.rb +1 -1
- data/lib/rspec_in_context.rb +13 -7
- data/package.json +16 -2
- data/rspec_in_context.gemspec +21 -20
- data/yarn.lock +8 -10
- metadata +16 -59
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 730a3e4b4ffb390f1331ac01a19295c91c8c7d21b356e23618bc10d619645f2a
|
|
4
|
+
data.tar.gz: 74b2c2d9f4f4921a7611d678dfc7202226bd123a670148564b6302d6f951a772
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21923024896432dbcd2e4234306df21ccb3e3ef8eddb3325c576322e5d54a8e54ad4169c2b94b9b3cb8b43ab78531a20f5dd61e9fa7653b6e54832eb05a84948
|
|
7
|
+
data.tar.gz: 44badaca77e3c8994c0fc9faea35c8877d1d50c73bdee4a3caaeebd6497c336545c8e6ac3743c8b639fa4e6b1c1193a523ea5dd3beb4996e72eda6fccdbd9b3b
|
|
@@ -2,18 +2,18 @@ name: Test and Release
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches:
|
|
5
|
+
branches:
|
|
6
6
|
- main
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
tests:
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
|
-
ruby: [2
|
|
12
|
+
ruby: ['3.2', '3.3', '3.4', '4.0']
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
17
|
- name: Set up Ruby
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
@@ -26,25 +26,30 @@ jobs:
|
|
|
26
26
|
prettier:
|
|
27
27
|
runs-on: ubuntu-latest
|
|
28
28
|
steps:
|
|
29
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- name: Set up Ruby
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: '3.4'
|
|
34
|
+
bundler-cache: true
|
|
30
35
|
- name: Set up Node
|
|
31
|
-
uses: actions/setup-node@
|
|
36
|
+
uses: actions/setup-node@v4
|
|
32
37
|
with:
|
|
33
|
-
node-version: '
|
|
38
|
+
node-version: '22'
|
|
34
39
|
- name: Install yarn dep
|
|
35
40
|
run: yarn install
|
|
36
41
|
- name: Check prettier
|
|
37
|
-
run: yarn prettier -c '
|
|
42
|
+
run: yarn prettier -c 'lib/**/*.rb' 'spec/**/*.rb' '*.gemspec' Gemfile
|
|
38
43
|
release:
|
|
39
44
|
needs: [tests, prettier]
|
|
40
45
|
runs-on: ubuntu-latest
|
|
41
46
|
|
|
42
47
|
steps:
|
|
43
|
-
- uses: actions/checkout@
|
|
48
|
+
- uses: actions/checkout@v4
|
|
44
49
|
- name: Set up Ruby
|
|
45
50
|
uses: ruby/setup-ruby@v1
|
|
46
51
|
with:
|
|
47
|
-
ruby-version: 3.
|
|
52
|
+
ruby-version: '3.4'
|
|
48
53
|
bundler-cache: true
|
|
49
54
|
- name: Prepare credentials
|
|
50
55
|
env:
|
|
@@ -55,4 +60,4 @@ jobs:
|
|
|
55
60
|
- name: Fetch tags from remote
|
|
56
61
|
run: "git fetch -t"
|
|
57
62
|
- name: Publish if version change
|
|
58
|
-
run: 'git diff
|
|
63
|
+
run: 'git diff $(git tag --sort=-v:refname | head -1) -- lib/rspec_in_context/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"'
|
|
@@ -2,18 +2,18 @@ name: Tests
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches-ignore:
|
|
5
|
+
branches-ignore:
|
|
6
6
|
- main
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
tests:
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
|
-
ruby: [2
|
|
12
|
+
ruby: ['3.2', '3.3', '3.4', '4.0']
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
17
|
- name: Set up Ruby
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
@@ -26,12 +26,17 @@ jobs:
|
|
|
26
26
|
prettier:
|
|
27
27
|
runs-on: ubuntu-latest
|
|
28
28
|
steps:
|
|
29
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- name: Set up Ruby
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: '3.4'
|
|
34
|
+
bundler-cache: true
|
|
30
35
|
- name: Set up Node
|
|
31
|
-
uses: actions/setup-node@
|
|
36
|
+
uses: actions/setup-node@v4
|
|
32
37
|
with:
|
|
33
|
-
node-version: '
|
|
38
|
+
node-version: '22'
|
|
34
39
|
- name: Install yarn dep
|
|
35
40
|
run: yarn install
|
|
36
41
|
- name: Check prettier
|
|
37
|
-
run: yarn prettier -c '
|
|
42
|
+
run: yarn prettier -c 'lib/**/*.rb' 'spec/**/*.rb' '*.gemspec' Gemfile
|
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
14
|
- name: Fetch main branch
|
|
15
15
|
run: git fetch origin main:main
|
|
16
16
|
- name: Verify if there's a change in version
|
|
@@ -18,4 +18,8 @@ jobs:
|
|
|
18
18
|
- name: Print new version
|
|
19
19
|
run: 'git diff main -- lib/rspec_in_context/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?"'
|
|
20
20
|
- name: Verify if higher version
|
|
21
|
-
run:
|
|
21
|
+
run: |
|
|
22
|
+
NEW_VERSION=$(git diff main -- lib/rspec_in_context/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?")
|
|
23
|
+
OLD_VERSION=$(git diff main -- lib/rspec_in_context/version.rb | grep -E "^-.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?")
|
|
24
|
+
HIGHEST=$(echo -e "$OLD_VERSION\n$NEW_VERSION" | sort -V | tail -1)
|
|
25
|
+
[[ "$HIGHEST" == "$NEW_VERSION" && "$OLD_VERSION" != "$NEW_VERSION" ]]
|
data/.gitignore
CHANGED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Relaxed.Ruby.Style
|
|
2
|
+
## Version 2.5
|
|
3
|
+
|
|
4
|
+
Style/Alias:
|
|
5
|
+
Enabled: false
|
|
6
|
+
StyleGuide: https://relaxed.ruby.style/#stylealias
|
|
7
|
+
|
|
8
|
+
Style/AsciiComments:
|
|
9
|
+
Enabled: false
|
|
10
|
+
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
|
|
11
|
+
|
|
12
|
+
Style/BeginBlock:
|
|
13
|
+
Enabled: false
|
|
14
|
+
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
|
|
15
|
+
|
|
16
|
+
Style/BlockDelimiters:
|
|
17
|
+
Enabled: false
|
|
18
|
+
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
|
|
19
|
+
|
|
20
|
+
Style/CommentAnnotation:
|
|
21
|
+
Enabled: false
|
|
22
|
+
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
|
|
23
|
+
|
|
24
|
+
Style/Documentation:
|
|
25
|
+
Enabled: false
|
|
26
|
+
StyleGuide: https://relaxed.ruby.style/#styledocumentation
|
|
27
|
+
|
|
28
|
+
Layout/DotPosition:
|
|
29
|
+
Enabled: false
|
|
30
|
+
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
|
|
31
|
+
|
|
32
|
+
Style/DoubleNegation:
|
|
33
|
+
Enabled: false
|
|
34
|
+
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
|
|
35
|
+
|
|
36
|
+
Style/EndBlock:
|
|
37
|
+
Enabled: false
|
|
38
|
+
StyleGuide: https://relaxed.ruby.style/#styleendblock
|
|
39
|
+
|
|
40
|
+
Style/FormatString:
|
|
41
|
+
Enabled: false
|
|
42
|
+
StyleGuide: https://relaxed.ruby.style/#styleformatstring
|
|
43
|
+
|
|
44
|
+
Style/IfUnlessModifier:
|
|
45
|
+
Enabled: false
|
|
46
|
+
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
|
|
47
|
+
|
|
48
|
+
Style/Lambda:
|
|
49
|
+
Enabled: false
|
|
50
|
+
StyleGuide: https://relaxed.ruby.style/#stylelambda
|
|
51
|
+
|
|
52
|
+
Style/ModuleFunction:
|
|
53
|
+
Enabled: false
|
|
54
|
+
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
|
|
55
|
+
|
|
56
|
+
Style/MultilineBlockChain:
|
|
57
|
+
Enabled: false
|
|
58
|
+
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
|
|
59
|
+
|
|
60
|
+
Style/NegatedIf:
|
|
61
|
+
Enabled: false
|
|
62
|
+
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
|
|
63
|
+
|
|
64
|
+
Style/NegatedWhile:
|
|
65
|
+
Enabled: false
|
|
66
|
+
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
|
|
67
|
+
|
|
68
|
+
Style/NumericPredicate:
|
|
69
|
+
Enabled: false
|
|
70
|
+
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
|
|
71
|
+
|
|
72
|
+
Style/ParallelAssignment:
|
|
73
|
+
Enabled: false
|
|
74
|
+
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
|
|
75
|
+
|
|
76
|
+
Style/PercentLiteralDelimiters:
|
|
77
|
+
Enabled: false
|
|
78
|
+
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
|
|
79
|
+
|
|
80
|
+
Style/PerlBackrefs:
|
|
81
|
+
Enabled: false
|
|
82
|
+
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
|
|
83
|
+
|
|
84
|
+
Style/Semicolon:
|
|
85
|
+
Enabled: false
|
|
86
|
+
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
|
|
87
|
+
|
|
88
|
+
Style/SignalException:
|
|
89
|
+
Enabled: false
|
|
90
|
+
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
|
|
91
|
+
|
|
92
|
+
Style/SingleLineBlockParams:
|
|
93
|
+
Enabled: false
|
|
94
|
+
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
|
|
95
|
+
|
|
96
|
+
Style/SingleLineMethods:
|
|
97
|
+
Enabled: false
|
|
98
|
+
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
|
|
99
|
+
|
|
100
|
+
Layout/SpaceBeforeBlockBraces:
|
|
101
|
+
Enabled: false
|
|
102
|
+
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
|
|
103
|
+
|
|
104
|
+
Layout/SpaceInsideParens:
|
|
105
|
+
Enabled: false
|
|
106
|
+
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
|
|
107
|
+
|
|
108
|
+
Style/SpecialGlobalVars:
|
|
109
|
+
Enabled: false
|
|
110
|
+
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
|
|
111
|
+
|
|
112
|
+
Style/StringLiterals:
|
|
113
|
+
Enabled: false
|
|
114
|
+
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
|
|
115
|
+
|
|
116
|
+
Style/TrailingCommaInArguments:
|
|
117
|
+
Enabled: false
|
|
118
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
|
|
119
|
+
|
|
120
|
+
Style/TrailingCommaInArrayLiteral:
|
|
121
|
+
Enabled: false
|
|
122
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
|
|
123
|
+
|
|
124
|
+
Style/TrailingCommaInHashLiteral:
|
|
125
|
+
Enabled: false
|
|
126
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
|
|
127
|
+
|
|
128
|
+
Style/SymbolArray:
|
|
129
|
+
Enabled: false
|
|
130
|
+
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
|
|
131
|
+
|
|
132
|
+
Style/WhileUntilModifier:
|
|
133
|
+
Enabled: false
|
|
134
|
+
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
|
|
135
|
+
|
|
136
|
+
Style/WordArray:
|
|
137
|
+
Enabled: false
|
|
138
|
+
StyleGuide: https://relaxed.ruby.style/#stylewordarray
|
|
139
|
+
|
|
140
|
+
Lint/AmbiguousRegexpLiteral:
|
|
141
|
+
Enabled: false
|
|
142
|
+
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
|
|
143
|
+
|
|
144
|
+
Lint/AssignmentInCondition:
|
|
145
|
+
Enabled: false
|
|
146
|
+
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
|
|
147
|
+
|
|
148
|
+
Layout/LineLength:
|
|
149
|
+
Enabled: false
|
|
150
|
+
|
|
151
|
+
Metrics:
|
|
152
|
+
Enabled: false
|
|
153
|
+
|
data/.rubocop.yml
CHANGED
|
@@ -4,7 +4,7 @@ inherit_from:
|
|
|
4
4
|
inherit_gem:
|
|
5
5
|
prettier: rubocop.yml
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
plugins:
|
|
8
8
|
- rubocop-performance
|
|
9
9
|
|
|
10
10
|
AllCops:
|
|
@@ -27,9 +27,9 @@ Metrics/BlockLength:
|
|
|
27
27
|
Lint/EmptyBlock:
|
|
28
28
|
Enabled: false
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
# Development dependencies in gemspec is a valid pattern for gems
|
|
31
|
+
Gemspec/DevelopmentDependencies:
|
|
32
|
+
Enabled: false
|
|
33
33
|
|
|
34
34
|
### Prettier
|
|
35
35
|
Style/OptionalBooleanParameter:
|
|
@@ -38,6 +38,10 @@ Style/OptionalBooleanParameter:
|
|
|
38
38
|
Style/GuardClause:
|
|
39
39
|
Enabled: false
|
|
40
40
|
|
|
41
|
+
# We legitimately reopen RSpec in multiple files and define separate helper modules
|
|
42
|
+
Style/OneClassPerFile:
|
|
43
|
+
Enabled: false
|
|
44
|
+
|
|
41
45
|
### End Prettier
|
|
42
46
|
Naming/MethodParameterName:
|
|
43
47
|
Enabled: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.1
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.2.0] - 2026-01-27
|
|
10
|
+
### Breaking
|
|
11
|
+
- **BREAKING** Minimum Ruby version is now 3.2
|
|
12
|
+
- **BREAKING** `in_context` without namespace now raises `AmbiguousContextName` if the same context name exists in multiple namespaces. Specify the namespace explicitly to resolve.
|
|
13
|
+
- Removed `codacy-coverage` dependency (incompatible with Ruby 4)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Nested `in_context` with blocks now work correctly (uses a stack instead of a single thread-local variable)
|
|
17
|
+
- Input validation: `define_context` raises `InvalidContextName` for nil/empty names and `MissingDefinitionBlock` when no block is given
|
|
18
|
+
- `AmbiguousContextName` error when a context name exists in multiple namespaces and no namespace is specified
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- CI now tests Ruby 3.2, 3.3, 3.4, and head
|
|
22
|
+
- GitHub Actions updated to v4 (checkout, setup-node)
|
|
23
|
+
- Node updated to 20 in CI
|
|
24
|
+
- Rubocop config uses `plugins` instead of deprecated `require`
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- Thread-safety for nested `in_context` calls with blocks (previous implementation silently overwrote the outer block)
|
|
28
|
+
- Non-deterministic context resolution when multiple namespaces contained the same context name
|
|
29
|
+
- Tests no longer depend on execution order (random order enabled)
|
|
30
|
+
- Removed all global variables from test suite
|
|
31
|
+
|
|
9
32
|
## [1.1.0.3] - 2021-01-13
|
|
10
33
|
### Added
|
|
11
34
|
- Reformating code with Prettier-ruby
|
|
@@ -30,7 +53,10 @@ This is a release in order to test all type of actions
|
|
|
30
53
|
- Changelog
|
|
31
54
|
- Support ruby 3.0
|
|
32
55
|
|
|
33
|
-
[Unreleased]: https://github.com/zaratan/rspec_in_context/compare/v1.
|
|
56
|
+
[Unreleased]: https://github.com/zaratan/rspec_in_context/compare/v1.2.0...HEAD
|
|
57
|
+
[1.2.0]: https://github.com/zaratan/rspec_in_context/compare/v1.1.0.3...v1.2.0
|
|
58
|
+
[1.1.0.3]: https://github.com/zaratan/rspec_in_context/compare/v1.1.0.2...v1.1.0.3
|
|
59
|
+
[1.1.0.2]: https://github.com/zaratan/rspec_in_context/compare/v1.1.0.1...v1.1.0.2
|
|
34
60
|
[1.1.0.1]: https://github.com/zaratan/rspec_in_context/releases/tag/v1.1.0.1
|
|
35
61
|
[1.1.0]: https://github.com/zaratan/rspec_in_context/releases/tag/v1.1.0
|
|
36
62
|
[1.0.1.2]: https://github.com/zaratan/rspec_in_context/releases/tag/v1.0.1.2
|
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# RspecInContext
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/rspec_in_context)
|
|
4
|
-
[](https://www.codacy.com/gh/zaratan/rspec_in_context/dashboard?utm_source=github.com&utm_medium=referral&utm_content=zaratan/rspec_in_context&utm_campaign=Badge_Grade)
|
|
5
4
|

|
|
6
5
|
|
|
7
6
|
This gem is here to help you write better shared_examples in Rspec.
|
|
@@ -115,8 +114,10 @@ end
|
|
|
115
114
|
|
|
116
115
|
* You can add variable instantiation relative to your test where you exactly want:
|
|
117
116
|
|
|
118
|
-
`
|
|
119
|
-
But it
|
|
117
|
+
`instantiate_context` is an alias of `execute_tests` so you can't use both.
|
|
118
|
+
But it lets you describe what the block will do better.
|
|
119
|
+
|
|
120
|
+
> **Note**: The old spelling `instanciate_context` still works but is deprecated and will emit a warning.
|
|
120
121
|
|
|
121
122
|
#### Variable usage
|
|
122
123
|
|
|
@@ -198,18 +199,18 @@ Or
|
|
|
198
199
|
RSpec.define_context "this is a namespaced context", ns: "namespace name"
|
|
199
200
|
```
|
|
200
201
|
|
|
201
|
-
* When you want to use a namespaced in_context, you have two
|
|
202
|
+
* When you want to use a namespaced in_context, you have two choices:
|
|
202
203
|
|
|
203
|
-
Ignore any namespace and it will try to find a corresponding in_context in
|
|
204
|
+
Ignore any namespace and it will try to find a corresponding in_context in any namespace (the ones defined without namespace have the priority). **Note**: if the same context name exists in multiple namespaces, an `AmbiguousContextName` error will be raised — you must specify the namespace explicitly.
|
|
204
205
|
```ruby
|
|
205
206
|
define_context "namespaced context", ns: "namespace name" do
|
|
206
207
|
[...]
|
|
207
208
|
end
|
|
208
209
|
|
|
209
|
-
in_context "namespaced context"
|
|
210
|
+
in_context "namespaced context" # Works if only one namespace has this name
|
|
210
211
|
```
|
|
211
212
|
|
|
212
|
-
Pass a namespace and it will look only in this
|
|
213
|
+
Pass a namespace and it will look only in this namespace.
|
|
213
214
|
```ruby
|
|
214
215
|
define_context "namespaced context", ns: "namespace name" do
|
|
215
216
|
[...]
|
|
@@ -268,6 +269,24 @@ end
|
|
|
268
269
|
```
|
|
269
270
|
Will print "MyNiceClass with my_var defined works" and "MyNiceClass without my_var defined doesn't work". Which is valid and readable documentation.
|
|
270
271
|
|
|
272
|
+
## Migrating to 1.2.0
|
|
273
|
+
|
|
274
|
+
### Breaking changes
|
|
275
|
+
|
|
276
|
+
- **Ruby >= 3.2 required.** Older Rubies are no longer supported.
|
|
277
|
+
- **`AmbiguousContextName` error.** If the same context name exists in multiple namespaces and you call `in_context` without specifying a namespace, `AmbiguousContextName` is now raised instead of silently picking one. Fix: add `ns:` to disambiguate.
|
|
278
|
+
- **`ActiveSupport` removed.** The gem no longer depends on `activesupport`. This should be transparent, but if you were relying on `HashWithIndifferentAccess` behavior from the gem's internals, note that contexts are now stored in a plain `Hash` with string-normalized keys (symbols and strings still work interchangeably).
|
|
279
|
+
|
|
280
|
+
### Deprecations
|
|
281
|
+
|
|
282
|
+
- **`instanciate_context`** is deprecated (typo). Use `instantiate_context` or `execute_tests` instead. The old method still works but emits a warning to `$stderr`.
|
|
283
|
+
|
|
284
|
+
### New features
|
|
285
|
+
|
|
286
|
+
- **Input validation**: `define_context` now raises `InvalidContextName` (nil/empty name) and `MissingDefinitionBlock` (no block).
|
|
287
|
+
- **`clear_all_contexts!`**: Call `RspecInContext::InContext.clear_all_contexts!` to free all stored contexts for memory cleanup in long-running suites.
|
|
288
|
+
- **Thread-safety**: The context registry is now protected by a Mutex for `parallel_tests` in thread mode.
|
|
289
|
+
|
|
271
290
|
## Development
|
|
272
291
|
|
|
273
292
|
|
data/TODO.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# TODO
|
|
2
|
+
|
|
3
|
+
Issues identified during review of the codebase and PR #21.
|
|
4
|
+
|
|
5
|
+
## PR #21 — Resolved
|
|
6
|
+
|
|
7
|
+
- [x] Stack leak if `find_context` raises — moved `find_context` before `push`
|
|
8
|
+
- [x] Indentation of `spec.metadata` in gemspec — fixed by prettier
|
|
9
|
+
- [ ] `.ruby-version` 4.0.1 vs CI matrix — `head` covers it, revisit if contributor confusion arises
|
|
10
|
+
|
|
11
|
+
## P0 — Before merge
|
|
12
|
+
|
|
13
|
+
- [x] Quote prettier globs in CI — quoted `'lib/**/*.rb'` etc. in both workflow files
|
|
14
|
+
- [x] Gitignore `.rubocop-remote-*.yml` — added pattern to `.gitignore`
|
|
15
|
+
|
|
16
|
+
## P1 — Réduction des dépendances
|
|
17
|
+
|
|
18
|
+
- [x] Retirer `active_support/all` — remplacé `HashWithIndifferentAccess` par `Hash` avec `.to_s` sur les clés, retiré `present?`. Temps de boot des tests : 0.27s → 0.08s
|
|
19
|
+
- [x] Retirer `faker` — retiré de `spec_helper.rb` et `rspec_in_context.gemspec`
|
|
20
|
+
|
|
21
|
+
## P1 — Robustesse face aux internals RSpec
|
|
22
|
+
|
|
23
|
+
- [x] Smoke test pour `hooks.instance_variable_get(:@owner)` — vérifie que `@owner` est non-nil et est une Class
|
|
24
|
+
- [x] Smoke test pour le prepend de `ContextManagement` sur `ExampleGroup.subclass`
|
|
25
|
+
- [x] Resserrer les contraintes de version — `rspec "~> 3.0"`, `rake "~> 13.0"`, `activesupport` retiré
|
|
26
|
+
|
|
27
|
+
## P2 — Qualité de l'API
|
|
28
|
+
|
|
29
|
+
- [x] Ajouter `RspecInContext::Error` comme classe de base — `NoContextFound` et `AmbiguousContextName` en héritent
|
|
30
|
+
- [x] Retirer le `instance_exec` inutile dans `define_context`
|
|
31
|
+
- [x] Corriger les typos dans les commentaires (`find` → `found`, `overriden` → `overridden`, `colisions` → `collisions`)
|
|
32
|
+
- [x] Corriger `instanciate_context` — ajouté `instantiate_context` comme alias principal, l'ancien émet un deprecation warning
|
|
33
|
+
|
|
34
|
+
## P2 — Tests
|
|
35
|
+
|
|
36
|
+
- [x] Renforcer les tests — block delivery guard dynamique (voir `spec/support/block_delivery_guard.rb`) détecte les blocs non-consommés et les groupes vides. Les `expect(true).to be_truthy` restants sont acceptables car le guard couvre la disparition silencieuse.
|
|
37
|
+
- [x] Sémantique de `test_inexisting_context` — vérifiée et documentée. Appelle `find_context` au runtime, qui est la première opération de `in_context`. Le comportement est identique.
|
|
38
|
+
|
|
39
|
+
## P3 — Nice to have
|
|
40
|
+
|
|
41
|
+
- [x] Ajouter `clear_all_contexts!` pour le nettoyage mémoire — `RspecInContext::InContext.clear_all_contexts!` réinitialise le registre. Test ajouté avec sauvegarde/restauration du state.
|
|
42
|
+
- [x] Ajouter un Mutex autour de `@contexts` — `@contexts_mutex` protège l'initialisation et le clear. Thread-safe pour `parallel_tests` en mode thread.
|
|
43
|
+
- [x] Corriger les typos restantes dans les commentaires — fait avec les fixes P2
|
|
44
|
+
- [x] Section migration dans le README — section "Migrating to 1.2.0" ajoutée avec breaking changes, deprecations, et nouvelles features. Mise à jour de la mention `instanciate_context` → `instantiate_context`.
|
|
@@ -6,7 +6,7 @@ module RspecInContext
|
|
|
6
6
|
# @api private
|
|
7
7
|
# prepending a RSpec method so we can know when a describe/context block finish
|
|
8
8
|
# its reading
|
|
9
|
-
def subclass(parent, description, args, registration_collection, &
|
|
9
|
+
def subclass(parent, description, args, registration_collection, &)
|
|
10
10
|
subclass = super
|
|
11
11
|
RspecInContext::InContext.remove_context(subclass)
|
|
12
12
|
subclass
|
|
@@ -2,13 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# Base module
|
|
4
4
|
module RspecInContext
|
|
5
|
-
#
|
|
6
|
-
class
|
|
5
|
+
# Base error class for all gem errors
|
|
6
|
+
class Error < StandardError
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# Error type when no context is found from its name (and eventually namespace)
|
|
10
|
+
class NoContextFound < Error
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Error type when define_context is called without a block
|
|
14
|
+
class MissingDefinitionBlock < ArgumentError
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Error type when context_name is nil or empty
|
|
18
|
+
class InvalidContextName < ArgumentError
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Error type when multiple namespaces contain a context with the same name
|
|
22
|
+
class AmbiguousContextName < Error
|
|
23
|
+
end
|
|
7
24
|
|
|
8
25
|
# Context struct
|
|
9
26
|
# @attr [Proc] block what will be executed in the test context
|
|
10
27
|
# @attr [Class] owner current rspec context class. This will be used to know where a define_context has been defined
|
|
11
|
-
# @attr [String | Symbol] name represent the name by which the context can be
|
|
28
|
+
# @attr [String | Symbol] name represent the name by which the context can be found.
|
|
12
29
|
# @attr [String | Symbol] namespace namespace for context names to avoid collisions
|
|
13
30
|
# @attr [Boolean] silent does the in_context wrap itself into a context with its name or an anonymous context
|
|
14
31
|
Context = Struct.new(:block, :owner, :name, :namespace, :silent)
|
|
@@ -17,6 +34,9 @@ module RspecInContext
|
|
|
17
34
|
module InContext
|
|
18
35
|
# Name of the Global context
|
|
19
36
|
GLOBAL_CONTEXT = :global_context
|
|
37
|
+
# Mutex protecting @contexts for thread-safety (e.g. parallel_tests in thread mode)
|
|
38
|
+
@contexts_mutex = Mutex.new
|
|
39
|
+
|
|
20
40
|
class << self
|
|
21
41
|
# Hook for easier inclusion of the gem in RSpec
|
|
22
42
|
# @api private
|
|
@@ -25,50 +45,105 @@ module RspecInContext
|
|
|
25
45
|
end
|
|
26
46
|
|
|
27
47
|
# Contexts container + creation
|
|
48
|
+
# Keys are normalized to strings so symbols and strings are interchangeable.
|
|
28
49
|
# @api private
|
|
29
50
|
def contexts
|
|
30
|
-
@
|
|
51
|
+
@contexts_mutex.synchronize do
|
|
52
|
+
@contexts ||= Hash.new { |hash, key| hash[key.to_s] = {} }
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Remove all stored contexts (both scoped and global).
|
|
57
|
+
# Useful for memory cleanup in long-running test suites with
|
|
58
|
+
# dynamically generated contexts.
|
|
59
|
+
def clear_all_contexts!
|
|
60
|
+
@contexts_mutex.synchronize { @contexts = nil }
|
|
31
61
|
end
|
|
32
62
|
|
|
33
63
|
# Meta method to add a new context
|
|
34
64
|
# @api private
|
|
35
65
|
#
|
|
36
|
-
# @note Will warn if a context is
|
|
37
|
-
|
|
66
|
+
# @note Will warn if a context is overridden
|
|
67
|
+
# @raise [InvalidContextName] if context_name is nil or empty
|
|
68
|
+
# @raise [MissingDefinitionBlock] if no block is provided
|
|
69
|
+
def add_context(
|
|
70
|
+
context_name,
|
|
71
|
+
owner = nil,
|
|
72
|
+
namespace = nil,
|
|
73
|
+
silent = true,
|
|
74
|
+
&block
|
|
75
|
+
)
|
|
76
|
+
if context_name.nil? ||
|
|
77
|
+
(context_name.respond_to?(:empty?) && context_name.empty?)
|
|
78
|
+
raise InvalidContextName, "context_name cannot be nil or empty"
|
|
79
|
+
end
|
|
80
|
+
unless block
|
|
81
|
+
raise MissingDefinitionBlock, "define_context requires a block"
|
|
82
|
+
end
|
|
83
|
+
|
|
38
84
|
namespace ||= GLOBAL_CONTEXT
|
|
39
|
-
|
|
40
|
-
|
|
85
|
+
ns_key = namespace.to_s
|
|
86
|
+
name_key = context_name.to_s
|
|
87
|
+
if contexts.dig(ns_key, name_key)
|
|
88
|
+
warn("Overriding an existing context: #{context_name}@#{namespace}")
|
|
89
|
+
end
|
|
90
|
+
contexts[ns_key][name_key] = Context.new(
|
|
91
|
+
block,
|
|
92
|
+
owner,
|
|
93
|
+
context_name,
|
|
94
|
+
namespace,
|
|
95
|
+
silent,
|
|
96
|
+
)
|
|
41
97
|
end
|
|
42
98
|
|
|
43
99
|
# Find a context.
|
|
44
100
|
# @api private
|
|
101
|
+
# @raise [NoContextFound] if no context is found
|
|
102
|
+
# @raise [AmbiguousContextName] if multiple namespaces contain the same context name
|
|
45
103
|
def find_context(context_name, namespace = nil)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
104
|
+
name_key = context_name.to_s
|
|
105
|
+
result =
|
|
106
|
+
if namespace && !namespace.to_s.empty?
|
|
107
|
+
contexts.dig(namespace.to_s, name_key)
|
|
108
|
+
else
|
|
109
|
+
find_context_across_all_namespaces(name_key)
|
|
110
|
+
end
|
|
111
|
+
result ||
|
|
112
|
+
(raise NoContextFound, "No context found with name #{context_name}")
|
|
51
113
|
end
|
|
52
114
|
|
|
53
115
|
# Look into every namespace to find the context
|
|
116
|
+
# Uses dig to avoid auto-vivifying empty namespace entries
|
|
54
117
|
# @api private
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
118
|
+
# @raise [AmbiguousContextName] if multiple namespaces contain the same context name
|
|
119
|
+
def find_context_across_all_namespaces(name_key)
|
|
120
|
+
matching_namespaces =
|
|
121
|
+
contexts.select do |_, namespaced_contexts|
|
|
122
|
+
namespaced_contexts[name_key]
|
|
123
|
+
end
|
|
124
|
+
if matching_namespaces.size > 1
|
|
125
|
+
namespace_names = matching_namespaces.keys.join(", ")
|
|
126
|
+
raise AmbiguousContextName,
|
|
127
|
+
"Context '#{name_key}' exists in multiple namespaces (#{namespace_names}). " \
|
|
128
|
+
"Please specify a namespace."
|
|
129
|
+
end
|
|
130
|
+
matching_namespaces.values.first&.[](name_key)
|
|
58
131
|
end
|
|
59
132
|
|
|
60
133
|
# @api private
|
|
61
134
|
# Delete a context
|
|
62
135
|
def remove_context(current_class)
|
|
63
136
|
contexts.each_value do |namespaced_contexts|
|
|
64
|
-
namespaced_contexts.delete_if
|
|
137
|
+
namespaced_contexts.delete_if do |_, context|
|
|
138
|
+
context.owner == current_class
|
|
139
|
+
end
|
|
65
140
|
end
|
|
66
141
|
end
|
|
67
142
|
|
|
68
143
|
# @api private
|
|
69
144
|
# Define a context from outside a RSpec.describe block
|
|
70
|
-
def outside_define_context(context_name, namespace, silent, &
|
|
71
|
-
InContext.add_context(context_name, nil, namespace, silent, &
|
|
145
|
+
def outside_define_context(context_name, namespace, silent, &)
|
|
146
|
+
InContext.add_context(context_name, nil, namespace, silent, &)
|
|
72
147
|
end
|
|
73
148
|
end
|
|
74
149
|
|
|
@@ -83,40 +158,69 @@ module RspecInContext
|
|
|
83
158
|
# @param block Content that will be re-injected (see #execute_tests)
|
|
84
159
|
def in_context(context_name, *args, namespace: nil, ns: nil, &block)
|
|
85
160
|
namespace ||= ns
|
|
86
|
-
Thread.current[:test_block] = block
|
|
87
161
|
context_to_exec = InContext.find_context(context_name, namespace)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
162
|
+
Thread.current[:test_block_stack] ||= []
|
|
163
|
+
Thread.current[:test_block_stack].push(block)
|
|
164
|
+
begin
|
|
165
|
+
if context_to_exec.silent
|
|
166
|
+
context { instance_exec(*args, &context_to_exec.block) }
|
|
167
|
+
else
|
|
168
|
+
context(
|
|
169
|
+
context_name.to_s,
|
|
170
|
+
) { instance_exec(*args, &context_to_exec.block) }
|
|
171
|
+
end
|
|
172
|
+
ensure
|
|
173
|
+
Thread.current[:test_block_stack].pop
|
|
174
|
+
end
|
|
91
175
|
end
|
|
92
176
|
|
|
93
177
|
# Used in context definition
|
|
94
178
|
# Place where you want to re-inject code passed in argument of in_context
|
|
95
|
-
#
|
|
96
|
-
# For convenience and readability, a `instanciate_context` alias have been defined
|
|
97
179
|
# (for more examples look at tests)
|
|
98
180
|
def execute_tests
|
|
99
|
-
|
|
181
|
+
current_block = Thread.current[:test_block_stack]&.last
|
|
182
|
+
instance_exec(¤t_block) if current_block
|
|
183
|
+
end
|
|
184
|
+
alias instantiate_context execute_tests
|
|
185
|
+
|
|
186
|
+
# @deprecated Use {#instantiate_context} or {#execute_tests} instead
|
|
187
|
+
def instanciate_context
|
|
188
|
+
warn(
|
|
189
|
+
"DEPRECATION: `instanciate_context` is deprecated due to a typo. " \
|
|
190
|
+
"Use `instantiate_context` or `execute_tests` instead.",
|
|
191
|
+
uplevel: 1,
|
|
192
|
+
)
|
|
193
|
+
execute_tests
|
|
100
194
|
end
|
|
101
|
-
alias instanciate_context execute_tests
|
|
102
195
|
|
|
103
196
|
# Let you define a context that can be reused later
|
|
104
197
|
#
|
|
105
198
|
# @param context_name [String, Symbol] The name of the context that will be re-used later
|
|
106
199
|
# @param namespace [String, Symbol] namespace name where the context will be stored.
|
|
107
|
-
# It helps reducing
|
|
200
|
+
# It helps reducing collisions when you define "global" contexts
|
|
108
201
|
# @param ns [String, Symbol] Alias of namespace
|
|
109
202
|
# @param block [Proc] Contain the code that will be injected with #in_context later
|
|
110
203
|
# @param silent [Boolean] Does the in_context wrap itself into a context with its name or an anonymous context
|
|
111
204
|
# @param print_context [Boolean] Reverse alias of silent
|
|
112
205
|
#
|
|
113
206
|
# @note contexts are scoped to the block they are defined in.
|
|
114
|
-
def define_context(
|
|
207
|
+
def define_context(
|
|
208
|
+
context_name,
|
|
209
|
+
namespace: nil,
|
|
210
|
+
ns: nil,
|
|
211
|
+
silent: true,
|
|
212
|
+
print_context: nil,
|
|
213
|
+
&
|
|
214
|
+
)
|
|
115
215
|
namespace ||= ns
|
|
116
|
-
silent = print_context.nil?
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
216
|
+
silent = !print_context unless print_context.nil?
|
|
217
|
+
InContext.add_context(
|
|
218
|
+
context_name,
|
|
219
|
+
hooks.instance_variable_get(:@owner),
|
|
220
|
+
namespace,
|
|
221
|
+
silent,
|
|
222
|
+
&
|
|
223
|
+
)
|
|
120
224
|
end
|
|
121
225
|
end
|
|
122
226
|
end
|
data/lib/rspec_in_context.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
6
|
-
require 'rspec_in_context/context_management'
|
|
3
|
+
require "rspec_in_context/version"
|
|
4
|
+
require "rspec_in_context/in_context"
|
|
5
|
+
require "rspec_in_context/context_management"
|
|
7
6
|
|
|
8
7
|
# Main wrapping module
|
|
9
8
|
module RspecInContext
|
|
@@ -24,9 +23,16 @@ module RSpec
|
|
|
24
23
|
# @param silent [Boolean] Does the in_context should wrap itself into a context block with its name
|
|
25
24
|
# @param print_context [Boolean] Reverse alias of silent
|
|
26
25
|
# @param block [Proc] code that will be injected later
|
|
27
|
-
def self.define_context(
|
|
26
|
+
def self.define_context(
|
|
27
|
+
name,
|
|
28
|
+
namespace: nil,
|
|
29
|
+
ns: nil,
|
|
30
|
+
silent: true,
|
|
31
|
+
print_context: nil,
|
|
32
|
+
&
|
|
33
|
+
)
|
|
28
34
|
namespace ||= ns
|
|
29
|
-
silent = print_context.nil?
|
|
30
|
-
RspecInContext::InContext.outside_define_context(name, namespace, silent, &
|
|
35
|
+
silent = !print_context unless print_context.nil?
|
|
36
|
+
RspecInContext::InContext.outside_define_context(name, namespace, silent, &)
|
|
31
37
|
end
|
|
32
38
|
end
|
data/package.json
CHANGED
|
@@ -6,7 +6,21 @@
|
|
|
6
6
|
"author": "Denis <Zaratan> Pasin <zaratan@hey.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@prettier/plugin-ruby": "^
|
|
10
|
-
"prettier": "^
|
|
9
|
+
"@prettier/plugin-ruby": "^4.0",
|
|
10
|
+
"prettier": "^3.8.1"
|
|
11
|
+
},
|
|
12
|
+
"prettier": {
|
|
13
|
+
"trailingComma": "es5",
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@prettier/plugin-ruby"
|
|
16
|
+
],
|
|
17
|
+
"overrides": [
|
|
18
|
+
{
|
|
19
|
+
"files": "*.rb",
|
|
20
|
+
"options": {
|
|
21
|
+
"parser": "ruby"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
11
25
|
}
|
|
12
26
|
}
|
data/rspec_in_context.gemspec
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
lib = File.expand_path(
|
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require "rspec_in_context/version"
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name
|
|
9
|
-
spec.version
|
|
10
|
-
spec.authors
|
|
11
|
-
spec.email
|
|
8
|
+
spec.name = "rspec_in_context"
|
|
9
|
+
spec.version = RspecInContext::VERSION
|
|
10
|
+
spec.authors = ["Denis <Zaratan> Pasin"]
|
|
11
|
+
spec.email = ["denis@pasin.fr"]
|
|
12
12
|
|
|
13
|
-
spec.summary
|
|
14
|
-
|
|
13
|
+
spec.summary =
|
|
14
|
+
'This gem is here to help DRYing your tests cases by giving a better "shared_examples".'
|
|
15
|
+
spec.homepage = "https://github.com/denispasin/rspec_in_context"
|
|
15
16
|
|
|
16
17
|
# Specify which files should be added to the gem when it is released.
|
|
17
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
18
|
-
spec.files
|
|
19
|
+
spec.files =
|
|
19
20
|
Dir.chdir(File.expand_path(__dir__)) do
|
|
20
|
-
`git ls-files -z`.split("\x0")
|
|
21
|
+
`git ls-files -z`.split("\x0")
|
|
22
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
21
23
|
end
|
|
22
|
-
spec.bindir
|
|
23
|
-
spec.executables
|
|
24
|
+
spec.bindir = "exe"
|
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
26
|
spec.require_paths = ["lib"]
|
|
25
|
-
spec.required_ruby_version =
|
|
26
|
-
spec.license =
|
|
27
|
+
spec.required_ruby_version = ">= 3.2.0"
|
|
28
|
+
spec.license = "MIT"
|
|
27
29
|
|
|
28
|
-
spec.add_dependency "
|
|
29
|
-
spec.add_dependency "rspec", "> 3.0"
|
|
30
|
+
spec.add_dependency "rspec", "~> 3.0"
|
|
30
31
|
|
|
31
32
|
spec.add_development_dependency "bundler"
|
|
32
33
|
spec.add_development_dependency "bundler-audit", "> 0.6.0"
|
|
33
|
-
|
|
34
|
-
spec.add_development_dependency "faker", "> 1.8"
|
|
34
|
+
|
|
35
35
|
spec.add_development_dependency "guard-rspec", "> 4.7"
|
|
36
|
-
spec.add_development_dependency "overcommit",
|
|
36
|
+
spec.add_development_dependency "overcommit", "> 0.46"
|
|
37
37
|
spec.add_development_dependency "prettier"
|
|
38
|
-
spec.add_development_dependency "rake", "~>
|
|
38
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
39
39
|
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
|
|
40
|
-
spec.add_development_dependency "rubocop", "
|
|
40
|
+
spec.add_development_dependency "rubocop", "~> 1.82"
|
|
41
41
|
spec.add_development_dependency "rubocop-performance"
|
|
42
42
|
spec.add_development_dependency "simplecov", "> 0.16"
|
|
43
43
|
spec.add_development_dependency "solargraph"
|
|
44
44
|
spec.add_development_dependency "yard"
|
|
45
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
45
46
|
end
|
data/yarn.lock
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
# yarn lockfile v1
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
"@prettier/plugin-ruby@^
|
|
6
|
-
version "
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-
|
|
8
|
-
integrity sha512-
|
|
9
|
-
dependencies:
|
|
10
|
-
prettier ">=1.10"
|
|
5
|
+
"@prettier/plugin-ruby@^4.0":
|
|
6
|
+
version "4.0.4"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz#73d85fc2a1731a3f62b57ac3116cf1c234027cb6"
|
|
8
|
+
integrity sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==
|
|
11
9
|
|
|
12
|
-
prettier
|
|
13
|
-
version "
|
|
14
|
-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-
|
|
15
|
-
integrity sha512-
|
|
10
|
+
prettier@^3.8.1:
|
|
11
|
+
version "3.8.1"
|
|
12
|
+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.8.1.tgz#edf48977cf991558f4fcbd8a3ba6015ba2a3a173"
|
|
13
|
+
integrity sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==
|
metadata
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec_in_context
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Denis <Zaratan> Pasin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: activesupport
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.0'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.0'
|
|
27
12
|
- !ruby/object:Gem::Dependency
|
|
28
13
|
name: rspec
|
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
|
30
15
|
requirements:
|
|
31
|
-
- - "
|
|
16
|
+
- - "~>"
|
|
32
17
|
- !ruby/object:Gem::Version
|
|
33
18
|
version: '3.0'
|
|
34
19
|
type: :runtime
|
|
35
20
|
prerelease: false
|
|
36
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
22
|
requirements:
|
|
38
|
-
- - "
|
|
23
|
+
- - "~>"
|
|
39
24
|
- !ruby/object:Gem::Version
|
|
40
25
|
version: '3.0'
|
|
41
26
|
- !ruby/object:Gem::Dependency
|
|
@@ -66,34 +51,6 @@ dependencies:
|
|
|
66
51
|
- - ">"
|
|
67
52
|
- !ruby/object:Gem::Version
|
|
68
53
|
version: 0.6.0
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: codacy-coverage
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: 2.1.0
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: 2.1.0
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: faker
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">"
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '1.8'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">"
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '1.8'
|
|
97
54
|
- !ruby/object:Gem::Dependency
|
|
98
55
|
name: guard-rspec
|
|
99
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -142,14 +99,14 @@ dependencies:
|
|
|
142
99
|
requirements:
|
|
143
100
|
- - "~>"
|
|
144
101
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '
|
|
102
|
+
version: '13.0'
|
|
146
103
|
type: :development
|
|
147
104
|
prerelease: false
|
|
148
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
106
|
requirements:
|
|
150
107
|
- - "~>"
|
|
151
108
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
109
|
+
version: '13.0'
|
|
153
110
|
- !ruby/object:Gem::Dependency
|
|
154
111
|
name: rspec_junit_formatter
|
|
155
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -168,16 +125,16 @@ dependencies:
|
|
|
168
125
|
name: rubocop
|
|
169
126
|
requirement: !ruby/object:Gem::Requirement
|
|
170
127
|
requirements:
|
|
171
|
-
- - "
|
|
128
|
+
- - "~>"
|
|
172
129
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: '
|
|
130
|
+
version: '1.82'
|
|
174
131
|
type: :development
|
|
175
132
|
prerelease: false
|
|
176
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
134
|
requirements:
|
|
178
|
-
- - "
|
|
135
|
+
- - "~>"
|
|
179
136
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: '
|
|
137
|
+
version: '1.82'
|
|
181
138
|
- !ruby/object:Gem::Dependency
|
|
182
139
|
name: rubocop-performance
|
|
183
140
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -234,7 +191,6 @@ dependencies:
|
|
|
234
191
|
- - ">="
|
|
235
192
|
- !ruby/object:Gem::Version
|
|
236
193
|
version: '0'
|
|
237
|
-
description:
|
|
238
194
|
email:
|
|
239
195
|
- denis@pasin.fr
|
|
240
196
|
executables: []
|
|
@@ -250,6 +206,7 @@ files:
|
|
|
250
206
|
- ".prettierrc.js"
|
|
251
207
|
- ".rspec"
|
|
252
208
|
- ".rubocop-http---relaxed-ruby-style-rubocop-yml"
|
|
209
|
+
- ".rubocop-remote-fc7fff8f41d19bde0dcc446ded612e75.yml"
|
|
253
210
|
- ".rubocop.yml"
|
|
254
211
|
- ".ruby-gemset"
|
|
255
212
|
- ".ruby-version"
|
|
@@ -258,6 +215,7 @@ files:
|
|
|
258
215
|
- Guardfile
|
|
259
216
|
- README.md
|
|
260
217
|
- Rakefile
|
|
218
|
+
- TODO.md
|
|
261
219
|
- bin/console
|
|
262
220
|
- bin/setup
|
|
263
221
|
- lib/rspec_in_context.rb
|
|
@@ -270,8 +228,8 @@ files:
|
|
|
270
228
|
homepage: https://github.com/denispasin/rspec_in_context
|
|
271
229
|
licenses:
|
|
272
230
|
- MIT
|
|
273
|
-
metadata:
|
|
274
|
-
|
|
231
|
+
metadata:
|
|
232
|
+
rubygems_mfa_required: 'true'
|
|
275
233
|
rdoc_options: []
|
|
276
234
|
require_paths:
|
|
277
235
|
- lib
|
|
@@ -279,15 +237,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
279
237
|
requirements:
|
|
280
238
|
- - ">="
|
|
281
239
|
- !ruby/object:Gem::Version
|
|
282
|
-
version: 2.
|
|
240
|
+
version: 3.2.0
|
|
283
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
284
242
|
requirements:
|
|
285
243
|
- - ">="
|
|
286
244
|
- !ruby/object:Gem::Version
|
|
287
245
|
version: '0'
|
|
288
246
|
requirements: []
|
|
289
|
-
rubygems_version: 3.
|
|
290
|
-
signing_key:
|
|
247
|
+
rubygems_version: 3.6.9
|
|
291
248
|
specification_version: 4
|
|
292
249
|
summary: This gem is here to help DRYing your tests cases by giving a better "shared_examples".
|
|
293
250
|
test_files: []
|