Skip to content

Instantly share code, notes, and snippets.

@jeremyevans
Forked from tenderlove/gist:398997
Created May 12, 2010 19:00
Show Gist options
  • Select an option

  • Save jeremyevans/399004 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyevans/399004 to your computer and use it in GitHub Desktop.
def test_changes
@db.execute("create table foo ( a integer primary key, b integer )")
assert_equal 0, @db.changes
@db.execute("insert into foo (b) VALUES (1)")
assert_equal 1, @db.changes
@db.execute("update foo set b = b + ? where b = ?", [2, 1])
assert_equal 1, @db.changes
assert_equal [[3]], @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