Add unit test

This commit is contained in:
Alex Ling
2020-02-25 19:00:10 +00:00
parent 46b36860d1
commit bc75f4d336
5 changed files with 88 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
require "./spec_helper"
describe Config do
it "creates config if it does not exist" do
tempfile = File.tempfile "mango-test-config"
config = Config.load tempfile.path
File.exists?(tempfile.path).should be_true
tempfile.delete
end
it "correctly loads config" do
config = Config.load "spec/asset/test-config.yml"
config.port.should eq 3000
end
end