Permalink
Browse files

Silence deprecation warning from specs

  • Loading branch information...
1 parent c6078d7 commit 09c652e705358e02bfb19bb6a86b39a1cc561ef4 @dkubb dkubb committed Jun 17, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 spec/integration/migration_spec.rb
View
13 spec/integration/migration_spec.rb
@@ -14,6 +14,14 @@
@migration = DataMapper::Migration.new(1, :create_people_table, :verbose => false) { }
end
+ before do
+ $stderr, @original = StringIO.new, $stderr
+ end
+
+ after do
+ $stderr = @original
+ end
+
it "should have a postition attribute" do
@migration.should respond_to(:position)
@@ -42,6 +50,11 @@
m.instance_variable_get(:@repository).should == :legacy
end
+ it "warns when :database is used" do
+ m = DataMapper::Migration.new(2, :create_legacy_table, :database => :legacy) {}
+ $stderr.string.chomp.should == 'Using the :database option with migrations is deprecated, use :repository instead'
+ end
+
it "should have a verbose option" do
m = DataMapper::Migration.new(2, :create_dogs_table, :verbose => false) {}
m.instance_variable_get(:@verbose).should == false

0 comments on commit 09c652e

Please sign in to comment.