rspec_in_context 1.1.0.2 → 1.1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.git-hooks/pre_push/rubocop.rb +1 -1
- data/.github/workflows/test_and_publish.yml +13 -1
- data/.github/workflows/test_only.yml +12 -0
- data/.prettierrc.js +5 -0
- data/.rubocop.yml +12 -40
- data/CHANGELOG.md +8 -3
- data/lib/rspec_in_context.rb +3 -3
- data/lib/rspec_in_context/in_context.rb +4 -11
- data/lib/rspec_in_context/version.rb +1 -1
- data/package.json +12 -0
- data/rspec_in_context.gemspec +1 -0
- data/yarn.lock +15 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 396ac1ad678b893101818beed41905f47001763564732394bc49e9d012b30724
|
4
|
+
data.tar.gz: 75aade9204f167acf1ed13cc2dbae4915b763bfed982ee0c13df829e8603614d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 472f949b3803f3fbd39cf431b92522676500d49ea8dc96ea1a642ca98399d899af6cc982463b08947097b9a10b71628ea11efe24b945304f27c2e50925328bb2
|
7
|
+
data.tar.gz: 7614f19235fbd64c61d7d11b19e39093ca1aa41daff7d5f33c27bc1c06011faa3c02988a106dee2bfefb7f5810dc1d2773d9901f7021908e252c7ea571590607
|
@@ -23,8 +23,20 @@ jobs:
|
|
23
23
|
run: bundle exec rubocop
|
24
24
|
- name: Run tests
|
25
25
|
run: bundle exec rspec
|
26
|
+
prettier:
|
27
|
+
runs-on: ubuntu-latest
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Node
|
31
|
+
uses: actions/setup-node@v2
|
32
|
+
with:
|
33
|
+
node-version: '14'
|
34
|
+
- name: Install yarn dep
|
35
|
+
run: yarn install
|
36
|
+
- name: Check prettier
|
37
|
+
run: yarn prettier -c '**/*.rb'
|
26
38
|
release:
|
27
|
-
needs: [tests]
|
39
|
+
needs: [tests, prettier]
|
28
40
|
runs-on: ubuntu-latest
|
29
41
|
|
30
42
|
steps:
|
@@ -23,3 +23,15 @@ jobs:
|
|
23
23
|
run: bundle exec rubocop
|
24
24
|
- name: Run tests
|
25
25
|
run: bundle exec rspec
|
26
|
+
prettier:
|
27
|
+
runs-on: ubuntu-latest
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Node
|
31
|
+
uses: actions/setup-node@v2
|
32
|
+
with:
|
33
|
+
node-version: '14'
|
34
|
+
- name: Install yarn dep
|
35
|
+
run: yarn install
|
36
|
+
- name: Check prettier
|
37
|
+
run: yarn prettier -c '**/*.rb'
|
data/.prettierrc.js
ADDED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
inherit_from:
|
2
2
|
- http://relaxed.ruby.style/rubocop.yml
|
3
3
|
|
4
|
+
inherit_gem:
|
5
|
+
prettier: rubocop.yml
|
6
|
+
|
4
7
|
require:
|
5
8
|
- rubocop-performance
|
6
9
|
|
@@ -8,9 +11,11 @@ AllCops:
|
|
8
11
|
NewCops: enable
|
9
12
|
DisplayStyleGuide: true
|
10
13
|
DisplayCopNames: true
|
14
|
+
SuggestExtensions: false
|
11
15
|
Exclude:
|
12
16
|
- 'bin/*'
|
13
17
|
- 'vendor/**/*'
|
18
|
+
- 'node_modules/**/*'
|
14
19
|
|
15
20
|
Metrics/BlockLength:
|
16
21
|
Exclude:
|
@@ -26,46 +31,13 @@ Style/GlobalVars:
|
|
26
31
|
Exclude:
|
27
32
|
- spec/rspec_in_context/in_context_spec.rb
|
28
33
|
|
29
|
-
|
34
|
+
### Prettier
|
35
|
+
Style/OptionalBooleanParameter:
|
30
36
|
Enabled: false
|
31
37
|
|
32
|
-
|
33
|
-
Enabled:
|
34
|
-
EnforcedStyle: trailing
|
35
|
-
|
36
|
-
Style/TrailingCommaInArrayLiteral:
|
37
|
-
Enabled: true
|
38
|
-
EnforcedStyleForMultiline: comma
|
39
|
-
|
40
|
-
Style/TrailingCommaInHashLiteral:
|
41
|
-
Enabled: true
|
42
|
-
EnforcedStyleForMultiline: comma
|
43
|
-
|
44
|
-
Layout/MultilineArrayLineBreaks:
|
45
|
-
Enabled: true
|
46
|
-
|
47
|
-
Layout/MultilineHashKeyLineBreaks:
|
48
|
-
Enabled: true
|
49
|
-
|
50
|
-
Layout/MultilineMethodArgumentLineBreaks:
|
51
|
-
Enabled: true
|
52
|
-
|
53
|
-
Layout/FirstArrayElementLineBreak:
|
54
|
-
Enabled: true
|
55
|
-
|
56
|
-
Layout/FirstHashElementLineBreak:
|
57
|
-
Enabled: true
|
58
|
-
|
59
|
-
Layout/FirstMethodArgumentLineBreak:
|
60
|
-
Enabled: true
|
61
|
-
|
62
|
-
Layout/MultilineAssignmentLayout:
|
63
|
-
Enabled: true
|
38
|
+
Style/GuardClause:
|
39
|
+
Enabled: false
|
64
40
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
AutoCorrect: true
|
69
|
-
Exclude:
|
70
|
-
- Gemfile
|
71
|
-
- Guardfile
|
41
|
+
### End Prettier
|
42
|
+
Naming/MethodParameterName:
|
43
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -6,15 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.1.0.3] - 2021-01-13
|
10
|
+
### Added
|
11
|
+
- Reformating code with Prettier-ruby
|
12
|
+
|
13
|
+
## [1.1.0.2] - 2021-01-08
|
14
|
+
### Changed
|
15
|
+
- Wrapping silent in_context in anonymous contexts
|
16
|
+
|
9
17
|
## [1.1.0.1] - 2020-12-27
|
10
18
|
This is a release in order to test all type of actions
|
11
19
|
|
12
20
|
### Added
|
13
21
|
- Cache support in github actions for ease of development
|
14
22
|
|
15
|
-
## [1.1.0.2] - 2021-01-08
|
16
|
-
### Changed
|
17
|
-
- Wrapping silent in_context in anonymous contexts
|
18
23
|
|
19
24
|
## [1.1.0] - 2020-12-27
|
20
25
|
### Added
|
data/lib/rspec_in_context.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/all'
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
4
|
+
require 'rspec_in_context/version'
|
5
|
+
require 'rspec_in_context/in_context'
|
6
|
+
require 'rspec_in_context/context_management'
|
7
7
|
|
8
8
|
# Main wrapping module
|
9
9
|
module RspecInContext
|
@@ -34,7 +34,7 @@ module RspecInContext
|
|
34
34
|
# @api private
|
35
35
|
#
|
36
36
|
# @note Will warn if a context is overriden
|
37
|
-
def add_context(context_name, owner = nil, namespace = nil, silent = true, &block)
|
37
|
+
def add_context(context_name, owner = nil, namespace = nil, silent = true, &block)
|
38
38
|
namespace ||= GLOBAL_CONTEXT
|
39
39
|
warn("Overriding an existing context: #{context_name}@#{namespace}") if contexts[namespace][context_name]
|
40
40
|
contexts[namespace][context_name] = Context.new(block, owner, context_name, namespace, silent)
|
@@ -47,8 +47,7 @@ module RspecInContext
|
|
47
47
|
contexts[namespace][context_name]
|
48
48
|
else
|
49
49
|
contexts[GLOBAL_CONTEXT][context_name] || find_context_in_any_namespace(context_name)
|
50
|
-
end ||
|
51
|
-
(raise NoContextFound, "No context found with name #{context_name}")
|
50
|
+
end || (raise NoContextFound, "No context found with name #{context_name}")
|
52
51
|
end
|
53
52
|
|
54
53
|
# Look into every namespace to find the context
|
@@ -86,15 +85,9 @@ module RspecInContext
|
|
86
85
|
namespace ||= ns
|
87
86
|
Thread.current[:test_block] = block
|
88
87
|
context_to_exec = InContext.find_context(context_name, namespace)
|
89
|
-
if context_to_exec.silent
|
90
|
-
return context do
|
91
|
-
instance_exec(*args, &context_to_exec.block)
|
92
|
-
end
|
93
|
-
end
|
88
|
+
return context { instance_exec(*args, &context_to_exec.block) } if context_to_exec.silent
|
94
89
|
|
95
|
-
context(context_name.to_s)
|
96
|
-
instance_exec(*args, &context_to_exec.block)
|
97
|
-
end
|
90
|
+
context(context_name.to_s) { instance_exec(*args, &context_to_exec.block) }
|
98
91
|
end
|
99
92
|
|
100
93
|
# Used in context definition
|
data/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "rspec_in_context",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "index.js",
|
5
|
+
"repository": "git@github.com:denispasin/rspec_in_context.git",
|
6
|
+
"author": "Denis <Zaratan> Pasin <zaratan@hey.com>",
|
7
|
+
"license": "MIT",
|
8
|
+
"devDependencies": {
|
9
|
+
"@prettier/plugin-ruby": "^1.3.0",
|
10
|
+
"prettier": "^2.2.1"
|
11
|
+
}
|
12
|
+
}
|
data/rspec_in_context.gemspec
CHANGED
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "faker", "> 1.8"
|
35
35
|
spec.add_development_dependency "guard-rspec", "> 4.7"
|
36
36
|
spec.add_development_dependency "overcommit", '> 0.46'
|
37
|
+
spec.add_development_dependency "prettier"
|
37
38
|
spec.add_development_dependency "rake", "~> 12.0"
|
38
39
|
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
|
39
40
|
spec.add_development_dependency "rubocop", "> 0.58"
|
data/yarn.lock
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
2
|
+
# yarn lockfile v1
|
3
|
+
|
4
|
+
|
5
|
+
"@prettier/plugin-ruby@^1.3.0":
|
6
|
+
version "1.3.0"
|
7
|
+
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-1.3.0.tgz#38ec1447ca43121cfe72961ed974038cbcb57ff7"
|
8
|
+
integrity sha512-8MHLLdHpb0MDmkh+GZa+MQcQVQzYc34Nv5/I5yQv4n14ogLRMs3oi5C9kQSG2PAYLhAwF8EU36OczzVaHrPHoA==
|
9
|
+
dependencies:
|
10
|
+
prettier ">=1.10"
|
11
|
+
|
12
|
+
prettier@>=1.10, prettier@^2.2.1:
|
13
|
+
version "2.2.1"
|
14
|
+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
15
|
+
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_in_context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis <Zaratan> Pasin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.46'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: prettier
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rake
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -233,6 +247,7 @@ files:
|
|
233
247
|
- ".github/workflows/verify_version_change.yml"
|
234
248
|
- ".gitignore"
|
235
249
|
- ".overcommit.yml"
|
250
|
+
- ".prettierrc.js"
|
236
251
|
- ".rspec"
|
237
252
|
- ".rubocop-http---relaxed-ruby-style-rubocop-yml"
|
238
253
|
- ".rubocop.yml"
|
@@ -249,7 +264,9 @@ files:
|
|
249
264
|
- lib/rspec_in_context/context_management.rb
|
250
265
|
- lib/rspec_in_context/in_context.rb
|
251
266
|
- lib/rspec_in_context/version.rb
|
267
|
+
- package.json
|
252
268
|
- rspec_in_context.gemspec
|
269
|
+
- yarn.lock
|
253
270
|
homepage: https://github.com/denispasin/rspec_in_context
|
254
271
|
licenses:
|
255
272
|
- MIT
|