Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a9ad1f4aca
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (19 sloc) 0.996 kb
# This is not a test case. This file clears old test fixtures from the DB
# and then sets up new test fixtures and commits them. This is intended to
# be run from a different VM than the actual test cases that depend on
# them.
# Assumes the Book class is already saved in the repository.
# Clear any fixtures from a previous run.
raise "Lingering instances of book" unless Book.count == 0
# Add some fixtures and commit"Satan, Cantor, and Infinity", "Raymond Smullyan").persist"Surely You're Joking, Mr. Feynman!", "Richard P. Feynman").persist # => true"Green Eggs and Ham", "Dr. Seuss").persist # => true"Cat in the Hat", "Dr. Seuss").persist # => true
# Commit instances to the repository
raise "Wrong number of instances" unless Book.count == 4
# Create a book instance, but do not persist it to the repository"The Great American Novel", "A. Scott").persist
Jump to Line
Something went wrong with that request. Please try again.