test/test_rtml_generator.rb in rtml-1.2.2 vs test/test_rtml_generator.rb in rtml-2.0.0.alpha.1
- old
+ new
@@ -1,7 +1,9 @@
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
+require 'rails_generator'
+
class TestRtmlGenerator < Test::Unit::TestCase
include RubiGen::GeneratorTestHelper
def setup
bare_setup
@@ -24,20 +26,38 @@
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
def test_generator_without_options
- run_generator('rtml', [APP_ROOT], sources)
- assert_directory_exists "path/to/included/folder"
- assert_generated_file "path/to/included/folder/some_file"
+ run_generator('rtml', [], sources)
+ assert_directory_exists "config/initializers"
+ assert_directory_exists "db/migrate"
+ assert_directory_exists 'lib/tasks'
+ assert_directory_exists 'doc'
+
+ assert_generated_file "config/initializers/rtml.rb"
+ assert_generated_file "config/tml_dom_ruleset.rb"
+ assert_generated_file 'lib/tasks/rtml.rake'
+ assert_generated_file 'doc/io_tml-application-development-guidelines.pdf'
+
+ # migrations
+ assert_generated_file "db/migrate/20100113131401_add_options_to_properties.rb"
+ assert_generated_file "db/migrate/20100110071920_add_parent_id_to_rtml_instructions.rb"
+ assert_generated_file "db/migrate/20100110060124_create_rtml_instructions.rb"
+ assert_generated_file "db/migrate/20100108165127_create_rtml_documents.rb"
+ assert_generated_file "db/migrate/20100108163827_create_rtml_dom_properties.rb"
+ assert_generated_file "db/migrate/20100108163703_create_rtml_dom_elements.rb"
+ assert_generated_file "db/migrate/20100127173146_add_parent_type_to_rtml_dom_elements.rb"
+ assert_generated_file "db/migrate/20100208114234_create_rtml_states.rb"
+ assert_generated_file "db/migrate/20100303021609_add_x_and_y_to_rtml_instructions.rb"
end
private
def sources
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
]
end
def generator_path
- "app_generators"
+ "rails_generators"
end
end