Permalink
Browse files

Add messy comments to stress the lexer

  • Loading branch information...
1 parent 97d1e58 commit a5570e96861a8840afeb33765507fe780fc21a0b @txus txus committed Nov 30, 2011
Showing with 16 additions and 13 deletions.
  1. +16 −13 test/gherkin/parser_test.rb
View
29 test/gherkin/parser_test.rb
@@ -4,19 +4,22 @@ module Gherkin
describe 'Feature parsing' do
before do
@scenario = """Feature: My Feature
- In order to do something
+ In order to do something #w000t peoeple
As a developer
- I want to be happy
+ I want to be happy #yeah
+
+ # Attend people. This is going to be fun
Background:
Given something happens before anything else happens
And more things happens before anything else happens
+ # And I wipe the hard drive
- Scenario: something happens
+ Scenario: something happens # yeah
Given something happens
Then something cooler happens
- @javascript @wip
+ @javascript @wip #@destroy
Scenario: something else happens
Given foo
Then bar
@@ -32,39 +35,39 @@ module Gherkin
background = @result.background
background.must_be_kind_of AST::Background
- background.line.must_equal 6
+ background.line.must_equal 8
background.steps.first.keyword.must_equal 'Given'
background.steps.first.name.must_equal 'something happens before anything else happens'
- background.steps.first.line.must_equal 7
+ background.steps.first.line.must_equal 9
background.steps.last.keyword.must_equal 'And'
background.steps.last.name.must_equal 'more things happens before anything else happens'
- background.steps.last.line.must_equal 8
+ background.steps.last.line.must_equal 10
first_scenario = @result.scenarios.first
first_scenario.must_be_kind_of AST::Scenario
- first_scenario.line.must_equal 10
+ first_scenario.line.must_equal 13
first_scenario.name.must_equal 'something happens'
first_scenario.steps.first.keyword.must_equal 'Given'
first_scenario.steps.first.name.must_equal 'something happens'
- first_scenario.steps.first.line.must_equal 11
+ first_scenario.steps.first.line.must_equal 14
first_scenario.steps.last.keyword.must_equal 'Then'
first_scenario.steps.last.name.must_equal 'something cooler happens'
- first_scenario.steps.last.line.must_equal 12
+ first_scenario.steps.last.line.must_equal 15
last_scenario = @result.scenarios.last
last_scenario.must_be_kind_of AST::Scenario
- last_scenario.line.must_equal 15
+ last_scenario.line.must_equal 18
last_scenario.name.must_equal 'something else happens'
last_scenario.tags.first.name.must_equal 'javascript'
last_scenario.tags.last.name.must_equal 'wip'
last_scenario.steps.first.keyword.must_equal 'Given'
last_scenario.steps.first.name.must_equal 'foo'
- last_scenario.steps.first.line.must_equal 16
+ last_scenario.steps.first.line.must_equal 19
last_scenario.steps.last.keyword.must_equal 'Then'
last_scenario.steps.last.name.must_equal 'bar'
- last_scenario.steps.last.line.must_equal 17
+ last_scenario.steps.last.line.must_equal 20
end
end
end

0 comments on commit a5570e9

Please sign in to comment.