Permalink
Browse files

Use a shared example for the migration handling

  • Loading branch information...
1 parent 32aea64 commit eae0e56d8fb1c286e22c49f92493e82b37677a8e Lori Holden committed Dec 22, 2008
Showing with 9 additions and 13 deletions.
  1. +1 −7 merb_sequel/spec/sequel_ext_spec.rb
  2. +8 −6 merb_sequel/spec/spec_helper.rb
@@ -1,13 +1,7 @@
require File.dirname(__FILE__) + "/spec_helper"
describe 'Sequel::Model#new_record?' do
- before(:each) do
- spec_model_up
- end
-
- after(:each) do
- spec_model_down
- end
+ it_should_behave_like "having a spec model"
it "is defined" do
SpecModel.instance_methods.should include 'new_record?'
@@ -22,14 +22,16 @@ def down
end
end
-def spec_model_up
- CreateSpecModel.apply(DB, :up)
-end
-def spec_model_down
- CreateSpecModel.apply(DB, :up)
+describe "having a spec model", :shared => true do
+ before(:each) do
+ CreateSpecModel.apply(DB, :up)
+ end
+
+ after(:each) do
+ CreateSpecModel.apply(DB, :up)
+ end
end
class SpecModel < Sequel::Model
set_dataset DB[:spec_models]
-
end

0 comments on commit eae0e56

Please sign in to comment.