Module: ReversibleData::RSpec2Macros

Defined in:
lib/reversible_data/rspec2_macros.rb

Instance Method Summary collapse

Instance Method Details

#use_reversible_tables(*tables) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/reversible_data/rspec2_macros.rb', line 4

def use_reversible_tables(*tables)
  options       = tables.extract_options!
  scope         = options.fetch(:scope, :each)
  table_manager = ReversibleData.manager_for(*tables)
  before(scope) { table_manager.up! }
  after(scope)  { table_manager.down! }
end