Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allows dash (`-`) in tags

  • Loading branch information...
commit e3a6b29cfe0992e09e775179e19ef0f2736e226a 1 parent 7ba6d4b
@JonathanTron JonathanTron authored
View
2  lib/gherkin/parser/gherkin.rex
@@ -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] }
View
2  lib/gherkin/parser/lexer.rb
@@ -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/))
View
2  lib/gherkin/parser/parser.rb
@@ -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 "".
#
View
7 test/gherkin/parser/parser_test.rb
@@ -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.