Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /usr/bin/env ruby
require 'rubygems'
require 'sequel'
Sequel.extension :migration
class TestSomeDatabaseRoutines
def setup
TestDatabase.down
TestDatabase.up
TestSetup.down
TestSetup.up
# class Test < Sequel::Model; end # => class definition in method body (SyntaxError)
end
def test_create
a = Test.create(:name => 'Hello!')
assert(a != nil and a.name == 'Hello!')
end
end
# Migration stuff goes here
class Test < Sequel::Model # => ERROR: relation "test" does not exist
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment