| 272 | } |
| 273 | |
| 274 | void GitInitTest::testReadAndSetConfigOption() |
| 275 | { |
| 276 | repoInit(); |
| 277 | |
| 278 | { |
| 279 | qDebug() << "read non-existing config option"; |
| 280 | QString nameFromPlugin = m_plugin->readConfigOption(QUrl::fromLocalFile(gitTest_BaseDir()), |
| 281 | QStringLiteral("notexisting.asdads")); |
| 282 | QVERIFY(nameFromPlugin.isEmpty()); |
| 283 | } |
| 284 | |
| 285 | { |
| 286 | qDebug() << "write user.name = \"John Tester\""; |
| 287 | auto job = m_plugin->setConfigOption(QUrl::fromLocalFile(gitTest_BaseDir()), |
| 288 | QStringLiteral("user.name"), QStringLiteral("John Tester")); |
| 289 | VERIFYJOB(job); |
| 290 | const auto name = runCommand(QStringLiteral("git"), {"config", "--get", QStringLiteral("user.name")}); |
| 291 | QCOMPARE(name, QStringLiteral("John Tester")); |
| 292 | } |
| 293 | |
| 294 | { |
| 295 | qDebug() << "read user.name"; |
| 296 | const QString nameFromPlugin = m_plugin->readConfigOption(QUrl::fromLocalFile(gitTest_BaseDir()), |
| 297 | QStringLiteral("user.name")); |
| 298 | QCOMPARE(nameFromPlugin, QStringLiteral("John Tester")); |
| 299 | const auto name = runCommand(QStringLiteral("git"), {"config", "--get", QStringLiteral("user.name")}); |
| 300 | QCOMPARE(name, QStringLiteral("John Tester")); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | void GitInitTest::testAdd() |
| 305 | { |
nothing calls this directly
no test coverage detected