spec/churn_spec.rb in p8-metric_fu-0.8.0.16 vs spec/churn_spec.rb in p8-metric_fu-0.8.2
- old
+ new
@@ -9,37 +9,30 @@
it "should strip out files that have less than the min count" do
logs = ["accept", "accept", "accept", "reject", "reject"]
git_mock = mock('git')
git_mock.should_receive(:get_logs).and_return(logs)
Churn::Git.should_receive(:new).and_return(git_mock)
- churn = Churn.new(:scm => :git, :minimum_churn_count => 3)
+ churn = Churn.new('base_dir', :scm => :git, :minimum_churn_count => 3)
churn.analyze
churn.instance_variable_get(:@changes).should == {"accept"=>3}
end
it "should have a default min count of 5" do
churn = Churn.new('base_dir')
churn.instance_variable_get(:@minimum_churn_count).should == 5
end
end
-
- describe "template_name" do
- it "should return the class name in lowercase" do
- churn = Churn.new
- churn.template_name.should == 'churn'
- end
- end
describe "parse_log_for_changes" do
it "should count the changes with git" do
logs = ["home_page/index.html", "README", "History.txt", "README", "History.txt", "README"]
git_mock = mock('git')
git_mock.should_receive(:get_logs).and_return(logs)
Churn::Git.should_receive(:new).and_return(git_mock)
File.should_receive(:exist?).with(".git").and_return(true)
- changes = Churn.new.send(:parse_log_for_changes)
+ changes = Churn.new('base_dir').send(:parse_log_for_changes)
changes["home_page/index.html"].should == 1
changes["History.txt"].should == 2
changes["README"].should == 3
end
@@ -48,10 +41,10 @@
svn_mock = mock('svn')
svn_mock.should_receive(:get_logs).and_return(logs)
Churn::Svn.should_receive(:new).and_return(svn_mock)
File.should_receive(:exist?).with(".git").and_return(false)
File.should_receive(:exist?).with(".svn").and_return(true)
- changes = Churn.new.send(:parse_log_for_changes)
+ changes = Churn.new('base_dir').send(:parse_log_for_changes)
changes["home_page/index.html"].should == 1
changes["History.txt"].should == 2
changes["README"].should == 3
end
end
\ No newline at end of file