miksturait / cucumber_fm-plugin

Help to manage with big amount of features in project (gui for rails)
http://cucumber.fm
MIT License
96 stars 2 forks source link

Scenario outlines problem - titles are not recognized #35

Closed restless closed 6 years ago

restless commented 13 years ago

Cucumber fm (I use 0.1.3 on ruby 1.9.2) is not able to find titles of scenario outlines. For each outline I get "--- no title found".

The problem is caused by the fetch_title function (lib/cucumber_f_m/feature_element/component/title.rb):

        def title_line_pattern
          /^\s*[A-Z][a-z]+:\s.*$/
        end

        def fetch_title
          if tag_line = title_line_pattern.match(raw)
            tag_line[0].gsub(/^[^:]*:/,'').strip
          else
            '--- no title found'
          end

Looks good but somehow regexp doesn't work for scenario outlines. However everything is ok when I use:

        def fetch_title
          if tag_line = /^\s*[^:\r\n#]+:\s.*$/.match(raw)
            tag_line[0].gsub(/^[^:]*:/,'').strip
          else
            '--- no title found'
          end
cs3b commented 13 years ago

are able to prepare spec that imitate this behavior - it would help me more

next week I'm getting back to development of steak and cucumber fm - so I will look at this bug.

thx for reporting :-)

restless commented 13 years ago

Here's sample failing scenario outline:

Szablon scenariusza: Testowy szablon
    Zakładając że jest to test
    I naciskam przycisk "<przycisk>"
    Wtedy powinienem widzieć "Test zakończony"

    Przykłady: Zapisz
      |przycisk|
      |"Zapisz"|

    Przykłady: Wyślij
      |przycisk|
      |"Wyślij"|
cs3b commented 13 years ago

thx, will be looking at this next week