1 #! /usr/bin/env ruby -S rspec
2 # This just makes some nice things available at global scope, and for setup of
3 # tests to use a real fake database, rather than a fake stubs-that-don't-work
4 # version of the same. Fun times.
17 def can_use_scratch_database?
18 sqlite? and Puppet.features.rails?
22 # This is expected to be called in your `before :each` block, and will get you
23 # ready to roll with a serious database and all. Cleanup is handled
24 # automatically for you. Nothing to do there.
25 def setup_scratch_database
26 Puppet[:dbadapter] = 'sqlite3'
27 Puppet[:dblocation] = ':memory:'
28 Puppet[:railslog] = PuppetSpec::Files.tmpfile('storeconfigs.log')