Skip to content

Commit

Permalink
#194 minitest check
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 28, 2025
1 parent 3962d12 commit 9568a7a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ AllCops:
TargetRubyVersion: 3.2
SuggestExtensions: false
NewCops: enable
require:
- rubocop-minitest
- rubocop-performance

Minitest/EmptyLineBeforeAssertionMethods:
Enabled: false
Naming/FileName:
Regex: '^[a-z\-._]*$'
Style/GlobalVars:
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ gem 'qbash', '0.3.0', require: false
gem 'rake', '13.2.1', require: false
gem 'redcarpet', '~>3.5'
gem 'rubocop', '1.69.2', require: false
gem 'rubocop-minitest', '0.36.0', require: false
gem 'rubocop-performance', '1.23.1', require: false
gem 'rubocop-rspec', '3.4.0', require: false
gem 'simplecov', '0.22.0', require: false
gem 'simplecov-cobertura', '2.1.0', require: false
gem 'w3c_validators', '1.3.7', require: false
Expand Down
11 changes: 11 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ GEM
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
sawyer (0.9.2)
addressable (>= 2.3.5)
Expand Down Expand Up @@ -257,6 +265,9 @@ DEPENDENCIES
rake (= 13.2.1)
redcarpet (~> 3.5)
rubocop (= 1.69.2)
rubocop-minitest (= 0.36.0)
rubocop-performance (= 1.23.1)
rubocop-rspec (= 3.4.0)
simplecov (= 0.22.0)
simplecov-cobertura (= 2.1.0)
w3c_validators (= 1.3.7)
Expand Down
4 changes: 2 additions & 2 deletions judges/normalize-metrics/normalize-metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def fits(name)
%w[quantity-of-deliverables quality-of-service].each do |qo|
facts = Fbe.fb.query("(eq what '#{qo}')").each.to_a

facts.sort! { |a, b| a.when <=> b.when }
facts.sort_by!(&:when)
next if facts.empty?

start = {}
Expand All @@ -59,7 +59,7 @@ def fits(name)
s = start[prop]
diff = v - s
diff /= start[prop] unless start[prop].zero?
f.send("n_#{prop}=", diff)
f.send(:"n_#{prop}=", diff)
end
end
end
4 changes: 2 additions & 2 deletions test/pages/test_eva_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_template_long
</fb>
'
)
assert(!xml.xpath('/p/text()').to_s.start_with?('Not enough data'), xml)
refute(xml.xpath('/p/text()').to_s.start_with?('Not enough data'))
end

def test_template_short
Expand All @@ -58,6 +58,6 @@ def test_template_short
</fb>
'
)
assert(xml.xpath('/p/text()').to_s.start_with?('Not enough data'), xml)
assert(xml.xpath('/p/text()').to_s.start_with?('Not enough data'))
end
end
4 changes: 2 additions & 2 deletions test/pages/test_vitals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def test_validate_html
rescue StandardError => e
raise "#{doc}\n\n#{e}"
end
assert(xml.errors.empty?, xml)
assert(!xml.xpath('/html').empty?, xml)
assert_empty(xml.errors, xml)
refute_empty(xml.xpath('/html'), xml)
# WebMock.enable_net_connect!
# v = W3CValidators::NuValidator.new.validate_file(html)
# assert(v.errors.empty?, "#{doc}\n\n#{v.errors.join('; ')}")
Expand Down

0 comments on commit 9568a7a

Please sign in to comment.