summaryrefslogtreecommitdiff
path: root/libmysqlpp/my-mock.cpp
blob: 2eee4163593d4cf813aa6c1bc190696e301ccaeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "my-connection.h"
#include "my-mock.h"
#include <compileTimeFormatter.h>

namespace MySQL {

Mock::Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss) :
	MockServerDatabase("options=p2testmysql", name, "mysql")
{
	CreateNewDatabase();
	PlaySchemaScripts(ss);
}

AdHocFormatter(MockConnStr, "options=p2testmysql;database=%?");
DB::Connection *
Mock::openConnection() const
{
	return new Connection(MockConnStr::get(testDbName));
}

Mock::~Mock()
{
	DropDatabase();
}

}