Skip to content

Commit 78de6bc

Browse files
committed
Less vague tests
1 parent 6939680 commit 78de6bc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/test_migration_tools.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def migration_proxy(m)
8383
it "migrate_list_without_pending_without_group" do
8484
0.upto(3).each {|i| @task.migrator(i).run}
8585

86-
MigrationTools::Tasks.any_instance.expects(:notify).with("Your database schema is up to date", "").once
86+
@task.expects(:notify).with("Your database schema is up to date", "").once
8787

8888
Rake::Task["db:migrate:list"].invoke
8989
end
@@ -92,28 +92,28 @@ def migration_proxy(m)
9292
@task.migrator(0).run
9393
@task.migrator(1).run
9494

95-
MigrationTools::Tasks.any_instance.expects(:notify).with("Your database schema is up to date", "before").once
95+
@task.expects(:notify).with("Your database schema is up to date", "before").once
9696

9797
ENV['GROUP'] = 'before'
9898
Rake::Task["db:migrate:list"].invoke
9999
end
100100

101101
it "migrate_list_with_pending_without_group" do
102-
MigrationTools::Tasks.any_instance.expects(:notify).with("You have 4 pending migrations", "").once
103-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 0 before Alpha").once
104-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 1 before Beta").once
105-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 2 change Delta").once
106-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 3 Kappa").once
102+
@task.expects(:notify).with("You have 4 pending migrations", "").once
103+
@task.expects(:notify).with(" 0 before Alpha").once
104+
@task.expects(:notify).with(" 1 before Beta").once
105+
@task.expects(:notify).with(" 2 change Delta").once
106+
@task.expects(:notify).with(" 3 Kappa").once
107107

108108
Rake::Task["db:migrate:list"].invoke
109109
end
110110

111111
it "migrate_list_with_pending_with_group" do
112112
ENV['GROUP'] = 'before'
113113

114-
MigrationTools::Tasks.any_instance.expects(:notify).with("You have 2 pending migrations", "before").once
115-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 0 before Alpha").once
116-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 1 before Beta").once
114+
@task.expects(:notify).with("You have 2 pending migrations", "before").once
115+
@task.expects(:notify).with(" 0 before Alpha").once
116+
@task.expects(:notify).with(" 1 before Beta").once
117117

118118
Rake::Task["db:migrate:list"].invoke
119119
end
@@ -146,7 +146,7 @@ def migration_proxy(m)
146146
@task.migrator(0).run
147147
@task.migrator(1).run
148148

149-
MigrationTools::Tasks.any_instance.expects(:notify).with("Your database schema is up to date").once
149+
@task.expects(:notify).with("Your database schema is up to date").once
150150

151151
ENV['GROUP'] = 'before'
152152
Rake::Task["db:migrate:group"].invoke
@@ -174,9 +174,9 @@ def migration_proxy(m)
174174
end
175175

176176
it "convenience_list_method" do
177-
MigrationTools::Tasks.any_instance.expects(:notify).with("You have 2 pending migrations", "before").once
178-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 0 before Alpha").once
179-
MigrationTools::Tasks.any_instance.expects(:notify).with(" 1 before Beta").once
177+
@task.expects(:notify).with("You have 2 pending migrations", "before").once
178+
@task.expects(:notify).with(" 0 before Alpha").once
179+
@task.expects(:notify).with(" 1 before Beta").once
180180

181181
Rake::Task["db:migrate:list:before"].invoke
182182
end

0 commit comments

Comments
 (0)