rspec_in_context 0.4.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b40090e633e3171d52c0c93291ec769e97955087baa487bc56f6f50ff85cdef2
4
- data.tar.gz: e57a4ba84a134ce8477452adf43ec48caeb94176b2d3f1549a547b8e193c4bbc
3
+ metadata.gz: 1483e9b55b3cabffad15491bec3e5c3f006b421c4fa62099cce8effc4bf428b3
4
+ data.tar.gz: 92e35ec980fa84397bb5b33f39e6302825c8ae60aaa581cc009befa507f9b98e
5
5
  SHA512:
6
- metadata.gz: c7515368fc89fc6b92b6c418a3843753a77c19d05410bef26f3050b56678d9a3175c8b11a4ad2a521d283526335e3c26bba82b3209de5e665710683b6bf15af4
7
- data.tar.gz: d9a10ce1aaab03a46be0fb11a25fca8962ca6e3d826e15e8365c4763aea9193863f860427ef89818d97d18d70ee96932fdce5f0b40978d47e3fda0e91763a9a9
6
+ metadata.gz: 6f2b2c8e5a4f5b65692b73cb81558a4aaaed3797da5b3aded5b3dc1ff8e943d3968f68df69007d9d15864ca1d14b934f7c51a57fc2a48d6a2757ab63c494ba4f
7
+ data.tar.gz: 6fd7be08a125054917af01ba365d34a2dcae63895f4aba95731e001dbd7fd757d4d617049e6f9d36ca576d817d35c543f76ae8fb10dc0172ff94bd2289e06217
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Overcommit
4
+ module Hook
5
+ module PrePush
6
+ # Runs `rubocop` on every files.
7
+ class Rubocop < Base
8
+ def run
9
+ result = execute(['rubocop', '-P'])
10
+ return :pass if result.success?
11
+
12
+ output = result.stdout + result.stderr
13
+ [:fail, output]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,48 @@
1
+ name: Test and Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ tests:
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.5, 2.6, 2.7, 3.0]
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ - name: Run linter
24
+ run: bundle exec rubocop
25
+ - name: Run tests
26
+ run: bundle exec rspec
27
+ release:
28
+ needs: [tests]
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - name: Set up Ruby
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: 3.0
37
+ - name: Install dependencies
38
+ run: bundle install
39
+ - name: Prepare credentials
40
+ env:
41
+ RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }}
42
+ run: "mkdir -p ~/.gem && echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials"
43
+ - name: Setup username/email
44
+ run: "git config --global user.email zaratan@hey.com && git config --global user.name \"Denis <Zaratan> Pasin\""
45
+ - name: Fetch tags from remote
46
+ run: "git fetch -t"
47
+ - name: Publish if version change
48
+ run: 'git diff `git tag | tail -1` lib/rspec_in_context/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"'
@@ -0,0 +1,26 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches-ignore:
6
+ - main
7
+
8
+ jobs:
9
+ tests:
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.5, 2.6, 2.7, 3.0]
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ - name: Run linter
24
+ run: bundle exec rubocop
25
+ - name: Run tests
26
+ run: bundle exec rspec
@@ -0,0 +1,21 @@
1
+ name: Verify version change
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ version_change:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Fetch main branch
15
+ run: git fetch origin main:main
16
+ - name: Verify if there's a change in version
17
+ run: "git diff main lib/rspec_in_context/version.rb | grep VERSION"
18
+ - name: Print new version
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
+ - name: Verify if higher version
21
+ run: '[[ $(git diff main lib/rspec_in_context/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") > $(git diff main lib/rspec_in_context/version.rb | grep -E "^-.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") ]]'
@@ -1,7 +1,7 @@
1
1
  PreCommit:
2
2
  RuboCop:
3
3
  enabled: true
4
- command: ['bundle', 'exec', 'rubocop'] # Invoke within Bundler context
4
+ command: ['bundle', 'exec', 'rubocop', '-P'] # Invoke within Bundler context
5
5
  BundleOutdated:
6
6
  enabled: true
7
7
  BundleAudit:
@@ -10,3 +10,5 @@ PrePush:
10
10
  RSpec:
11
11
  enabled: true
12
12
  command: ['bundle', 'exec', 'rspec'] # Invoke within Bundler context
13
+ Rubocop:
14
+ enabled: true
@@ -1,5 +1,5 @@
1
1
  # Relaxed.Ruby.Style
2
- ## Version 2.2
2
+ ## Version 2.5
3
3
 
4
4
  Style/Alias:
5
5
  Enabled: false
@@ -65,6 +65,10 @@ Style/NegatedWhile:
65
65
  Enabled: false
66
66
  StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
67
67
 
68
+ Style/NumericPredicate:
69
+ Enabled: false
70
+ StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
71
+
68
72
  Style/ParallelAssignment:
69
73
  Enabled: false
70
74
  StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
@@ -121,6 +125,10 @@ Style/TrailingCommaInHashLiteral:
121
125
  Enabled: false
122
126
  StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
123
127
 
128
+ Style/SymbolArray:
129
+ Enabled: false
130
+ StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
131
+
124
132
  Style/WhileUntilModifier:
125
133
  Enabled: false
126
134
  StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
@@ -137,30 +145,9 @@ Lint/AssignmentInCondition:
137
145
  Enabled: false
138
146
  StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
139
147
 
140
- Metrics/AbcSize:
141
- Enabled: false
142
-
143
- Metrics/BlockNesting:
144
- Enabled: false
145
-
146
- Metrics/ClassLength:
147
- Enabled: false
148
-
149
- Metrics/ModuleLength:
150
- Enabled: false
151
-
152
- Metrics/CyclomaticComplexity:
153
- Enabled: false
154
-
155
- Metrics/LineLength:
156
- Enabled: false
157
-
158
- Metrics/MethodLength:
159
- Enabled: false
160
-
161
- Metrics/ParameterLists:
148
+ Layout/LineLength:
162
149
  Enabled: false
163
150
 
164
- Metrics/PerceivedComplexity:
151
+ Metrics:
165
152
  Enabled: false
166
153
 
@@ -1,13 +1,14 @@
1
1
  inherit_from:
2
2
  - http://relaxed.ruby.style/rubocop.yml
3
3
 
4
+ require:
5
+ - rubocop-performance
6
+
4
7
  AllCops:
8
+ NewCops: enable
5
9
  DisplayStyleGuide: true
6
10
  DisplayCopNames: true
7
11
  Exclude:
8
- - 'db/schema.rb'
9
- - 'vendor/**/*'
10
- - 'config/environments/*.rb'
11
12
  - 'bin/*'
12
13
 
13
14
  Metrics/BlockLength:
@@ -17,5 +18,50 @@ Metrics/BlockLength:
17
18
  - 'vendor/bundle'
18
19
  - '*.gemspec'
19
20
 
20
- Naming/UncommunicativeMethodParamName:
21
+ Style/GlobalVars:
22
+ Exclude:
23
+ - spec/rspec_in_context/in_context_spec.rb
24
+
25
+ Naming/MethodParameterName:
21
26
  Enabled: false
27
+
28
+ Layout/DotPosition:
29
+ Enabled: true
30
+ EnforcedStyle: trailing
31
+
32
+ Style/TrailingCommaInArrayLiteral:
33
+ Enabled: true
34
+ EnforcedStyleForMultiline: comma
35
+
36
+ Style/TrailingCommaInHashLiteral:
37
+ Enabled: true
38
+ EnforcedStyleForMultiline: comma
39
+
40
+ Layout/MultilineArrayLineBreaks:
41
+ Enabled: true
42
+
43
+ Layout/MultilineHashKeyLineBreaks:
44
+ Enabled: true
45
+
46
+ Layout/MultilineMethodArgumentLineBreaks:
47
+ Enabled: true
48
+
49
+ Layout/FirstArrayElementLineBreak:
50
+ Enabled: true
51
+
52
+ Layout/FirstHashElementLineBreak:
53
+ Enabled: true
54
+
55
+ Layout/FirstMethodArgumentLineBreak:
56
+ Enabled: true
57
+
58
+ Layout/MultilineAssignmentLayout:
59
+ Enabled: true
60
+
61
+ Layout/LineLength:
62
+ Enabled: true
63
+ Max: 120
64
+ AutoCorrect: true
65
+ Exclude:
66
+ - Gemfile
67
+ - Guardfile
@@ -1 +1 @@
1
- 2.3.7
1
+ 3.0.0
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.1.0] - 2020-12-27
10
+ ### Added
11
+ - **BREAKING** Option to silence in_context block. They used to always wrap themself into a context block with their name. This is not the case anymore. All in_context are silent unless explicitely declared as not.
12
+
13
+ ## [1.0.1.2] - 2020-12-26
14
+ ### Added
15
+ - Changelog
16
+ - Support ruby 3.0
17
+
18
+ [Unreleased]: https://github.com/zaratan/rspec_in_context/compare/v1.1.0...HEAD
19
+ [1.1.0]: https://github.com/zaratan/rspec_in_context/releases/tag/v1.1.0
20
+ [1.0.1.2]: https://github.com/zaratan/rspec_in_context/releases/tag/v1.0.1.2
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # RspecInContext
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rspec_in_context.svg)](https://badge.fury.io/rb/rspec_in_context)
4
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7ee82740e840412b864574851aa44f16)](https://www.codacy.com/project/denis-pasin/rspec_in_context/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=denispasin/rspec_in_context&amp;utm_campaign=Badge_Grade_Dashboard)
5
-
4
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/6490834b08664dc898d0107c74a78357)](https://www.codacy.com/gh/zaratan/rspec_in_context/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=zaratan/rspec_in_context&amp;utm_campaign=Badge_Grade)
5
+ ![Test and Release badge](https://github.com/zaratan/rspec_in_context/workflows/Test%20and%20Release/badge.svg)
6
6
 
7
7
  This gem is here to help you write better shared_examples in Rspec.
8
8
 
@@ -219,6 +219,54 @@ in_context "namespaced context", namespace: "namespace name"
219
219
  in_context "namespaced context", ns: "namespace name"
220
220
  ```
221
221
 
222
+ #### Making `in_context` adverstise itself
223
+
224
+ The fact that a `in_context` block is used inside the test is silent and invisible by default.
225
+
226
+ But, there's some case where it helps to make the `in_context` to wrap its execution in a `context` block.
227
+ For example:
228
+ ```ruby
229
+ define_context "with my_var defined" do
230
+ before do
231
+ described_class.set_my_var(true)
232
+ end
233
+
234
+ it "works"
235
+ end
236
+
237
+ define_context "without my_var defined" do
238
+ it "doesn't work"
239
+ end
240
+
241
+ RSpec.describe MyNiceClass do
242
+ in_context "with my_var defined"
243
+ in_context "without my_var defined"
244
+ end
245
+ ```
246
+ Using a `rspec -f doc` will only print "MyNiceClass works" and "MyNiceClass doesn't work" which is not really a good documentation.
247
+
248
+ So, you can define a context specifying it not to be `silent` or to `print_context`.
249
+ For example :
250
+ ```ruby
251
+ define_context "with my_var defined", silent: false do
252
+ before do
253
+ described_class.set_my_var(true)
254
+ end
255
+
256
+ it "works"
257
+ end
258
+
259
+ define_context "without my_var defined", print_context: true do
260
+ it "doesn't work"
261
+ end
262
+
263
+ RSpec.describe MyNiceClass do
264
+ in_context "with my_var defined"
265
+ in_context "without my_var defined"
266
+ end
267
+ ```
268
+ Will print "MyNiceClass with my_var defined works" and "MyNiceClass without my_var defined doesn't work". Which is valid and readable documentation.
269
+
222
270
  ## Development
223
271
 
224
272
 
@@ -21,9 +21,12 @@ module RSpec
21
21
  # @param name [String, Symbol] Name of the defined context
22
22
  # @param namespace [String, Symbol] Namespace where to store your context
23
23
  # @param ns Alias of namespace
24
+ # @param silent [Boolean] Does the in_context should wrap itself into a context block with its name
25
+ # @param print_context [Boolean] Reverse alias of silent
24
26
  # @param block [Proc] code that will be injected later
25
- def self.define_context(name, namespace: nil, ns: nil, &block)
27
+ def self.define_context(name, namespace: nil, ns: nil, silent: true, print_context: nil, &block)
26
28
  namespace ||= ns
27
- RspecInContext::InContext.outside_define_context(name, namespace, &block)
29
+ silent = print_context.nil? ? silent : !print_context
30
+ RspecInContext::InContext.outside_define_context(name, namespace, silent, &block)
28
31
  end
29
32
  end
@@ -6,7 +6,12 @@ module RspecInContext
6
6
  class NoContextFound < StandardError; end
7
7
 
8
8
  # Context struct
9
- Context = Struct.new(:block, :owner, :name, :namespace)
9
+ # @attr [Proc] block what will be executed in the test context
10
+ # @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 find.
12
+ # @attr [String | Symbol] namespace namespace for context names to avoid collisions
13
+ # @attr [Boolean] silent does the in_context should wrap itself into a context with its name upon execution
14
+ Context = Struct.new(:block, :owner, :name, :namespace, :silent)
10
15
 
11
16
  # Main module containing almost every methods
12
17
  module InContext
@@ -29,10 +34,10 @@ module RspecInContext
29
34
  # @api private
30
35
  #
31
36
  # @note Will warn if a context is overriden
32
- def add_context(context_name, owner = nil, namespace = nil, &block)
37
+ def add_context(context_name, owner = nil, namespace = nil, silent = true, &block) # rubocop:disable Style/OptionalBooleanParameter
33
38
  namespace ||= GLOBAL_CONTEXT
34
39
  warn("Overriding an existing context: #{context_name}@#{namespace}") if contexts[namespace][context_name]
35
- contexts[namespace][context_name] = Context.new(block, owner, context_name, namespace)
40
+ contexts[namespace][context_name] = Context.new(block, owner, context_name, namespace, silent)
36
41
  end
37
42
 
38
43
  # Find a context.
@@ -63,8 +68,8 @@ module RspecInContext
63
68
 
64
69
  # @api private
65
70
  # Define a context from outside a RSpec.describe block
66
- def outside_define_context(context_name, namespace, &block)
67
- InContext.add_context(context_name, nil, namespace, &block)
71
+ def outside_define_context(context_name, namespace, silent, &block)
72
+ InContext.add_context(context_name, nil, namespace, silent, &block)
68
73
  end
69
74
  end
70
75
 
@@ -80,8 +85,13 @@ module RspecInContext
80
85
  def in_context(context_name, *args, namespace: nil, ns: nil, &block)
81
86
  namespace ||= ns
82
87
  Thread.current[:test_block] = block
88
+ context_to_exec = InContext.find_context(context_name, namespace)
89
+ if context_to_exec.silent
90
+ return instance_exec(*args, &context_to_exec.block)
91
+ end
92
+
83
93
  context(context_name.to_s) do
84
- instance_exec(*args, &InContext.find_context(context_name, namespace).block)
94
+ instance_exec(*args, &context_to_exec.block)
85
95
  end
86
96
  end
87
97
 
@@ -102,12 +112,15 @@ module RspecInContext
102
112
  # It helps reducing colisions when you define "global" contexts
103
113
  # @param ns [String, Symbol] Alias of namespace
104
114
  # @param block [Proc] Contain the code that will be injected with #in_context later
115
+ # @param silent [Boolean] Does the in_context should wrap itself into a context block with its name
116
+ # @param print_context [Boolean] Reverse alias of silent
105
117
  #
106
118
  # @note contexts are scoped to the block they are defined in.
107
- def define_context(context_name, namespace: nil, ns: nil, &block)
119
+ def define_context(context_name, namespace: nil, ns: nil, silent: true, print_context: nil, &block)
108
120
  namespace ||= ns
121
+ silent = print_context.nil? ? silent : !print_context
109
122
  instance_exec do
110
- InContext.add_context(context_name, hooks.instance_variable_get(:@owner), namespace, &block)
123
+ InContext.add_context(context_name, hooks.instance_variable_get(:@owner), namespace, silent, &block)
111
124
  end
112
125
  end
113
126
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RspecInContext
4
4
  # Version of the gem
5
- VERSION = "0.4.0"
5
+ VERSION = "1.1.0"
6
6
  end
@@ -15,28 +15,30 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  # Specify which files should be added to the gem when it is released.
17
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
- end
18
+ spec.files =
19
+ Dir.chdir(File.expand_path(__dir__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
21
22
  spec.bindir = "exe"
22
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
24
  spec.require_paths = ["lib"]
24
- spec.required_ruby_version = '>= 2.3.7'
25
+ spec.required_ruby_version = '>= 2.5.8' # rubocop:disable Gemspec/RequiredRubyVersion
25
26
  spec.license = 'MIT'
26
27
 
27
28
  spec.add_dependency "activesupport", "> 2.0"
28
29
  spec.add_dependency "rspec", "> 3.0"
29
30
 
30
- spec.add_development_dependency "bundler", "~> 1.16"
31
- spec.add_development_dependency "bundler-audit", "~> 0.6.0"
32
- spec.add_development_dependency "codacy-coverage", '~> 2.1.0'
31
+ spec.add_development_dependency "bundler"
32
+ spec.add_development_dependency "bundler-audit", "> 0.6.0"
33
+ spec.add_development_dependency "codacy-coverage", '>= 2.1.0'
33
34
  spec.add_development_dependency "faker", "> 1.8"
34
35
  spec.add_development_dependency "guard-rspec", "> 4.7"
35
- spec.add_development_dependency "guard-rubocop", "~> 1.3"
36
- spec.add_development_dependency "overcommit", '~> 0.46'
37
- spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "overcommit", '> 0.46'
37
+ spec.add_development_dependency "rake", "~> 12.0"
38
38
  spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
39
39
  spec.add_development_dependency "rubocop", "> 0.58"
40
+ spec.add_development_dependency "rubocop-performance"
40
41
  spec.add_development_dependency "simplecov", "> 0.16"
41
- spec.add_development_dependency "yard", "~> 0.9"
42
+ spec.add_development_dependency "solargraph"
43
+ spec.add_development_dependency "yard"
42
44
  end
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: 0.4.0
4
+ version: 1.1.0
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: 2018-11-21 00:00:00.000000000 Z
11
+ date: 2020-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -42,42 +42,42 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler-audit
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.6.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: codacy-coverage
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.1.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.1.0
83
83
  - !ruby/object:Gem::Dependency
@@ -108,32 +108,18 @@ dependencies:
108
108
  - - ">"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '4.7'
111
- - !ruby/object:Gem::Dependency
112
- name: guard-rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.3'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.3'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: overcommit
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - "~>"
115
+ - - ">"
130
116
  - !ruby/object:Gem::Version
131
117
  version: '0.46'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - "~>"
122
+ - - ">"
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0.46'
139
125
  - !ruby/object:Gem::Dependency
@@ -142,14 +128,14 @@ dependencies:
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: '10.0'
131
+ version: '12.0'
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: '10.0'
138
+ version: '12.0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rspec_junit_formatter
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +164,20 @@ dependencies:
178
164
  - - ">"
179
165
  - !ruby/object:Gem::Version
180
166
  version: '0.58'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-performance
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: simplecov
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +192,34 @@ dependencies:
192
192
  - - ">"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.16'
195
+ - !ruby/object:Gem::Dependency
196
+ name: solargraph
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: yard
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
- - - "~>"
213
+ - - ">="
200
214
  - !ruby/object:Gem::Version
201
- version: '0.9'
215
+ version: '0'
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
- - - "~>"
220
+ - - ">="
207
221
  - !ruby/object:Gem::Version
208
- version: '0.9'
222
+ version: '0'
209
223
  description:
210
224
  email:
211
225
  - denis@pasin.fr
@@ -213,8 +227,10 @@ executables: []
213
227
  extensions: []
214
228
  extra_rdoc_files: []
215
229
  files:
216
- - ".circleci/config.yml"
217
- - ".circleci/setup-rubygems.sh"
230
+ - ".git-hooks/pre_push/rubocop.rb"
231
+ - ".github/workflows/test_and_publish.yml"
232
+ - ".github/workflows/test_only.yml"
233
+ - ".github/workflows/verify_version_change.yml"
218
234
  - ".gitignore"
219
235
  - ".overcommit.yml"
220
236
  - ".rspec"
@@ -222,6 +238,7 @@ files:
222
238
  - ".rubocop.yml"
223
239
  - ".ruby-gemset"
224
240
  - ".ruby-version"
241
+ - CHANGELOG.md
225
242
  - Gemfile
226
243
  - Guardfile
227
244
  - README.md
@@ -245,15 +262,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
245
262
  requirements:
246
263
  - - ">="
247
264
  - !ruby/object:Gem::Version
248
- version: 2.3.7
265
+ version: 2.5.8
249
266
  required_rubygems_version: !ruby/object:Gem::Requirement
250
267
  requirements:
251
268
  - - ">="
252
269
  - !ruby/object:Gem::Version
253
270
  version: '0'
254
271
  requirements: []
255
- rubyforge_project:
256
- rubygems_version: 2.7.8
272
+ rubygems_version: 3.2.3
257
273
  signing_key:
258
274
  specification_version: 4
259
275
  summary: This gem is here to help DRYing your tests cases by giving a better "shared_examples".
@@ -1,81 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- working_directory: ~/app
9
- docker:
10
- - image: circleci/ruby:2.5.3-node
11
- environment:
12
-
13
- steps:
14
- - checkout
15
-
16
- - run:
17
- name: install dependencies
18
- command: |
19
- bundle install --jobs=4 --retry=3 --path vendor/bundle
20
-
21
- - run:
22
- name: run linting
23
- command: |
24
- git config --global user.email $CIRCLE_USERNAME@none.com && \
25
- git config --global user.name "$CIRCLE_USERNAME @$CIRCLE_PROJECT_REPONAME" && \
26
- bundle exec overcommit --sign && \
27
- bundle exec overcommit --run
28
- # run tests!
29
- - run:
30
- name: run tests
31
- command: |
32
- mkdir /tmp/test-results
33
- COVERAGE=true bundle exec rspec --format progress \
34
- --format RspecJunitFormatter \
35
- --out /tmp/test-results/rspec.xml \
36
- --format progress
37
-
38
- # collect reports
39
- - store_test_results:
40
- path: /tmp/test-results
41
- - store_artifacts:
42
- path: /tmp/test-results
43
- destination: test-results
44
- - store_artifacts:
45
- path: ~/app/coverage
46
- destination: coverage-results
47
- deploy:
48
- working_directory: ~/app
49
- docker:
50
- - image: circleci/ruby:2.5.3-node
51
- environment:
52
-
53
- steps:
54
- - checkout
55
-
56
- - run:
57
- name: install dependencies
58
- command: |
59
- bundle install --jobs=4 --retry=3 --path vendor/bundle
60
-
61
- - run:
62
- name: Setup Rubygems
63
- command: bash .circleci/setup-rubygems.sh
64
-
65
- - run:
66
- name: Publish new version of the gem
67
- command: |
68
- git config --global user.email denis.pasin+circleci@gmail.com && \
69
- git config --global user.name "Denis <CircleCI> Pasin" && \
70
- rake release
71
- workflows:
72
- version: 2
73
- build-and-deploy:
74
- jobs:
75
- - build
76
- - deploy:
77
- requires:
78
- - build
79
- filters:
80
- branches:
81
- only: master
@@ -1,3 +0,0 @@
1
- mkdir ~/.gem
2
- echo -e "---\r\n:rubygems_api_key: $RUBYGEM_KEY" > ~/.gem/credentials
3
- chmod 0600 /home/circleci/.gem/credentials