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