Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #13 from TalentBox/allows-dash-in-tags

Allows dash (`-`) in tags
  • Loading branch information...
commit 52901389c4ff512089534a13f61f7213cf836d35 2 parents 7ba6d4b + e3a6b29
Josep M. Bach txus authored
2  lib/gherkin/parser/gherkin.rex
View
@@ -19,7 +19,7 @@ rule
Scenario: { [:SCENARIO, text[0..-2]] }
# Tags
- @\w+ { [:TAG, text[1..-1]] }
+ @(\w|-)+ { [:TAG, text[1..-1]] }
# Step keywords
Given { [:GIVEN, text] }
2  lib/gherkin/parser/lexer.rb
View
@@ -77,7 +77,7 @@ def _next_token
when (text = @ss.scan(/Scenario:/))
action { [:SCENARIO, text[0..-2]] }
- when (text = @ss.scan(/@\w+/))
+ when (text = @ss.scan(/@(\w|-)+/))
action { [:TAG, text[1..-1]] }
when (text = @ss.scan(/Given/))
2  lib/gherkin/parser/parser.rb
View
@@ -1,6 +1,6 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.7
+# This file is automatically generated by Racc 1.4.8
# from Racc grammer file "".
#
7 test/gherkin/parser/parser_test.rb
View
@@ -96,7 +96,7 @@ def parse(input)
Given blah foo bar
Then something else
- @javascript @wip
+ @javascript @wip @with-vcr
Scenario: Foo bar baz blah
Given blah foo bar
Then something else
@@ -105,8 +105,9 @@ def parse(input)
last_scenario = scenarios.last
- last_scenario.tags.first.name.must_equal "javascript"
- last_scenario.tags.last.name.must_equal "wip"
+ last_scenario.tags[0].name.must_equal "javascript"
+ last_scenario.tags[1].name.must_equal "wip"
+ last_scenario.tags[2].name.must_equal "with-vcr"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.