spec/base_spec.rb in p8-metric_fu-0.9.0.3 vs spec/base_spec.rb in p8-metric_fu-0.9.0.4
- old
+ new
@@ -2,17 +2,17 @@
describe MetricFu::Base::Generator do
describe "save_html" do
it "should save to a index.html in the base_dir" do
@generator = MetricFu::Base::Generator.new
- @generator.should_receive(:open).with("#{MetricFu::BASE_DIRECTORY}/generator/index.html", "w")
+ @generator.should_receive(:open).with("#{MetricFu.configuration.base_directory}/generator/index.html", "w")
@generator.save_html("<html>")
end
it "should save to a custom.html to the base_dir if 'custom' is passed as name" do
@generator = MetricFu::Base::Generator.new
- @generator.should_receive(:open).with("#{MetricFu::BASE_DIRECTORY}/generator/metric_fu/custom.html", "w")
+ @generator.should_receive(:open).with("#{MetricFu.configuration.base_directory}/generator/metric_fu/custom.html", "w")
@generator.save_html("<html>", 'metric_fu/custom.html')
end
end
describe "generate_report class method" do
@@ -25,11 +25,11 @@
end
describe "generate_html" do
it "should create a new Generator and call generate_report on it" do
@generator = MetricFu::Base::Generator.new
- @generator.should_receive(:open).with("#{MetricFu::BASE_DIRECTORY}/generator/index.html", "w")
+ @generator.should_receive(:open).with("#{MetricFu.configuration.base_directory}/generator/index.html", "w")
@generator.should_receive(:generate_html).and_return('<html>')
@generator.generate_report
end
end
@@ -48,10 +48,10 @@
end
end
describe "metric_dir" do
it "should return tmp/metric_fu/{the class name in lowercase}" do
- MetricFu::Base::Generator.metric_dir.should == "#{MetricFu::BASE_DIRECTORY}/generator"
+ MetricFu::Base::Generator.metric_dir.should == "#{MetricFu.configuration.base_directory}/generator"
end
end
describe "link_to_filename", "when run_by_cruise_control and a url_prefix is specfied" do
before(:each) do
\ No newline at end of file