Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created May 12, 2010 18:59
Show Gist options
  • Save tenderlove/398997 to your computer and use it in GitHub Desktop.
Save tenderlove/398997 to your computer and use it in GitHub Desktop.
def test_changes
@db.execute("create table foo ( a integer primary key, b text )")
assert_equal 0, @db.changes
@db.execute("insert into foo (b) VALUES ('asdf')")
assert_equal 1, @db.changes
@db.execute("update foo set b = 'hello' where b = 'asdf'")
assert_equal 1, @db.changes
assert_equal [['hello']], @db.execute("select b from foo")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment