Skip to content

Commit

Permalink
Use a shared example for the migration handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Lori Holden committed Dec 22, 2008
1 parent 32aea64 commit eae0e56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
8 changes: 1 addition & 7 deletions merb_sequel/spec/sequel_ext_spec.rb
Original file line number Diff line number Diff line change
@@ -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?'
Expand Down
14 changes: 8 additions & 6 deletions merb_sequel/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.