forked from jscruggs/metric_fu
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some tests for the undocumented Roodi configuration file feature
- Loading branch information
Jake Scruggs
committed
Jun 28, 2010
1 parent
c520642
commit 7e22991
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") | ||
|
||
describe Roodi do | ||
describe "emit" do | ||
it "should add config options when present" do | ||
MetricFu::Roodi.stub!(:verify_dependencies!).and_return(true) | ||
MetricFu::Configuration.run do |config| | ||
config.roodi = {:roodi_config => 'lib/config/roodi_config.yml', :dirs_to_roodi => []} | ||
end | ||
roodi = MetricFu::Roodi.new | ||
roodi.should_receive(:`).with(/-config=lib\/config\/roodi_config\.yml/).and_return("") | ||
roodi.emit | ||
end | ||
|
||
it "should NOT add config options when NOT present" do | ||
MetricFu::Roodi.stub!(:verify_dependencies!).and_return(true) | ||
MetricFu::Configuration.run do |config| | ||
config.roodi = {:dirs_to_roodi => []} | ||
end | ||
roodi = MetricFu::Roodi.new | ||
roodi.stub(:`) | ||
roodi.should_receive(:`).with(/-config/).never | ||
roodi.emit | ||
end | ||
end | ||
end |