test/unit/churn_calculator_test.rb in churn-0.0.9 vs test/unit/churn_calculator_test.rb in churn-0.0.10
- old
+ new
@@ -76,7 +76,15 @@
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]
assert_equal [{"klass"=>{"klass"=>"LocationMapping", "file"=>"lib/churn/location_mapping.rb"}, "times_changed"=>1}], report[:churn][:class_churn]
end
end
+
+ should "initialize a churn calculator for hg repositories" do
+ Churn::ChurnCalculator.stubs(:git?).returns(false)
+ Churn::ChurnCalculator.stubs(:system).with('hg branch').returns(true)
+ churn = Churn::ChurnCalculator.new({:minimum_churn_count => 3})
+ assert churn.instance_variable_get(:@source_control).is_a?(Churn::HgAnalyzer)
+ end
+
end