Skip to content

Commit

Permalink
More details in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robb1e committed Feb 3, 2013
1 parent e0c9711 commit 4c71211
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Nosql

TODO: Write a gem description
A simple ActiveRecord 'adapter' that raises an exception whenever the database is used. This is to ensure unit tests do not integrate with a database.

When testing scopes and complex queries, applying a tag can disable this gem and replace the normal adapter implementation.

[Write up on usage](http://pivotallabs.com/testing-strategies-rspec-nulldb-nosql)

## Installation

Expand All @@ -18,7 +22,18 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
If you were using RSpec and tagged tests which did hit the datbase with ':db', then you could use the following.

config.around(:each, type: :model) do |example|
if example.metadata[:db]
Nosql::Connection.disable!
example.run
else
Nosql::Connection.enable!
example.run
Nosql::Connection.disable!
end
end

## Contributing

Expand Down

0 comments on commit 4c71211

Please sign in to comment.