Commit 9034939

mo khan <mo@mokhan.ca>
2013-07-20 23:17:52
move table creation and drop into shared context
1 parent 4b1caa0
spec/integration/example_spec.rb
@@ -3,19 +3,6 @@ require "integration_helper"
 describe "crud" do
   include_context "orm"
 
-  before :each do
-    connection.create_table :movies do
-      primary_key :id
-      String :name
-    end
-
-    configuration.add(MovieMapping.new)
-  end
-
-  after :each do
-    connection.drop_table :movies
-  end
-
   context "when fetching all items" do
     before :each do
       @id = connection[:movies].insert(:name => 'monsters inc')
spec/integration_helper.rb
@@ -7,4 +7,18 @@ shared_context "orm" do
   let(:configuration) { Humble::Configuration.new(connection_string) }
   let(:session_factory) { configuration.build_session_factory }
   let(:session) { session_factory.create_session }
+
+  before :each do
+    connection.create_table :movies do
+      primary_key :id
+      String :name
+    end
+
+    configuration.add(MovieMapping.new)
+  end
+
+  after :each do
+    connection.drop_table :movies
+  end
+
 end
Gemfile.lock
@@ -1,7 +1,7 @@
 PATH
   remote: .
   specs:
-    humble (0.0.1374362129)
+    humble (0.0.1374362223)
       sequel
 
 GEM