public
Description: The Rails Engines plugin
Homepage: http://rails-engines.org
Clone URL: git://github.com/lazyatom/engines.git
Added a test for incremental migration, to try and capture the issue described 
by [#17], but without joy.
lazyatom (author)
Fri Jun 06 08:31:01 -0700 2008
commit  ec608c0d53144646609925023cb6108fe5a53458
tree    a2373d61d22fb120373bc18679d45f7ac85d0da8
parent  f52b0ae9c237c19bcdd19402c45a56c65f7c75bd
...
25
26
27
 
 
 
 
 
 
 
 
 
 
 
 
28
29
30
...
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
0
@@ -25,6 +25,18 @@ class MigrationsTest < Test::Unit::TestCase
0
     assert table_exists?('tests')
0
     assert table_exists?('others')
0
   end
0
+  
0
+  def test_engine_migrations_can_upgrade_incrementally
0
+    Engines.plugins[:test_migration].migrate(1)
0
+    assert table_exists?('tests')
0
+    assert !table_exists?('others')
0
+    assert_equal 1, Engines::Plugin::Migrator.current_version(Engines.plugins[:test_migration])
0
+    
0
+    
0
+    Engines.plugins[:test_migration].migrate(2)
0
+    assert table_exists?('others')
0
+    assert_equal 2, Engines::Plugin::Migrator.current_version(Engines.plugins[:test_migration])
0
+  end
0
     
0
   def test_generator_creates_plugin_migration_file
0
     Rails::Generator::Scripts::Generate.new.run(['plugin_migration', 'test_migration'], :quiet => true)

Comments