├── .github └── workflows │ ├── linters.yml │ └── tests.yml ├── .rspec ├── .rubocop.yml ├── README.md ├── bin ├── bug_file │ └── test.rb └── main.rb ├── lib ├── colors.rb ├── department.rb ├── files.rb ├── layout.rb ├── metrics.rb └── naming.rb └── spec ├── mock-test └── examples.rb ├── rubocop_spec.rb └── spec_helper.rb /.github/workflows/linters.yml: -------------------------------------------------------------------------------- 1 | name: Linters 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | rubocop: 7 | name: Rubocop 8 | runs-on: ubuntu-18.04 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions/setup-ruby@v1 12 | with: 13 | ruby-version: 2.6.x 14 | - name: Setup Rubocop 15 | run: | 16 | gem install --no-document rubocop:'~>0.81.0' # https://docs.rubocop.org/en/stable/installation/ 17 | [ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ruby/.rubocop.yml 18 | - name: Rubocop Report 19 | run: rubocop --color -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | rspec: 7 | name: RSpec 8 | runs-on: ubuntu-18.04 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions/setup-ruby@v1 12 | with: 13 | ruby-version: 2.6.x 14 | - name: Setup RSpec 15 | run: | 16 | [ -f Gemfile ] && bundle --deployment 17 | gem install --no-document rspec:'~>3.0' 18 | - name: RSpec Report 19 | run: rspec --force-color --format documentation -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Exclude: 3 | - "Guardfile" 4 | - "Rakefile" 5 | - "lib/colors.rb" 6 | - "bin/bug_file/test.rb" 7 | - "spec/mock-test/examples.rb" 8 | 9 | 10 | DisplayCopNames: true 11 | 12 | Layout/LineLength: 13 | Max: 190 14 | Metrics/MethodLength: 15 | Max: 22 16 | Metrics/CyclomaticComplexity: 17 | Max: 10 18 | Metrics/AbcSize: 19 | Max: 50 20 | Metrics/ClassLength: 21 | Max: 150 22 | Metrics/BlockLength: 23 | ExcludedMethods: ['describe'] 24 | Max: 30 25 | Metrics/PerceivedComplexity: 26 | Max: 10 27 | 28 | Style/Documentation: 29 | Enabled: false 30 | Style/ClassAndModuleChildren: 31 | Enabled: false 32 | Style/EachForSimpleLoop: 33 | Enabled: false 34 | Style/AndOr: 35 | Enabled: false 36 | Style/DefWithParentheses: 37 | Enabled: false 38 | Style/FrozenStringLiteralComment: 39 | EnforcedStyle: never 40 | 41 | Layout/HashAlignment: 42 | EnforcedColonStyle: key 43 | Layout/ExtraSpacing: 44 | AllowForAlignment: false 45 | Layout/MultilineMethodCallIndentation: 46 | Enabled: true 47 | EnforcedStyle: indented 48 | Lint/RaiseException: 49 | Enabled: false 50 | Lint/StructNewOverride: 51 | Enabled: false 52 | Style/HashEachMethods: 53 | Enabled: false 54 | Style/HashTransformKeys: 55 | Enabled: false 56 | Style/HashTransformValues: 57 | Enabled: false 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |
17 |
18 |
25 | About | 26 | Built with | 27 | Installing | 28 | Style Guide | 29 | Author 30 |
31 | 32 | 33 | ## 🧐 About 34 |Naming cops check for naming issue of your code, such as method name, constant name, file name, etc.
89 | 90 | #### - Naming/VariableName 91 | This cop makes sure that all variables use the configured style, snake_case for their names. 92 | 93 | 94 | ``` 95 | # bad 96 | myVar = 5 97 | 98 | # good 99 | my_var = 5 100 | ``` 101 | 102 | 103 | #### - Naming/MethodName 104 | This cop makes sure that all methods use the configured style, snake_case for their names. 105 | 106 | 107 | ``` 108 | # bad 109 | def MyMethodName 110 | # code 111 | end 112 | 113 | # good 114 | def my_method_name 115 | # code 116 | end 117 | ``` 118 | 119 | #### - Naming/ClassAndModuleCamelCase 120 | This cop checks for class and module names with an underscore in them. 121 | ``` 122 | # bad 123 | class My_Class 124 | end 125 | module My_Module 126 | end 127 | 128 | # good 129 | class MyClass 130 | end 131 | module MyModule 132 | end 133 | ``` 134 | 135 | ## 2. Department Metrics 136 | 137 |Metrics cops deal with properties of the source code that can be measured, such as class length, method length, etc. Generally speaking, they have a configuration parameter called Max and when running rubocop --auto-gen-config, this parameter will be set to the highest value found for the inspected code. In this linter, Max value has being set to 10.
138 | 139 | #### - Metrics/BlockLength 140 | This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. 141 | 142 | ## 3. Department Layout 143 | 144 |Layout cops inspect your code for consistent use of indentation, alignment, and white space.
145 | 146 | #### - Layout/EmptyLines 147 | This cop checks for two or more consecutive blank lines. 148 | ``` 149 | # bad - It has two empty lines. 150 | my_method 151 | 152 | 153 | my_method 154 | 155 | # good 156 | my_method 157 | 158 | my_method 159 | ``` 160 | 161 | ## ✒️ Author 162 | 163 | 👤 **Witah Georjane** 164 | 165 | - Github: [@Georjane](https://github.com/Georjane) 166 | - Twitter: [@WittyJany](https://twitter.com/WittyJany) 167 | - Linkedin: [@witah-georjane](https://www.linkedin.com/in/witah-georjane-74b8bb184) 168 | 169 | ## 🤝 Contributing 170 | 171 | Contributions, issues and feature requests are welcome! 172 | 173 | Feel free to check the [issues page](https://github.com/Georjane/Ruby-Linters/issues). 174 | 175 | ## 👍 Show your support 176 | 177 | Give a ⭐️ if you like this project! 178 | 179 | ## 📝 License 180 | 181 | This project is free to use as learning purposes. For any external content (e.g. logo, images, ...), please contact the proper author and check their license of use. 182 | 183 | -------------------------------------------------------------------------------- /bin/bug_file/test.rb: -------------------------------------------------------------------------------- 1 | module MyGoodClass 2 | 3 | 4 | def my_Method 5 | my_var = "a test for processing files" 6 | puts 'This is ' + my_var 7 | mY_wrong23_VAR = 0 8 | puts 'This is ' + my_var 9 | 10 | end 11 | def my_Method 12 | my_var = "a test for processing files" 13 | puts 'This is ' + my_var 14 | mY_wrong23_VAR = 0 15 | my_var = "a test for processing files" 16 | puts 'This is ' + my_var 17 | mY_wrong23_VAR = 0 18 | 19 | end 20 | 21 | 22 | end 23 | module Bad_module_name44 24 | end 25 | 26 | -------------------------------------------------------------------------------- /bin/main.rb: -------------------------------------------------------------------------------- 1 | # A file which has a shebang line as its first line is 2 | # granted execute permission. 3 | 4 | # !/usr/bin/env ruby 5 | require './lib/files.rb' 6 | 7 | def rubocop(filename) 8 | num = counts(filename) 9 | if num.positive? 10 | puts "Inspecting 1 file\n\n\nOffenses:\n\n" 11 | get_file(filename) 12 | puts '1 file inspected, ' + num.to_s.red + ' offenses'.red + ' detected' 13 | else 14 | puts "Inspecting 1 file\n" + '.'.green + "\n\n1 file inspected, " + 'no offenses'.green + ' detected' 15 | end 16 | end 17 | 18 | rubocop('bin/bug_file/test.rb') 19 | -------------------------------------------------------------------------------- /lib/colors.rb: -------------------------------------------------------------------------------- 1 | class String 2 | def black 3 | "\e[30m#{self}\e[0m" 4 | end 5 | 6 | def red 7 | "\e[31m#{self}\e[0m" 8 | end 9 | 10 | def yellow 11 | "\e[33m#{self}\e[0m" 12 | end 13 | 14 | def green 15 | "\e[32m#{self}\e[0m" 16 | end 17 | 18 | def brown 19 | "\e[33m#{self}\e[0m" 20 | end 21 | 22 | def blue 23 | "\e[34m#{self}\e[0m" 24 | end 25 | 26 | def magenta 27 | "\e[35m#{self}\e[0m" 28 | end 29 | 30 | def cyan 31 | "\e[36m#{self}\e[0m" 32 | end 33 | 34 | def gray 35 | "\e[37m#{self}\e[0m" 36 | end 37 | 38 | def bg_black 39 | "\e[40m#{self}\e[0m" 40 | end 41 | 42 | def bg_red 43 | "\e[41m#{self}\e[0m" 44 | end 45 | 46 | def bg_green 47 | "\e[42m#{self}\e[0m" 48 | end 49 | 50 | def bg_brown 51 | "\e[43m#{self}\e[0m" 52 | end 53 | 54 | def bg_blue 55 | "\e[44m#{self}\e[0m" 56 | end 57 | 58 | def bg_magenta 59 | "\e[45m#{self}\e[0m" 60 | end 61 | 62 | def bg_cyan 63 | "\e[46m#{self}\e[0m" 64 | end 65 | 66 | def bg_gray 67 | "\e[47m#{self}\e[0m" 68 | end 69 | 70 | def bold 71 | "\e[1m#{self}\e[22m" 72 | end 73 | 74 | def italic 75 | "\e[3m#{self}\e[23m" 76 | end 77 | 78 | def underline 79 | "\e[4m#{self}\e[24m" 80 | end 81 | 82 | def blink 83 | "\e[5m#{self}\e[25m" 84 | end 85 | 86 | def reverse_color 87 | "\e[7m#{self}\e[27m" 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /lib/department.rb: -------------------------------------------------------------------------------- 1 | class Department 2 | attr_reader :file, :line, :line_num, :keywords, :good_snake_case, :bad_snake_case, :good_camel_case 3 | def initialize(line, file, line_num) 4 | @line = line 5 | @file = file 6 | @line_num = line_num 7 | @keywords = %w[def end puts class module] 8 | @good_snake_case = /^[a-z]+(_[a-z]+(_[a-z]+)?)?$/ 9 | @bad_snake_case = /[a-zA-Z\d]+(_[a-zA-Z\d]+(_[a-zA-Z]+)?)?/ 10 | @good_camel_case = /^[A-Z][A-Za-z\d]+$/ 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/files.rb: -------------------------------------------------------------------------------- 1 | require_relative 'department.rb' 2 | require_relative 'naming.rb' 3 | require_relative 'metrics.rb' 4 | require_relative 'layout.rb' 5 | require_relative 'colors.rb' 6 | 7 | def get_file(file) 8 | line_num = 1 9 | arr = [] 10 | File.readlines(file).each do |line| 11 | name_check = Naming.new(line, file, line_num) 12 | line_num += 1 13 | arr << line_num if line.split.empty? 14 | print name_check.var_name 15 | print name_check.method_name 16 | print name_check.class_name 17 | print name_check.module_name 18 | end 19 | layout_check = Layout.new(nil, file, line_num) 20 | print layout_check.empty_lines(arr) 21 | print get_file_metrics(file) 22 | end 23 | 24 | def get_file_metrics(file) 25 | line_num = 0 26 | def_hash = {} 27 | end_hash = {} 28 | metrics_check = Metrics.new(nil, file, line_num) 29 | File.readlines(file).each do |line| 30 | line_num += 1 31 | def_hash[line_num] = line =~ /def/ if %w[def].include?(line.split.first) 32 | end_hash[line_num] = line =~ /end/ if %w[end].include?(line.split.first) 33 | end 34 | metrics_check.block_length(def_hash, end_hash) 35 | end 36 | 37 | def counts(file) 38 | line_num = 1 39 | arr = [] 40 | offence_count = [] 41 | def_hash = {} 42 | end_hash = {} 43 | File.readlines(file).each do |line| 44 | name_check = Naming.new(line, file, line_num) 45 | line_num += 1 46 | def_hash[line_num] = line =~ /def/ if %w[def].include?(line.split.first) 47 | end_hash[line_num] = line =~ /end/ if %w[end].include?(line.split.first) 48 | arr << line_num if line.split.empty? 49 | offence_count << name_check.var_name unless name_check.var_name.nil? 50 | offence_count << name_check.method_name unless name_check.method_name.nil? 51 | offence_count << name_check.class_name unless name_check.class_name.nil? 52 | offence_count << name_check.module_name unless name_check.module_name.nil? 53 | end 54 | metrics_check = Metrics.new(nil, file, line_num) 55 | layout_check = Layout.new(nil, file, line_num) 56 | offence_count << layout_check.empty_lines(arr) unless layout_check.empty_lines(arr).nil? 57 | count = offence_count.length + metrics_check.check_length(def_hash, end_hash) 58 | count 59 | end 60 | -------------------------------------------------------------------------------- /lib/layout.rb: -------------------------------------------------------------------------------- 1 | class Layout < Department 2 | def empty_lines(arr) 3 | i = 0 4 | while i < arr.length 5 | return file.blue + ':' + arr[i + 1].to_s + ':' + 1.to_s + ':' + ' C'.yellow + ": Layout/EmptyLines: Extra blank line detected.\n\n" if arr[i + 1] == arr[i] + 1 6 | 7 | i += 1 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/metrics.rb: -------------------------------------------------------------------------------- 1 | class Metrics < Department 2 | def block_length(def_hash, end_hash) 3 | @max = 10 4 | length, final, many_lines = Array.new(3) { [] } 5 | counter = 0 6 | r = 0 7 | end_hash.each do |_x, v| 8 | end_hash.delete(end_hash.key(v)) unless def_hash.value?(v) 9 | end 10 | while counter < def_hash.length 11 | length << end_hash.keys[counter] - def_hash.keys[counter] 12 | counter += 1 13 | end 14 | length.each do |a| 15 | final << def_hash.keys[counter] if a > @max 16 | counter += 1 17 | end 18 | length.each { |q| many_lines << q if q > @max } 19 | while r < final.length 20 | print file.blue + ':' + final[r].to_s + ':' + 1.to_s + ':' + ' C'.yellow + ': Metrics/MethodLength: Method has too many lines. [' + many_lines[r].to_s + '/' + @max.to_s + "]\n\n" 21 | r += 1 22 | end 23 | end 24 | 25 | def check_length(def_hash, end_hash) 26 | @max = 10 27 | length, final, many_lines = Array.new(3) { [] } 28 | counter = 0 29 | end_hash.each do |_x, v| 30 | end_hash.delete(end_hash.key(v)) unless def_hash.value?(v) 31 | end 32 | while counter < def_hash.length 33 | length << end_hash.keys[counter] - def_hash.keys[counter] 34 | counter += 1 35 | end 36 | length.each do |a| 37 | final << def_hash.keys[counter] if a > @max 38 | counter += 1 39 | end 40 | length.each { |q| many_lines << q if q > @max } 41 | many_lines.length 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/naming.rb: -------------------------------------------------------------------------------- 1 | class Naming < Department 2 | @error_index = 0 3 | 4 | def var_name 5 | return unless !keywords.include?(line.split.first) && line =~ / = / 6 | 7 | var_line = line[(0..(line =~ / = /) - 1)] 8 | return if var_line.split.last.match?(good_snake_case) 9 | 10 | error_index_snake_case 11 | error_message + ": Naming/VariableName: Use snake_case for variable names.\n " + var_line.split.last + "\n\n" 12 | end 13 | 14 | def method_name 15 | return unless line.split.first == keywords.first 16 | return if line.split.last.match?(good_snake_case) 17 | 18 | error_index_snake_case 19 | error_message + ": Naming/MethodName: Use snake_case for method names.\n " + line.split.last + "\n\n" 20 | end 21 | 22 | def class_name 23 | return unless line.split.first == keywords[3] 24 | 25 | class_na = line[((line =~ /class/) + 6)..-1] 26 | return if class_na.match?(good_camel_case) 27 | 28 | @error_index = ((line =~ /class/) + 7) 29 | error_message + ": Naming/ClassAndModuleCamelCase: Use CamelCase for classes and modules.\n" + line + "\n" 30 | end 31 | 32 | def module_name 33 | return unless line.split.first == keywords[4] 34 | 35 | class_na = line[((line =~ /module/) + 7)..-1] 36 | return if class_na.match?(good_camel_case) 37 | 38 | @error_index = ((line =~ /module/) + 8) 39 | error_message + ": Naming/ClassAndModuleCamelCase: Use CamelCase for classes and modules.\n" + line + "\n" 40 | end 41 | 42 | private 43 | 44 | def error_index_snake_case 45 | @error_index = ((line =~ bad_snake_case) + 1) 46 | end 47 | 48 | def error_message 49 | file.blue + ':' + line_num.to_s + ':' + @error_index.to_s + ':' + ' C'.yellow 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /spec/mock-test/examples.rb: -------------------------------------------------------------------------------- 1 | def rspec_examples 2 | var = "example with 2 empty lines" 3 | 4 | 5 | end -------------------------------------------------------------------------------- /spec/rubocop_spec.rb: -------------------------------------------------------------------------------- 1 | require './lib/files.rb' 2 | 3 | describe Naming do 4 | describe '#var_name and #method_name' do 5 | it 'checks if variable and method names are in snake_case' do 6 | test = 'my_good_var' 7 | good_snake_case = /^[a-z]+_[a-z]+(_[a-z]+)?$/ 8 | expect(test).to match(good_snake_case) 9 | end 10 | 11 | it 'checks if variable and method names are in snake_case' do 12 | test = 'My_BAD_MetHOD11' 13 | good_snake_case = /^[a-z]+_[a-z]+(_[a-z]+)?$/ 14 | expect(test).to_not match(good_snake_case) 15 | end 16 | end 17 | 18 | describe '#class_name and #module_name' do 19 | it 'checks if clas and module names are in CamelCase' do 20 | test = 'GoodModuleName' 21 | good_camel_case = /^[A-Z][A-Za-z\d]+$/ 22 | expect(test).to match(good_camel_case) 23 | end 24 | 25 | it 'checks if clas and module names are in CamelCase' do 26 | test = 'my_bad_class_name' 27 | good_camel_case = /^[A-Z][A-Za-z\d]+$/ 28 | expect(test).to_not match(good_camel_case) 29 | end 30 | end 31 | end 32 | 33 | describe Layout do 34 | let(:file) { 'spec/mock-test/examples.rb' } 35 | let(:lines_array) do 36 | arr = [] 37 | File.readlines(file).each do |line| 38 | arr << line.chomp! 39 | end 40 | end 41 | 42 | describe '#empty_lines' do 43 | context 'checks when there are two or more empty lines consecutively' do 44 | it 'detects two or more empty lines and returns an error message' do 45 | array = [] 46 | layout_check = Layout.new(nil, file, nil) 47 | lines_array.each_with_index { |x, index| array << index if x.split.empty? } 48 | expect(layout_check.empty_lines(array)).to eq('spec/mock-test/examples.rb'.blue + ':' + array[1].to_s + ':1:' + ' C'.yellow + ": Layout/EmptyLines: Extra blank line detected.\n\n") 49 | end 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # This file was generated by the `rspec --init` command. Conventionally, all 2 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. 3 | # The generated `.rspec` file contains `--require spec_helper` which will cause 4 | # this file to always be loaded, without a need to explicitly require it in any 5 | # files. 6 | # 7 | # Given that it is always loaded, you are encouraged to keep this file as 8 | # light-weight as possible. Requiring heavyweight dependencies from this file 9 | # will add to the boot time of your test suite on EVERY test run, even for an 10 | # individual file that may not need all of that loaded. Instead, consider making 11 | # a separate helper file that requires the additional dependencies and performs 12 | # the additional setup, and require it from the spec files that actually need 13 | # it. 14 | # 15 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration 16 | RSpec.configure do |config| 17 | # rspec-expectations config goes here. You can use an alternate 18 | # assertion/expectation library such as wrong or the stdlib/minitest 19 | # assertions if you prefer. 20 | config.expect_with :rspec do |expectations| 21 | # This option will default to `true` in RSpec 4. It makes the `description` 22 | # and `failure_message` of custom matchers include text for helper methods 23 | # defined using `chain`, e.g.: 24 | # be_bigger_than(2).and_smaller_than(4).description 25 | # # => "be bigger than 2 and smaller than 4" 26 | # ...rather than: 27 | # # => "be bigger than 2" 28 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 29 | end 30 | 31 | # rspec-mocks config goes here. You can use an alternate test double 32 | # library (such as bogus or mocha) by changing the `mock_with` option here. 33 | config.mock_with :rspec do |mocks| 34 | # Prevents you from mocking or stubbing a method that does not exist on 35 | # a real object. This is generally recommended, and will default to 36 | # `true` in RSpec 4. 37 | mocks.verify_partial_doubles = true 38 | end 39 | 40 | # This option will default to `:apply_to_host_groups` in RSpec 4 (and will 41 | # have no way to turn it off -- the option exists only for backwards 42 | # compatibility in RSpec 3). It causes shared context metadata to be 43 | # inherited by the metadata hash of host groups and examples, rather than 44 | # triggering implicit auto-inclusion in groups with matching metadata. 45 | config.shared_context_metadata_behavior = :apply_to_host_groups 46 | 47 | # The settings below are suggested to provide a good initial experience 48 | # with RSpec, but feel free to customize to your heart's content. 49 | # # This allows you to limit a spec run to individual examples or groups 50 | # # you care about by tagging them with `:focus` metadata. When nothing 51 | # # is tagged with `:focus`, all examples get run. RSpec also provides 52 | # # aliases for `it`, `describe`, and `context` that include `:focus` 53 | # # metadata: `fit`, `fdescribe` and `fcontext`, respectively. 54 | # config.filter_run_when_matching :focus 55 | # 56 | # # Allows RSpec to persist some state between runs in order to support 57 | # # the `--only-failures` and `--next-failure` CLI options. We recommend 58 | # # you configure your source control system to ignore this file. 59 | # config.example_status_persistence_file_path = "spec/examples.txt" 60 | # 61 | # # Limits the available syntax to the non-monkey patched syntax that is 62 | # # recommended. For more details, see: 63 | # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ 64 | # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ 65 | # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode 66 | # config.disable_monkey_patching! 67 | # 68 | # # This setting enables warnings. It's recommended, but in some cases may 69 | # # be too noisy due to issues in dependencies. 70 | # config.warnings = true 71 | # 72 | # # Many RSpec users commonly either run the entire suite or an individual 73 | # # file, and it's useful to allow more verbose output when running an 74 | # # individual spec file. 75 | # if config.files_to_run.one? 76 | # # Use the documentation formatter for detailed output, 77 | # # unless a formatter has already been configured 78 | # # (e.g. via a command-line flag). 79 | # config.default_formatter = "doc" 80 | # end 81 | # 82 | # # Print the 10 slowest examples and example groups at the 83 | # # end of the spec run, to help surface which specs are running 84 | # # particularly slow. 85 | # config.profile_examples = 10 86 | # 87 | # # Run specs in random order to surface order dependencies. If you find an 88 | # # order dependency and want to debug it, you can fix the order by providing 89 | # # the seed, which is printed after each run. 90 | # # --seed 1234 91 | # config.order = :random 92 | # 93 | # # Seed global randomization in this process using the `--seed` CLI option. 94 | # # Setting this allows you to use `--seed` to deterministically reproduce 95 | # # test failures related to randomization by passing the same `--seed` value 96 | # # as the one that triggered the failure. 97 | # Kernel.srand config.seed 98 | end 99 | --------------------------------------------------------------------------------