Class: TestBuiltinTask

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/tests/test_structure.rb

Constant Summary collapse

OUTPUT_DIR =
'tests/data/output'

Instance Method Summary collapse

Instance Method Details

#test_builtin_taskObject



25
26
27
28
29
# File 'lib/tests/test_structure.rb', line 25

def test_builtin_task
  Dokkit.application.init
  Dokkit.application.define_builtin_tasks
  assert_equal('create', Dokkit.application['create'].to_s)
end

#test_create_default_project_taskObject



31
32
33
34
35
36
37
38
# File 'lib/tests/test_structure.rb', line 31

def test_create_default_project_task
  Dokkit.application.init
  Dokkit.application.define_builtin_tasks
  Dokkit.application.collect_tasks ["create", "#{OUTPUT_DIR}/simple_document"]
  Dokkit.application.run
  dir_content = Dir["#{OUTPUT_DIR}/simple_document/*"]
  assert(!dir_content.empty? && !dir_content.include?('lib'))
end

#test_create_website_taskObject



40
41
42
43
44
45
46
47
# File 'lib/tests/test_structure.rb', line 40

def test_create_website_task
 Dokkit.application.init
 Dokkit.application.do_option('--project',"website")
 Dokkit.application.define_builtin_tasks
 Dokkit.application.collect_tasks ["create", "#{OUTPUT_DIR}/website_project"]
 Dokkit.application.run
 assert(Dir["#{OUTPUT_DIR}/website_project/*"].size > 1)
end