LittleWeasel 5.0.5 → 5.0.7

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -4
  3. data/CHANGELOG.md +8 -0
  4. data/Gemfile.lock +36 -29
  5. data/LittleWeasel.gemspec +8 -8
  6. data/lib/LittleWeasel/version.rb +1 -1
  7. data/spec/factories/dictionary.rb +27 -27
  8. data/spec/factories/dictionary_cache_service.rb +4 -6
  9. data/spec/factories/dictionary_creator_service.rb +1 -1
  10. data/spec/factories/dictionary_file_loader_service.rb +1 -1
  11. data/spec/factories/dictionary_hash.rb +26 -26
  12. data/spec/factories/dictionary_key.rb +1 -1
  13. data/spec/factories/dictionary_killer_service.rb +1 -1
  14. data/spec/factories/dictionary_manager.rb +1 -1
  15. data/spec/factories/dictionary_metadata.rb +1 -1
  16. data/spec/factories/dictionary_metadata_service.rb +1 -1
  17. data/spec/factories/numeric_filter.rb +1 -1
  18. data/spec/factories/preprocessed_word.rb +1 -1
  19. data/spec/factories/preprocessed_words.rb +1 -1
  20. data/spec/factories/single_character_word_filter.rb +1 -1
  21. data/spec/factories/word_results.rb +1 -1
  22. data/spec/lib/LittleWeasel/block_results_spec.rb +23 -23
  23. data/spec/lib/LittleWeasel/configure_spec.rb +3 -3
  24. data/spec/lib/LittleWeasel/dictionary_key_spec.rb +9 -9
  25. data/spec/lib/LittleWeasel/dictionary_manager_spec.rb +29 -29
  26. data/spec/lib/LittleWeasel/dictionary_spec.rb +30 -29
  27. data/spec/lib/LittleWeasel/filters/en_us/currency_filter_spec.rb +26 -26
  28. data/spec/lib/LittleWeasel/filters/en_us/numeric_filter_spec.rb +17 -17
  29. data/spec/lib/LittleWeasel/filters/en_us/single_character_word_filter_spec.rb +8 -8
  30. data/spec/lib/LittleWeasel/filters/word_filter_managable_spec.rb +19 -19
  31. data/spec/lib/LittleWeasel/filters/word_filter_spec.rb +17 -17
  32. data/spec/lib/LittleWeasel/filters/word_filter_validatable_spec.rb +27 -12
  33. data/spec/lib/LittleWeasel/filters/word_filters_validatable_spec.rb +6 -6
  34. data/spec/lib/LittleWeasel/integraton_tests/dictionary_integration_spec.rb +23 -23
  35. data/spec/lib/LittleWeasel/metadata/dictionary_creator_servicable_spec.rb +7 -6
  36. data/spec/lib/LittleWeasel/metadata/dictionary_metadata_spec.rb +13 -13
  37. data/spec/lib/LittleWeasel/metadata/invalid_words_metadata_spec.rb +17 -17
  38. data/spec/lib/LittleWeasel/metadata/metadata_observerable_spec.rb +1 -1
  39. data/spec/lib/LittleWeasel/modules/dictionary_file_loader_spec.rb +30 -30
  40. data/spec/lib/LittleWeasel/modules/dictionary_sourceable_spec.rb +21 -21
  41. data/spec/lib/LittleWeasel/modules/language_spec.rb +5 -5
  42. data/spec/lib/LittleWeasel/modules/locale_spec.rb +1 -1
  43. data/spec/lib/LittleWeasel/modules/region_spec.rb +5 -5
  44. data/spec/lib/LittleWeasel/preprocessors/en_us/capitalize_preprocessor_spec.rb +8 -6
  45. data/spec/lib/LittleWeasel/preprocessors/preprocessed_word_spec.rb +3 -3
  46. data/spec/lib/LittleWeasel/preprocessors/preprocessed_word_validatable_spec.rb +14 -3
  47. data/spec/lib/LittleWeasel/preprocessors/preprocessed_words_spec.rb +8 -10
  48. data/spec/lib/LittleWeasel/preprocessors/preprocessed_words_validatable_spec.rb +6 -4
  49. data/spec/lib/LittleWeasel/preprocessors/word_preprocessor_managable_spec.rb +27 -28
  50. data/spec/lib/LittleWeasel/preprocessors/word_preprocessor_spec.rb +25 -29
  51. data/spec/lib/LittleWeasel/preprocessors/word_preprocessor_validatable_spec.rb +10 -2
  52. data/spec/lib/LittleWeasel/preprocessors/word_preprocessors_validatable_spec.rb +4 -6
  53. data/spec/lib/LittleWeasel/services/dictionary_cache_service_spec.rb +51 -49
  54. data/spec/lib/LittleWeasel/services/dictionary_creator_service_spec.rb +14 -14
  55. data/spec/lib/LittleWeasel/services/dictionary_file_loader_service_spec.rb +30 -30
  56. data/spec/lib/LittleWeasel/services/dictionary_metadata_service_spec.rb +22 -22
  57. data/spec/lib/LittleWeasel/word_results_spec.rb +29 -32
  58. data/spec/lib/LittleWeasel/workflow/workflow_spec.rb +2 -2
  59. data/spec/spec_helper.rb +56 -56
  60. data/spec/support/factory_bot.rb +1 -2
  61. data/spec/support/file_helpers.rb +2 -2
  62. data/spec/support/general_helpers.rb +2 -1
  63. data/spec/support/shared_contexts.rb +13 -9
  64. data/spec/support/shared_examples.rb +10 -8
  65. metadata +33 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da93b58996407d4f6264971282a42e38c9165498dd391e02bebfa39b9e2a165d
4
- data.tar.gz: ea76d71d88bbaab4ee1da625d267a83b70edd9c22cf94e847afdd4f4746e08b1
3
+ metadata.gz: 36bf2a06e3f2b8fa3284a174a5a934f94b6e1f286edfd491f131a48fc8735dcb
4
+ data.tar.gz: 8b204f224a6980afbbf8a519cf6a176149234cd7cf36d2b29395feb0fdf5f1fe
5
5
  SHA512:
6
- metadata.gz: 7d1582575e5f66d92adbdfa20480cc4280e6fa83d45540bf5ec578dbb781933d0af2e6bb536e3624dc3b2f39324fc0e41ac1a409cafbb144c4b27b5b3ec044b0
7
- data.tar.gz: 40cb33b6364016cb3e568e4aaa65c9c18d6c58dd9ad05cc274438f287dca17437d695eb4415b9a55b423c5d1d1625f8946c94d0f57799b4e75d02498fca11279
6
+ metadata.gz: f0472bd090c44f129274614c44a1a0841158159330bea5c77c5488e4a1d457588df902f14e5b2937b0fa1cbf90244329ee13441afe0031e3a96d0814c91b5f20
7
+ data.tar.gz: 0b0e700fc77c131d0f67143caaa1e2fe585df7308f0582a53596e4e0f65937e8a525e6e31bff14e0f7ad79ef0df1eeb83f678219008736c9b79f0ea8c4112754
data/.rubocop.yml CHANGED
@@ -13,6 +13,8 @@ AllCops:
13
13
  - '*.gemspec'
14
14
  - 'spec/**/*'
15
15
  - 'vendor/**/*'
16
+ - 'scratch*.rb'
17
+ - 'snippets*.rb'
16
18
 
17
19
  # Align the elements of a hash literal if they span more than one line.
18
20
  Layout/HashAlignment:
@@ -115,7 +117,7 @@ Layout/LineLength:
115
117
  # Avoid methods longer than 15 lines of code.
116
118
  Metrics/MethodLength:
117
119
  Max: 20
118
- IgnoredMethods:
120
+ AllowedMethods:
119
121
  - swagger_path
120
122
  - operation
121
123
 
@@ -124,9 +126,12 @@ Metrics/MethodLength:
124
126
  Metrics/PerceivedComplexity:
125
127
  Max: 10
126
128
 
127
- Naming/FileName:
128
- Exclude:
129
- - 'lib/LittleWeasel.rb'
129
+ NestedGroups:
130
+ Max: 4
131
+
132
+ # Naming/FileName:
133
+ # Exclude:
134
+ # - 'lib/file.rb'
130
135
 
131
136
  # Allow `downcase == ` instead of forcing `casecmp`
132
137
  Performance/Casecmp:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 5.0.7 2023-10-30
2
+ * Changes
3
+ * Ruby gem updates.
4
+
5
+ ### 5.0.6
6
+ * Changes
7
+ * Ruby gem updates.
8
+
1
9
  ### 5.0.5
2
10
  * Changes
3
11
  * Ruby gem updates.
data/Gemfile.lock CHANGED
@@ -1,18 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- LittleWeasel (5.0.5)
5
- activesupport (~> 6.1, >= 6.1.3.2)
4
+ LittleWeasel (5.0.7)
5
+ activesupport (~> 7.0.8)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.1.7.4)
10
+ activesupport (7.0.8)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
14
14
  tzinfo (~> 2.0)
15
- zeitwerk (~> 2.3)
16
15
  ast (2.4.2)
17
16
  benchmark-ips (2.12.0)
18
17
  byebug (11.1.3)
@@ -20,15 +19,17 @@ GEM
20
19
  concurrent-ruby (1.2.2)
21
20
  diff-lcs (1.5.0)
22
21
  docile (1.4.0)
23
- factory_bot (6.2.1)
22
+ factory_bot (6.3.0)
24
23
  activesupport (>= 5.0.0)
25
24
  i18n (1.14.1)
26
25
  concurrent-ruby (~> 1.0)
26
+ json (2.6.3)
27
27
  kwalify (0.7.2)
28
+ language_server-protocol (3.17.0.3)
28
29
  method_source (1.0.0)
29
- minitest (5.19.0)
30
+ minitest (5.20.0)
30
31
  parallel (1.23.0)
31
- parser (3.2.2.3)
32
+ parser (3.2.2.4)
32
33
  ast (~> 2.4.1)
33
34
  racc
34
35
  pry (0.14.2)
@@ -45,7 +46,7 @@ GEM
45
46
  kwalify (~> 0.7.0)
46
47
  parser (~> 3.2.0)
47
48
  rainbow (>= 2.0, < 4.0)
48
- regexp_parser (2.8.1)
49
+ regexp_parser (2.8.2)
49
50
  rexml (3.2.6)
50
51
  rspec (3.12.0)
51
52
  rspec-core (~> 3.12.0)
@@ -60,25 +61,32 @@ GEM
60
61
  diff-lcs (>= 1.2.0, < 2.0)
61
62
  rspec-support (~> 3.12.0)
62
63
  rspec-support (3.12.1)
63
- rubocop (1.9.1)
64
+ rubocop (1.57.2)
65
+ json (~> 2.3)
66
+ language_server-protocol (>= 3.17.0)
64
67
  parallel (~> 1.10)
65
- parser (>= 3.0.0.0)
68
+ parser (>= 3.2.2.4)
66
69
  rainbow (>= 2.2.2, < 4.0)
67
70
  regexp_parser (>= 1.8, < 3.0)
68
- rexml
69
- rubocop-ast (>= 1.2.0, < 2.0)
71
+ rexml (>= 3.2.5, < 4.0)
72
+ rubocop-ast (>= 1.28.1, < 2.0)
70
73
  ruby-progressbar (~> 1.7)
71
- unicode-display_width (>= 1.4.0, < 3.0)
72
- rubocop-ast (1.29.0)
74
+ unicode-display_width (>= 2.4.0, < 3.0)
75
+ rubocop-ast (1.30.0)
73
76
  parser (>= 3.2.1.0)
74
- rubocop-performance (1.19.0)
77
+ rubocop-capybara (2.19.0)
78
+ rubocop (~> 1.41)
79
+ rubocop-factory_bot (2.24.0)
80
+ rubocop (~> 1.33)
81
+ rubocop-performance (1.19.1)
75
82
  rubocop (>= 1.7.0, < 2.0)
76
83
  rubocop-ast (>= 0.4.0)
77
- rubocop-rspec (2.4.0)
78
- rubocop (~> 1.0)
79
- rubocop-ast (>= 1.1.0)
84
+ rubocop-rspec (2.25.0)
85
+ rubocop (~> 1.40)
86
+ rubocop-capybara (~> 2.17)
87
+ rubocop-factory_bot (~> 2.22)
80
88
  ruby-progressbar (1.13.0)
81
- simplecov (0.21.2)
89
+ simplecov (0.22.0)
82
90
  docile (~> 1.1)
83
91
  simplecov-html (~> 0.11)
84
92
  simplecov_json_formatter (~> 0.1)
@@ -86,10 +94,9 @@ GEM
86
94
  simplecov_json_formatter (0.1.4)
87
95
  tzinfo (2.0.6)
88
96
  concurrent-ruby (~> 1.0)
89
- unicode-display_width (2.4.2)
97
+ unicode-display_width (2.5.0)
90
98
  webrick (1.8.1)
91
99
  yard (0.9.34)
92
- zeitwerk (2.6.11)
93
100
 
94
101
  PLATFORMS
95
102
  ruby
@@ -97,19 +104,19 @@ PLATFORMS
97
104
  DEPENDENCIES
98
105
  LittleWeasel!
99
106
  benchmark-ips (~> 2.3)
100
- bundler (~> 2.2, >= 2.2.17)
101
- factory_bot (~> 6.2)
107
+ bundler (~> 2.4, >= 2.4.21)
108
+ factory_bot (~> 6.3)
102
109
  pry-byebug (~> 3.9)
103
110
  rake (~> 12.3, >= 12.3.3)
104
111
  redcarpet (~> 3.5, >= 3.5.1)
105
112
  reek (~> 6.0, >= 6.0.4)
106
- rspec (~> 3.10)
107
- rubocop (~> 1.9.1)
108
- rubocop-performance (~> 1.11, >= 1.11.3)
109
- rubocop-rspec (~> 2.3)
110
- simplecov (~> 0.21.2)
113
+ rspec (~> 3.12)
114
+ rubocop (~> 1.56, >= 1.56.2)
115
+ rubocop-performance (~> 1.19)
116
+ rubocop-rspec (~> 2.23, >= 2.23.2)
117
+ simplecov (~> 0.22.0)
111
118
  webrick (~> 1.7)
112
119
  yard (~> 0.9.26)
113
120
 
114
121
  BUNDLED WITH
115
- 2.3.22
122
+ 2.4.21
data/LittleWeasel.gemspec CHANGED
@@ -20,21 +20,21 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.required_ruby_version = '~> 3.0', '>= 3.0.1'
23
- spec.add_runtime_dependency 'activesupport', '~> 6.1', '>= 6.1.3.2'
23
+ spec.add_runtime_dependency 'activesupport', '~> 7.0.8'
24
24
  spec.add_development_dependency 'benchmark-ips', '~> 2.3'
25
- spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.17'
26
- spec.add_development_dependency 'factory_bot', '~> 6.2'
25
+ spec.add_development_dependency 'bundler', '~> 2.4', '>= 2.4.21'
26
+ spec.add_development_dependency 'factory_bot', '~> 6.3'
27
27
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
28
28
  spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
29
29
  spec.add_development_dependency 'redcarpet', '~> 3.5', '>= 3.5.1'
30
30
  spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4'
31
- spec.add_development_dependency 'rspec', '~> 3.10'
31
+ spec.add_development_dependency 'rspec', '~> 3.12'
32
32
  # This verson of rubocop is returning errors.
33
33
  # spec.add_development_dependency 'rubocop', '~> 1.14'
34
- spec.add_development_dependency 'rubocop', '~> 1.9.1'
35
- spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.3'
36
- spec.add_development_dependency 'rubocop-rspec', '~> 2.3'
37
- spec.add_development_dependency 'simplecov', '~> 0.21.2'
34
+ spec.add_development_dependency 'rubocop', '~> 1.56', '>= 1.56.2'
35
+ spec.add_development_dependency 'rubocop-performance', '~> 1.19'
36
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.23', '>= 2.23.2'
37
+ spec.add_development_dependency 'simplecov', '~> 0.22.0'
38
38
  # Needed for yard
39
39
  spec.add_development_dependency 'webrick', '~> 1.7'
40
40
  spec.add_development_dependency 'yard', '~> 0.9.26'
@@ -2,5 +2,5 @@
2
2
 
3
3
  # The version of this gem
4
4
  module LittleWeasel
5
- VERSION = '5.0.5'
5
+ VERSION = '5.0.7'
6
6
  end
@@ -1,38 +1,38 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary, class: LittleWeasel::Dictionary do
4
+ factory :dictionary, class: 'LittleWeasel::Dictionary' do
5
5
  dictionary_key { create(:dictionary_key) }
6
6
  dictionary_cache { {} }
7
7
  dictionary_metadata { {} }
8
8
  word_filters {}
9
9
  dictionary_words do
10
- %w(apple
11
- better
12
- cat
13
- dog
14
- everyone
15
- fat
16
- game
17
- help
18
- italic
19
- jasmine
20
- kelp
21
- love
22
- man
23
- nope
24
- octopus
25
- popeye
26
- queue
27
- ruby
28
- stop
29
- top
30
- ultimate
31
- very
32
- was
33
- xylophone
34
- yes
35
- zebra)
10
+ %w[apple
11
+ better
12
+ cat
13
+ dog
14
+ everyone
15
+ fat
16
+ game
17
+ help
18
+ italic
19
+ jasmine
20
+ kelp
21
+ love
22
+ man
23
+ nope
24
+ octopus
25
+ popeye
26
+ queue
27
+ ruby
28
+ stop
29
+ top
30
+ ultimate
31
+ very
32
+ was
33
+ xylophone
34
+ yes
35
+ zebra]
36
36
  end
37
37
 
38
38
  skip_create
@@ -3,7 +3,7 @@
3
3
  require 'pry'
4
4
 
5
5
  FactoryBot.define do
6
- factory :dictionary_cache_service, class: LittleWeasel::Services::DictionaryCacheService do
6
+ factory :dictionary_cache_service, class: 'LittleWeasel::Services::DictionaryCacheService' do
7
7
  dictionary_key { create(:dictionary_key) }
8
8
  dictionary_cache { {} }
9
9
 
@@ -57,11 +57,9 @@ FactoryBot.define do
57
57
  dictionary_memory_source = evaluator.dictionary_memory_source
58
58
  dictionary_file_source = evaluator.dictionary_file_source
59
59
 
60
- if load
61
- unless dictionary_memory_source.present? || dictionary_file_source.present?
62
- raise 'Transient attributes dictionary_memory_source or dictionary_file_source ' \
63
- "must be present if transient attribute load is true: #{dictionary_reference}"
64
- end
60
+ if load && !(dictionary_memory_source.present? || dictionary_file_source.present?)
61
+ raise 'Transient attributes dictionary_memory_source or dictionary_file_source ' \
62
+ "must be present if transient attribute load is true: #{dictionary_reference}"
65
63
  end
66
64
 
67
65
  if dictionary_file_source
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_creator_service, class: LittleWeasel::Services::DictionaryCreatorService do
4
+ factory :dictionary_creator_service, class: 'LittleWeasel::Services::DictionaryCreatorService' do
5
5
  dictionary_key { create(:dictionary_key) }
6
6
  dictionary_cache { {} }
7
7
  dictionary_metadata { {} }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_file_loader_service, class: LittleWeasel::Services::DictionaryFileLoaderService do
4
+ factory :dictionary_file_loader_service, class: 'LittleWeasel::Services::DictionaryFileLoaderService' do
5
5
  dictionary_key { create(:dictionary_key) }
6
6
  dictionary_cache { {} }
7
7
 
@@ -3,32 +3,32 @@
3
3
  FactoryBot.define do
4
4
  factory :dictionary_hash, class: Hash do
5
5
  dictionary_words do
6
- %w(apple
7
- better
8
- cat
9
- dog
10
- everyone
11
- fat
12
- game
13
- help
14
- italic
15
- jasmine
16
- kelp
17
- love
18
- man
19
- nope
20
- octopus
21
- popeye
22
- queue
23
- ruby
24
- stop
25
- top
26
- ultimate
27
- very
28
- was
29
- xylophone
30
- yes
31
- zebra)
6
+ %w[apple
7
+ better
8
+ cat
9
+ dog
10
+ everyone
11
+ fat
12
+ game
13
+ help
14
+ italic
15
+ jasmine
16
+ kelp
17
+ love
18
+ man
19
+ nope
20
+ octopus
21
+ popeye
22
+ queue
23
+ ruby
24
+ stop
25
+ top
26
+ ultimate
27
+ very
28
+ was
29
+ xylophone
30
+ yes
31
+ zebra]
32
32
  end
33
33
 
34
34
  skip_create
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_key, class: LittleWeasel::DictionaryKey do
4
+ factory :dictionary_key, class: 'LittleWeasel::DictionaryKey' do
5
5
  language { :en }
6
6
  region { :us }
7
7
  tag {}
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_killer_service, class: LittleWeasel::Services::DictionaryKillerService do
4
+ factory :dictionary_killer_service, class: 'LittleWeasel::Services::DictionaryKillerService' do
5
5
  dictionary_key { create(:dictionary_key) }
6
6
  dictionary_cache { {} }
7
7
  dictionary_metadata { {} }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_manager, class: LittleWeasel::DictionaryManager do
4
+ factory :dictionary_manager, class: 'LittleWeasel::DictionaryManager' do
5
5
  skip_create
6
6
  initialize_with do
7
7
  new
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :dictionary_metadata, class: LittleWeasel::Metadata::DictionaryMetadata do
4
+ factory :dictionary_metadata, class: 'LittleWeasel::Metadata::DictionaryMetadata' do
5
5
  dictionary_words {}
6
6
  dictionary_key { create(:dictionary_key) }
7
7
  dictionary_cache { {} }
@@ -3,7 +3,7 @@
3
3
  require 'pry'
4
4
 
5
5
  FactoryBot.define do
6
- factory :dictionary_metadata_service, class: LittleWeasel::Services::DictionaryMetadataService do
6
+ factory :dictionary_metadata_service, class: 'LittleWeasel::Services::DictionaryMetadataService' do
7
7
  dictionary_key { create(:dictionary_key) }
8
8
  dictionary_cache { {} }
9
9
  dictionary_metadata { {} }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :numeric_filter, class: LittleWeasel::Filters::EnUs::NumericFilter do
4
+ factory :numeric_filter, class: 'LittleWeasel::Filters::EnUs::NumericFilter' do
5
5
  filter_on { true }
6
6
 
7
7
  skip_create
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :preprocessed_word, class: LittleWeasel::Preprocessors::PreprocessedWord do
4
+ factory :preprocessed_word, class: 'LittleWeasel::Preprocessors::PreprocessedWord' do
5
5
  original_word {}
6
6
  preprocessed {}
7
7
  preprocessed_word {}
@@ -3,7 +3,7 @@
3
3
  require 'pry'
4
4
 
5
5
  FactoryBot.define do
6
- factory :preprocessed_words, class: LittleWeasel::Preprocessors::PreprocessedWords do
6
+ factory :preprocessed_words, class: 'LittleWeasel::Preprocessors::PreprocessedWords' do
7
7
  original_word { 'word' }
8
8
  preprocessed_words {}
9
9
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :single_character_word_filter, class: LittleWeasel::Filters::EnUs::SingleCharacterWordFilter do
4
+ factory :single_character_word_filter, class: 'LittleWeasel::Filters::EnUs::SingleCharacterWordFilter' do
5
5
  filter_on { true }
6
6
 
7
7
  skip_create
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  FactoryBot.define do
4
- factory :word_results, class: LittleWeasel::WordResults do
4
+ factory :word_results, class: 'LittleWeasel::WordResults' do
5
5
  original_word {}
6
6
  filters_matched { [] }
7
7
  preprocessed_words {}
@@ -11,10 +11,10 @@ RSpec.describe LittleWeasel::BlockResults do
11
11
 
12
12
  let(:original_word_block) { 'Original word block' }
13
13
 
14
- #.new
14
+ # .new
15
15
  describe '.new' do
16
16
  it 'instantiates an object' do
17
- expect { subject }.to_not raise_error
17
+ expect { subject }.not_to raise_error
18
18
  end
19
19
 
20
20
  it 'initializes #word_results to an empty Array' do
@@ -26,7 +26,7 @@ RSpec.describe LittleWeasel::BlockResults do
26
26
  end
27
27
  end
28
28
 
29
- #<<
29
+ # <<
30
30
  describe '<<' do
31
31
  context 'with an invalid argument' do
32
32
  it 'raises an error' do
@@ -42,7 +42,7 @@ RSpec.describe LittleWeasel::BlockResults do
42
42
  end
43
43
  end
44
44
 
45
- #success?
45
+ # success?
46
46
  describe '#success?' do
47
47
  before do
48
48
  subject << ceate_word_results(word: 'word01', word_valid: true)
@@ -81,7 +81,7 @@ RSpec.describe LittleWeasel::BlockResults do
81
81
  end
82
82
  end
83
83
 
84
- #words_valid?
84
+ # words_valid?
85
85
  describe '#words_valid?' do
86
86
  before do
87
87
  subject << ceate_word_results(word: 'word01', word_valid: true)
@@ -105,7 +105,7 @@ RSpec.describe LittleWeasel::BlockResults do
105
105
  end
106
106
  end
107
107
 
108
- #filters_match?
108
+ # filters_match?
109
109
  describe '#filters_match?' do
110
110
  before do
111
111
  subject << ceate_word_results(word: 'word01', filters_matched: [:matched_filter])
@@ -129,7 +129,7 @@ RSpec.describe LittleWeasel::BlockResults do
129
129
  end
130
130
  end
131
131
 
132
- #preprocessed_words?
132
+ # preprocessed_words?
133
133
  describe '#preprocessed_words?' do
134
134
  before do
135
135
  subject << ceate_word_results(word: word, preprocessed_words: preprocessed_words)
@@ -145,7 +145,7 @@ RSpec.describe LittleWeasel::BlockResults do
145
145
  end
146
146
  end
147
147
 
148
- #preprocessed_words_or_original_words
148
+ # preprocessed_words_or_original_words
149
149
  describe '#preprocessed_words_or_original_words' do
150
150
  context 'with all preprocessed words' do
151
151
  before do
@@ -153,16 +153,16 @@ RSpec.describe LittleWeasel::BlockResults do
153
153
  subject << ceate_word_results(word: words[1], preprocessed_words: preprocessed_words[1])
154
154
  end
155
155
 
156
- let(:words) { %w(word1 word2) }
156
+ let(:words) { %w[word1 word2] }
157
157
  let(:preprocessed_words) do
158
158
  [
159
- create(:preprocessed_words, original_word: words[0], with_word_processors: 1),
160
- create(:preprocessed_words, original_word: words[1], with_word_processors: 2)
159
+ create(:preprocessed_words, original_word: words[0], with_word_processors: 1),
160
+ create(:preprocessed_words, original_word: words[1], with_word_processors: 2)
161
161
  ]
162
162
  end
163
163
 
164
164
  it 'returns all the preprocessed words' do
165
- expect(subject.preprocessed_words_or_original_words).to eq %w(word1-0 word2-0-1)
165
+ expect(subject.preprocessed_words_or_original_words).to eq %w[word1-0 word2-0-1]
166
166
  end
167
167
  end
168
168
 
@@ -172,10 +172,10 @@ RSpec.describe LittleWeasel::BlockResults do
172
172
  subject << ceate_word_results(word: words[1])
173
173
  end
174
174
 
175
- let(:words) { %w(word1 word2) }
175
+ let(:words) { %w[word1 word2] }
176
176
 
177
177
  it 'returns all the original words' do
178
- expect(subject.preprocessed_words_or_original_words).to eq %w(word1 word2)
178
+ expect(subject.preprocessed_words_or_original_words).to eq %w[word1 word2]
179
179
  end
180
180
  end
181
181
 
@@ -187,21 +187,21 @@ RSpec.describe LittleWeasel::BlockResults do
187
187
  subject << ceate_word_results(word: words[3], word_valid: true, preprocessed_words: preprocessed_words[1])
188
188
  end
189
189
 
190
- let(:words) { %w(word0 word1 word2 word3) }
190
+ let(:words) { %w[word0 word1 word2 word3] }
191
191
  let(:preprocessed_words) do
192
192
  [
193
- create(:preprocessed_words, original_word: words[1], with_word_processors: 1),
194
- create(:preprocessed_words, original_word: words[3], with_word_processors: 2)
193
+ create(:preprocessed_words, original_word: words[1], with_word_processors: 1),
194
+ create(:preprocessed_words, original_word: words[3], with_word_processors: 2)
195
195
  ]
196
196
  end
197
197
 
198
198
  it 'returns all the original and preprocessed words' do
199
- expect(subject.preprocessed_words_or_original_words).to eq %w(word0 word1-0 word2 word3-0-1)
199
+ expect(subject.preprocessed_words_or_original_words).to eq %w[word0 word1-0 word2 word3-0-1]
200
200
  end
201
201
  end
202
202
  end
203
203
 
204
- #words_cached?
204
+ # words_cached?
205
205
  describe '#words_cached?' do
206
206
  before do
207
207
  subject << ceate_word_results(word: words[0])
@@ -210,7 +210,7 @@ RSpec.describe LittleWeasel::BlockResults do
210
210
  subject << ceate_word_results(word: words[3])
211
211
  end
212
212
 
213
- let(:words) { %w(word1 word2 word3 word4) }
213
+ let(:words) { %w[word1 word2 word3 word4] }
214
214
 
215
215
  context 'when all the words are cached' do
216
216
  before do
@@ -218,7 +218,7 @@ RSpec.describe LittleWeasel::BlockResults do
218
218
  end
219
219
 
220
220
  it 'returns true' do
221
- expect(subject.words_cached?).to eq true
221
+ expect(subject.words_cached?).to be true
222
222
  end
223
223
  end
224
224
 
@@ -231,7 +231,7 @@ RSpec.describe LittleWeasel::BlockResults do
231
231
  end
232
232
 
233
233
  it 'returns false' do
234
- expect(subject.words_cached?).to eq false
234
+ expect(subject.words_cached?).to be false
235
235
  end
236
236
  end
237
237
 
@@ -241,7 +241,7 @@ RSpec.describe LittleWeasel::BlockResults do
241
241
  end
242
242
 
243
243
  it 'returns false' do
244
- expect(subject.words_cached?).to eq false
244
+ expect(subject.words_cached?).to be false
245
245
  end
246
246
  end
247
247
  end