Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Created March 21, 2011 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nelsnelson/879582 to your computer and use it in GitHub Desktop.
Save nelsnelson/879582 to your computer and use it in GitHub Desktop.
#! /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