mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Merge pull request #51 from ewollesen/database_cleaner
--- The array passed does not belong to us, and so we should dup it before we modify it (via append in this case).
This commit is contained in:
commit
2717fca549
2 changed files with 11 additions and 1 deletions
|
@ -15,7 +15,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
|
|
||||||
@only = opts[:only]
|
@only = opts[:only]
|
||||||
@tables_to_exclude = (opts[:except] || [])
|
@tables_to_exclude = (opts[:except] || []).dup
|
||||||
@tables_to_exclude << migration_storage_name unless migration_storage_name.nil?
|
@tables_to_exclude << migration_storage_name unless migration_storage_name.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,16 @@ module ::DatabaseCleaner
|
||||||
its(:only) { should == nil }
|
its(:only) { should == nil }
|
||||||
its(:except) { should == ["migration_storage_name"] }
|
its(:except) { should == ["migration_storage_name"] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "" do
|
||||||
|
EXCEPT_TABLES = ["something"]
|
||||||
|
subject { MigrationExample.new( { :except => EXCEPT_TABLES } ) }
|
||||||
|
|
||||||
|
it "should not modify the array of excepted tables" do
|
||||||
|
subject.except.should include("migration_storage_name")
|
||||||
|
EXCEPT_TABLES.should_not include("migration_storage_name")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue