function it_resets_sections(Section $supervisord)
 {
     $supervisord->getName()->willReturn('supervisord');
     $this->addSection($supervisord);
     $this->reset();
     $this->getSections()->shouldReturn([]);
 }
 /**
  * Renders a section
  *
  * @param Section $section
  *
  * @return string
  */
 public function renderSection(Section $section)
 {
     $output = sprintf("[%s]\n", $section->getName());
     foreach ($section->getProperties() as $key => $value) {
         $value = $this->normalizeValue($value);
         $output .= sprintf("%s = %s\n", $key, $value);
     }
     // Write a linefeed after sections
     $output .= "\n";
     return $output;
 }
 /**
  * Adds or overrides a section
  *
  * @param Section $section
  */
 public function addSection(Section $section)
 {
     $this->sections[$section->getName()] = $section;
 }
 function it_renders_a_section(Section $section)
 {
     $section->getName()->willReturn('section');
     $section->getProperties()->willReturn(['key1' => 'value', 'key2' => true, 'key3' => ['val1', 'val2', 'val3']]);
     $this->renderSection($section)->shouldReturn("[section]\nkey1 = value\nkey2 = true\nkey3 = val1,val2,val3\n\n");
 }