JBehave
  1. JBehave
  2. JBEHAVE-688

metaFilters "-skip" doesn't work while "-skip true" works

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Not A Bug
    • Affects Version/s: 3.5.4
    • Fix Version/s: 3.6
    • Component/s: Core
    • Labels:
      None
    • Environment:
      windows 7, java 1.6.0-26
    • Number of attachments :
      2

      Description

      The examples on the jbehave.org site consistently use "-skip" as meta filter to exclude stories marked with @skip true, which doesn't work, however "-skip true" works as expected.

      Either the parsing of the filter condition is broken or the examples could be changed to use "-skip true".

        Activity

        Hide
        Alexander Lehmann added a comment -

        Actually the examples in jbehave-core/examples use "-skip" as well, so I think this is the expected behavior.

        Show
        Alexander Lehmann added a comment - Actually the examples in jbehave-core/examples use "-skip" as well, so I think this is the expected behavior.
        Hide
        Mauro Talevi added a comment -

        The default MetaMatcher matches empty values as well. The behaviour is intended and verified by the examples.

        Can you please attach a sample project reproducing your behaviour?

        Show
        Mauro Talevi added a comment - The default MetaMatcher matches empty values as well. The behaviour is intended and verified by the examples. Can you please attach a sample project reproducing your behaviour?
        Hide
        Alexander Lehmann added a comment -

        this is essentially a jbehave-simple maven project with the metaFilters rule added, if you run MyStories as unit test, you should see the difference.

        Show
        Alexander Lehmann added a comment - this is essentially a jbehave-simple maven project with the metaFilters rule added, if you run MyStories as unit test, you should see the difference.
        Alexander Lehmann made changes -
        Field Original Value New Value
        Attachment jbehave-skip.zip [ 58330 ]
        Hide
        Alexander Lehmann added a comment - - edited

        I think this case is not covered by the tests, when I add

        assertFilterAllowsProperty("-skip", "skip true", false);

        the test fails

        Show
        Alexander Lehmann added a comment - - edited I think this case is not covered by the tests, when I add assertFilterAllowsProperty("-skip", "skip true", false); the test fails
        Hide
        Alexander Lehmann added a comment -

        additional test cases

        Show
        Alexander Lehmann added a comment - additional test cases
        Alexander Lehmann made changes -
        Attachment metafilter.diff [ 58337 ]
        Hide
        Mauro Talevi added a comment -

        If you want to match meta property "@skip true" you need to have a meta-filter with a non-empty value, e.g. "-skip *"

        assertFilterAllowsProperty("-skip *", "skip true", false);

        On the other hand, "@skip" is matched by "-skip", i.e. with an empty value:

        assertFilterAllowsProperty("-skip", "skip", false);

        Make sense?

        Show
        Mauro Talevi added a comment - If you want to match meta property "@skip true" you need to have a meta-filter with a non-empty value, e.g. "-skip *" assertFilterAllowsProperty("-skip *", "skip true", false); On the other hand, "@skip" is matched by "-skip", i.e. with an empty value: assertFilterAllowsProperty("-skip", "skip", false); Make sense?
        Hide
        Alexander Lehmann added a comment -

        yes, that seems sensible. I guess what confused me in the beginning is that the reference pages use "@skip true" (or false) in the story examples but in the meta filters only "-skip" is used (e.g. in the maven example) which doesn't work together.

        Show
        Alexander Lehmann added a comment - yes, that seems sensible. I guess what confused me in the beginning is that the reference pages use "@skip true" (or false) in the story examples but in the meta filters only "-skip" is used (e.g. in the maven example) which doesn't work together.
        Hide
        Mauro Talevi added a comment -

        Fair point, I've updated the meta-info page to use @skip without any value.

        Show
        Mauro Talevi added a comment - Fair point, I've updated the meta-info page to use @skip without any value.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Resolution Not A Bug [ 6 ]
        Mauro Talevi made changes -
        Fix Version/s 3.6 [ 17721 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Alexander Lehmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: