Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def supported_by(*adapters)
- adapters = get_adapters(*adapters)
- PRIMARY.only(*adapters).each do |adapter, connection_uri|
- # keep track of the current adapters
- AdapterHelpers.current_adapters << adapters
- message = "with #{adapter}" if adapters.length > 1
- with_adapter_spec_wrapper(message) do
- before(:each) do
- # store these in instance vars for the shared adapter specs
- @adapter = DataMapper.setup(:default, connection_uri)
- @repository = repository(:default)
- begin
- DataMapper.auto_migrate!
- rescue NotImplementedError
- # do nothing when not supported
- end
- end
- yield adapter
- end
- AdapterHelpers.current_adapters.pop
- end
- end
Add Comment
Please, Sign In to add comment