chutney 3.11.1 → 3.11.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74225c8b4badcb729231121bce2547b43c1a7d21b239bf17f0de152a4a425686
4
- data.tar.gz: acfe603816c3c0bafd77e4fc149d895d665745b5260b341f24744baa7ab162c1
3
+ metadata.gz: ec37ccd0377c50adf8968133abf55a2e6ffe76f5e6388d24681cd2c9aa925244
4
+ data.tar.gz: 793ca207c66e94d4c48d8f5f752880730e06cc043c8d1ff0b3db972663fb33de
5
5
  SHA512:
6
- metadata.gz: d4a3ed6425a8157e7dbcba96808fd8e340760da1140b3966e25b44fc4d2d5849f774e6cd0f3bd9c8c93bf4c6e7aedd4c648476d2a393e819a39cfc5c69d00c96
7
- data.tar.gz: 5f51a71f864e39ee219b841167fa5a8bffdf9837db27bb705089573e7402a9dd3931c6340c51861c2363bc8bbce73718404221280a348dbceebae027a9c6beb8
6
+ metadata.gz: 16e1f2824bd0183a4d7bf3d383713bdad718abd335f075190fdcdc4a671ac4b272f27f5bf63fe4561fd0a266ee104957d12acd18ca89c3a46783ac2689ce77c3
7
+ data.tar.gz: bea0fa1997bf1d06a776dceb8d6d4e0ed31d384cc84a076ffc958077caa0f078fd8f42b7b950047821f7b9f29e8b930b481943bd2b3a05e8967d47fb12f493e4
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
 
7
7
  gem 'coveralls', '~> 0.8'
8
8
  gem 'cucumber', '>= 9.0'
9
+ gem 'irb', '>= 1.0'
9
10
  gem 'rake', '~> 13.0'
10
11
  gem 'rerun', '~> 0.13'
11
12
  gem 'rspec', '~> 3.13'
@@ -3,9 +3,11 @@
3
3
  module Chutney
4
4
  # Rule to find all the duplicated scenarios
5
5
  class SameScenario < Linter
6
- def lint
7
- dictionary = Hash.new { |hash, key| hash[key] = [] }
6
+ def self.dictionary
7
+ @dictionary ||= Hash.new { |hash, key| hash[key] = [] }
8
+ end
8
9
 
10
+ def lint
9
11
  scenarios do |feature, scenario|
10
12
  text = scenario
11
13
  .steps
@@ -13,11 +15,11 @@ module Chutney
13
15
  .join("\n") + example_text(scenario)
14
16
 
15
17
  digest = Digest::SHA2.hexdigest(text)
16
- dictionary[digest] << { scenario:, feature: }
18
+ SameScenario.dictionary[digest] << { scenario:, feature: }
17
19
  end
18
20
 
19
- dictionary.filter { |_k, v| v.size > 1 }
20
- .each_value do |v|
21
+ SameScenario.dictionary.filter { |_k, v| v.size > 1 }
22
+ .each_value do |v|
21
23
  v[1...].each do |problem|
22
24
  add_issue(I18n.t('linters.same_scenario',
23
25
  feature: problem[:feature].name,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chutney
4
- VERSION = '3.11.1'
4
+ VERSION = '3.11.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chutney
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.1
4
+ version: 3.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas