def test_it_should_format_combinations_of_text_and_example_groups(self):
        feature = "\
    Feature: As a tester\n\
    I want my non example table text to remain intact\n\
    So that I don't want to kill the author of this plugin\n\
    \n\
    |cat breeds|country|\n\
    |Manx|Isle of Man|\n\
    |Octocat|The Web|\n"

        parsed = GherkinParser(feature).parse()
        text = GherkinFormatter().format(parsed)

        lines = text.split('\n')
        lines.should.have.length_of(8)
        lines[0].should.equal('    Feature: As a tester')
        lines[1].should.equal(
            '    I want my non example table text to remain intact')
        lines[2].should.equal(
            '    So that I don\'t want to kill the author of this plugin')
        lines[3].should.equal('    ')
        lines[4].should.equal('    | cat breeds | country     |')
        lines[5].should.equal('    | Manx       | Isle of Man |')
        lines[6].should.equal('    | Octocat    | The Web     |')
        lines[7].should.equal('')
Пример #2
0
  def test_it_should_format_example_group_columns_to_widest_value(self):
    examples = "\
    |cat breeds|country|\n\
    |Manx|Isle of Man|\n\
    |Octocat|The Web|\n"

    parsed = GherkinParser(examples).parse()
    text = GherkinFormatter().format(parsed)

    lines = text.split('\n')
    lines.should.have.length_of(4)
    lines[0].should.equal('    | cat breeds | country     |')
    lines[1].should.equal('    | Manx       | Isle of Man |')
    lines[2].should.equal('    | Octocat    | The Web     |')
    lines[3].should.equal('')
    def test_it_should_format_example_group_columns_to_widest_value(self):
        examples = "\
    |cat breeds|country|\n\
    |Manx|Isle of Man|\n\
    |Octocat|The Web|\n"

        parsed = GherkinParser(examples).parse()
        text = GherkinFormatter().format(parsed)

        lines = text.split('\n')
        lines.should.have.length_of(4)
        lines[0].should.equal('    | cat breeds | country     |')
        lines[1].should.equal('    | Manx       | Isle of Man |')
        lines[2].should.equal('    | Octocat    | The Web     |')
        lines[3].should.equal('')
Пример #4
0
  def test_it_should_format_combinations_of_text_and_example_groups(self):
    feature = "\
    Feature: As a tester\n\
    I want my non example table text to remain intact\n\
    So that I don't want to kill the author of this plugin\n\
    \n\
    |cat breeds|country|\n\
    |Manx|Isle of Man|\n\
    |Octocat|The Web|\n"

    parsed = GherkinParser(feature).parse()
    text = GherkinFormatter().format(parsed)

    lines = text.split('\n')
    lines.should.have.length_of(8)
    lines[0].should.equal('    Feature: As a tester')
    lines[1].should.equal('    I want my non example table text to remain intact')
    lines[2].should.equal('    So that I don\'t want to kill the author of this plugin')
    lines[3].should.equal('    ')
    lines[4].should.equal('    | cat breeds | country     |')
    lines[5].should.equal('    | Manx       | Isle of Man |')
    lines[6].should.equal('    | Octocat    | The Web     |')
    lines[7].should.equal('')