testLoad method

void testLoad({
  1. String fileInput = '',
  2. Parser parser = const Parser(),
  3. Map<String, String> mergeWith = const {},
})

Implementation

void testLoad(
    {String fileInput = '',
    Parser parser = const Parser(),
    Map<String, String> mergeWith = const {}}) {
  clean();
  final linesFromFile = fileInput.split('\n');
  final linesFromMergeWith = mergeWith.entries
      .map((entry) => "${entry.key}=${entry.value}")
      .toList();
  final allLines = linesFromMergeWith..addAll(linesFromFile);
  final envEntries = parser.parse(allLines);
  _envMap.addAll(envEntries);
  _isInitialized = true;
}