spec/openstudio/analysis/translator/excel_spec.rb in openstudio-analysis-0.1.7 vs spec/openstudio/analysis/translator/excel_spec.rb in openstudio-analysis-0.1.8
- old
+ new
@@ -95,27 +95,35 @@
before(:all) do
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/setup_version_2.xlsx")
@excel.process
end
- it "should have a version" do
+ it "should have a version and machine name" do
expect(@excel.version).to eq("0.1.9")
+ expect(@excel.machine_name).to eq("example_analysis")
end
it "should have the new settings" do
expect(@excel.settings["server_instance_type"]).to eq("m2.xlarge")
end
- it "should have problem setup" do
- expect(@excel.problem["number_of_samples"]).to eq(100)
- expect(@excel.problem["sensitivity_method"]).to eq("All Variables")
- end
-
it "should have algorithm setup" do
+ expect(@excel.algorithm["number_of_samples"]).to eq(100)
expect(@excel.algorithm["number_of_generations"]).to eq(20)
- #expect(@excel.algorithm["number_of_generations"]).to be_a Integer
- expect(@excel.machine_name).to eq("example_analysis")
+ expect(@excel.algorithm["sample_method"]).to eq("all_variables")
+ expect(@excel.algorithm["number_of_generations"]).to be_a Integer
+ expect(@excel.algorithm["tolerance"]).to eq(0.115)
+ expect(@excel.algorithm["tolerance"]).to be_a Float
+
end
+ it "should create a valid hash" do
+ h = @excel.create_analysis_hash
+
+ expect(h['analysis']['problem']['analysis_type']).to eq("lhs")
+ expect(h['analysis']['problem']['algorithm']).not_to be_nil
+ expect(h['analysis']['problem']['algorithm']['number_of_samples']).to eq(100)
+ expect(h['analysis']['problem']['algorithm']['sample_method']).to eq("all_variables")
+ end
end
end