test/unit/churn_calculator_test.rb in churn-0.0.7 vs test/unit/churn_calculator_test.rb in churn-0.0.8
- old
+ new
@@ -37,11 +37,11 @@
Churn::ChurnCalculator.stubs(:git?).returns(true)
churn = Churn::ChurnCalculator.new({:minimum_churn_count => 3})
churn.stubs(:parse_log_for_changes).returns([['less.rb',1]])
churn.stubs(:parse_log_for_revision_changes).returns(['first'])
- churn.stubs(:parse_logs_for_updated_files).returns(['fake_file.rb'])
+ churn.stubs(:parse_logs_for_updated_files).returns({'fake_file.rb'=>[]})
report = churn.report(false)
assert_equal ["fake_file.rb"], report[:churn][:changed_files]
end
end
@@ -50,11 +50,11 @@
Churn::ChurnCalculator.stubs(:git?).returns(true)
churn = Churn::ChurnCalculator.new({:minimum_churn_count => 3})
churn.stubs(:parse_log_for_changes).returns([['less.rb',1]])
churn.stubs(:parse_log_for_revision_changes).returns(['first'])
- churn.stubs(:parse_logs_for_updated_files).returns(['fake_file.rb'])
+ churn.stubs(:parse_logs_for_updated_files).returns({'fake_file.rb'=>[]})
klasses = [{"klass"=>"LocationMapping", "file"=>"lib/churn/location_mapping.rb"}]
methods = [{"klass"=>"LocationMapping", "method"=>"LocationMapping#process_class", "file"=>"lib/churn/location_mapping.rb"}]
churn.stubs(:get_changes).returns([klasses,methods])
report = churn.report(false)
assert_equal [{"klass"=>"LocationMapping", "method"=>"LocationMapping#process_class", "file"=>"lib/churn/location_mapping.rb"}], report[:churn][:changed_methods]
@@ -67,10 +67,10 @@
Churn::ChurnCalculator.stubs(:git?).returns(true)
churn = Churn::ChurnCalculator.new({:minimum_churn_count => 3})
churn.stubs(:parse_log_for_changes).returns([['less.rb',1]])
churn.stubs(:parse_log_for_revision_changes).returns(['first'])
- churn.stubs(:parse_logs_for_updated_files).returns(['fake_file.rb'])
+ churn.stubs(:parse_logs_for_updated_files).returns({'fake_file.rb'=>[]})
klasses = [{"klass"=>"LocationMapping", "file"=>"lib/churn/location_mapping.rb"}]
methods = [{"klass"=>"LocationMapping", "method"=>"LocationMapping#process_class", "file"=>"lib/churn/location_mapping.rb"}]
churn.stubs(:get_changes).returns([klasses,methods])
report = churn.report(false)
assert_equal [{"method"=>{"klass"=>"LocationMapping", "method"=>"LocationMapping#process_class", "file"=>"lib/churn/location_mapping.rb"}, "times_changed"=>1}], report[:churn][:method_churn]