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 +4 -4
- data/Gemfile +1 -0
- data/lib/chutney/linter/same_scenario.rb +7 -5
- data/lib/chutney/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec37ccd0377c50adf8968133abf55a2e6ffe76f5e6388d24681cd2c9aa925244
|
4
|
+
data.tar.gz: 793ca207c66e94d4c48d8f5f752880730e06cc043c8d1ff0b3db972663fb33de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e1f2824bd0183a4d7bf3d383713bdad718abd335f075190fdcdc4a671ac4b272f27f5bf63fe4561fd0a266ee104957d12acd18ca89c3a46783ac2689ce77c3
|
7
|
+
data.tar.gz: bea0fa1997bf1d06a776dceb8d6d4e0ed31d384cc84a076ffc958077caa0f078fd8f42b7b950047821f7b9f29e8b930b481943bd2b3a05e8967d47fb12f493e4
|
data/Gemfile
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
module Chutney
|
4
4
|
# Rule to find all the duplicated scenarios
|
5
5
|
class SameScenario < Linter
|
6
|
-
def
|
7
|
-
dictionary
|
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
|
-
|
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,
|
data/lib/chutney/version.rb
CHANGED