Created
November 5, 2008 17:47
-
-
Save revelation/22385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment