Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a shared example for the migration handling

  • Loading branch information...
commit eae0e56d8fb1c286e22c49f92493e82b37677a8e 1 parent 32aea64
@lholden lholden authored
View
8 merb_sequel/spec/sequel_ext_spec.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?'
View
14 merb_sequel/spec/spec_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.