require 'spec_helper.rb' describe "Migration" do before do @record = mock('record', {:name => 'Pete'}) MyModel = mock('MyModel Class', {:count => 1, :find => [@record]}) require 'my_migration' @migration = MyMigration.new end it "should get a count of the records" do MyModel.should_receive(:count) @migration.run end it "should find the records" do MyModel.should_receive(:find) @migration.run end after do Object.send(:remove_const, :MyModel) end end