Class: VagrantTest::Config
- Inherits:
-
Vagrant::Config::Base
- Object
- Vagrant::Config::Base
- VagrantTest::Config
- Defined in:
- lib/vagrant-test/config.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object
7 8 9 |
# File 'lib/vagrant-test/config.rb', line 7 def command @command || DEFAULT_COMMAND end |
#dir ⇒ Object
11 12 13 |
# File 'lib/vagrant-test/config.rb', line 11 def dir @dir || DEFAULT_DIR end |
#external_tests ⇒ Object
19 20 21 |
# File 'lib/vagrant-test/config.rb', line 19 def external_tests @external_tests || [] end |
#internal_tests ⇒ Object
15 16 17 |
# File 'lib/vagrant-test/config.rb', line 15 def internal_tests @internal_tests || [] end |
Instance Method Details
#validate(env, errors) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vagrant-test/config.rb', line 23 def validate(env, errors) errors.add("Test directory not found: #{dir}") unless File.directory?(dir) [:internal_tests, :external_tests].inject({}) { |memo,obj| memo.merge({ obj => send(obj.to_sym) }) }.each do |name,value| if value.respond_to?(:each) value.each do |obj| file = File.join(dir, obj) errors.add("File not found: #{file}") unless File.exists?(file) end else errors.add("#{name} is not enumerable") end end end |