spec/config_spec.rb in mach5-tools-0.1.0 vs spec/config_spec.rb in mach5-tools-0.2.0
- old
+ new
@@ -1,9 +1,12 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
module Mach5
describe "Config" do
+ before(:each) do
+ Dir.stub(:pwd).and_return("")
+ end
it "should receive a block" do
object = double("Object")
object.should_receive(:touch)
Mach5::configure("MyProject") do
object.touch
@@ -60,8 +63,51 @@
it "should define the output folder" do
config = Mach5::configure("MyProject") do
output "_benchmark"
end
config.output_folder.should be == "_benchmark"
+ end
+
+ it "should define a chart" do
+ config = Mach5::configure("MyProject") do
+ chart "viterbi_vs_pd" do
+ title "Viterbi vs Posterior Decoding"
+ add_serie "edd0982eed0c414631991aa1dea67c811d95373f" => "DishonestCasinoHMM.Viterbi"
+ add_serie "edd0982eed0c414631991aa1dea67c811d95373f" => "DishonestCasinoHMM.PosteriorDecoding"
+ x_axis "Sequence Size"
+ y_axis "Time (s)"
+ size "100x200"
+ end
+ output "_benchmark"
+ end
+ config.charts.size.should be == 1
+ config.charts[0].build.should be == {
+ "type" => "line",
+ "dataType" => "runs_total_time",
+ "size" => {
+ "width" => 100,
+ "height" => 200
+ },
+ "title" => {
+ "text" => "Viterbi vs Posterior Decoding"
+ },
+ "xAxis" => {
+ "title" => {
+ "text" => "Sequence Size"
+ }
+ },
+ "yAxis" => {
+ "title" => {
+ "text" => "Time (s)"
+ }
+ },
+ "series" => [{
+ "label" => "edd0982eed0c414631991aa1dea67c811d95373f.DishonestCasinoHMM.Viterbi",
+ "file" => "/_benchmark/edd0982eed0c414631991aa1dea67c811d95373f.DishonestCasinoHMM.Viterbi.json"
+ },{
+ "label" => "edd0982eed0c414631991aa1dea67c811d95373f.DishonestCasinoHMM.PosteriorDecoding",
+ "file" => "/_benchmark/edd0982eed0c414631991aa1dea67c811d95373f.DishonestCasinoHMM.PosteriorDecoding.json"
+ }]
+ }
end
end
end
\ No newline at end of file