config.vagrant validation tests

This commit is contained in:
Mitchell Hashimoto 2010-09-30 00:55:00 -07:00
parent 588ead6e45
commit 465392f99c
1 changed files with 33 additions and 1 deletions

View File

@ -6,6 +6,38 @@ class ConfigVagrantTest < Test::Unit::TestCase
end end
context "validation" do context "validation" do
# TODO setup do
@config.dotfile_name = "foo"
@config.home = "foo"
@config.host = "foo"
@errors = Vagrant::Config::ErrorRecorder.new
end
should "be valid with given set of values" do
@config.validate(@errors)
assert @errors.errors.empty?
end
should "be invalid with no dotfile" do
@config.dotfile_name = nil
@config.validate(@errors)
assert !@errors.errors.empty?
end
should "be invalid with no home" do
@config.home = nil
@config.validate(@errors)
assert !@errors.errors.empty?
end
should "be invalid with no host" do
@config.host = nil
@config.validate(@errors)
assert !@errors.errors.empty?
end
end end
end end