require 'spec_helper.rb' describe "Migration" do before(:all) do MyModel = Object.new require 'my_migration' end before(:each) do @record = mock('record', :name => 'Pete') MyModel.stub!(:find).and_return([@record]) MyModel.stub!(:count) end it "should get a count of the records" do MyModel.should_receive(:count) MyMigration.new.run end it "should find the records" do MyModel.should_receive(:find) MyMigration.new.run end end