From 3c3735dfebe22bcdffab91572f66d8fcc7c1a2e1 Mon Sep 17 00:00:00 2001 From: Hemal Varambhia Date: Sun, 8 Dec 2024 17:12:08 +0000 Subject: [PATCH] test: corrected the test as changes contains a list of files and the number of times they were changed. --- test/lib/rubycritic/learning/churn_gem_learning_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/lib/rubycritic/learning/churn_gem_learning_test.rb b/test/lib/rubycritic/learning/churn_gem_learning_test.rb index ff52cc02..72250098 100644 --- a/test/lib/rubycritic/learning/churn_gem_learning_test.rb +++ b/test/lib/rubycritic/learning/churn_gem_learning_test.rb @@ -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 = { @@ -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