spec/churn_spec.rb in p8-metric_fu-0.8.4.15 vs spec/churn_spec.rb in p8-metric_fu-0.8.4.16
- old
+ new
@@ -9,11 +9,11 @@
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('base_dir', :scm => :git, :minimum_churn_count => 3)
+ churn = Churn.new(: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
@@ -23,11 +23,11 @@
end
describe "template_name" do
it "should return the class name in lowercase" do
- churn = Churn.new('base_dir')
+ churn = Churn.new
churn.template_name.should == 'churn'
end
end
describe "parse_log_for_changes" do
@@ -35,11 +35,11 @@
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('base_dir').send(:parse_log_for_changes)
+ changes = Churn.new.send(:parse_log_for_changes)
changes["home_page/index.html"].should == 1
changes["History.txt"].should == 2
changes["README"].should == 3
end
@@ -48,10 +48,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('base_dir').send(:parse_log_for_changes)
+ changes = Churn.new.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