spec/model_spec.rb in rb-libsvm-1.0.6 vs spec/model_spec.rb in rb-libsvm-1.0.7

- old
+ new

@@ -47,11 +47,11 @@ describe "A saved model" do include ModelSpecHelper before(:each) do - @filename = "svm_model.model" + @filename = "tmp/svm_model.model" model = Model.train(create_problem, create_parameter) model.save(@filename) end it "can be loaded" do @@ -69,16 +69,17 @@ before(:each) do @problem = create_problem @parameter = create_parameter @model = Model.train(@problem, @parameter) + @file_path = "tmp/svm_model.model" + File.delete(@file_path) if File.exists?(@file_path) end it "can be saved to a file" do - file_path = "svm_model.model" - @model.save(file_path) - File.exist?(file_path).should be_true + @model.save(@file_path) + File.exist?(@file_path).should be_true end it "can be asked for it's svm_type" do @model.svm_type.should == SvmType::C_SVC end @@ -90,6 +91,5 @@ it "can predict" do prediction = @model.predict(create_example) prediction.should_not be_nil end end -