Skip to content

Commit

Permalink
test: corrected the test as changes contains a list of files and the …
Browse files Browse the repository at this point in the history
…number of times they were changed.
  • Loading branch information
hemalvarambhia committed Dec 8, 2024
1 parent 876b55d commit 3c3735d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/lib/rubycritic/learning/churn_gem_learning_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'test_helper'
require 'churn'
require 'churn/calculator'
require 'byebug'
describe "churn gem's Churn" do
it 'computes how many times a file was changed' do
config = {
Expand All @@ -11,7 +12,9 @@
Churn::GitAnalyzer.stubs(:supported?).returns(true)
churn_calculator = ::Churn::ChurnCalculator.new(config)
report = churn_calculator.report(false)
# rubycritic gemspec was changed 148 times.
assert_equal 148, report[:churn][:changes].length

changes = report[:churn][:changes].first
assert_equal 'CHANGELOG.md', changes[:file_path]
assert_equal 99, changes[:times_changed]
end
end

0 comments on commit 3c3735d

Please sign in to comment.