Skip to content

Commit

Permalink
Try to fix a test for JRuby
Browse files Browse the repository at this point in the history
Handle a use that throws a different error when run on JRuby.
  • Loading branch information
enkessler committed May 26, 2020
1 parent b6eca18 commit 10b2777
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion testing/rspec/spec/integration/parsing_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ class << self
end

it 'correctly bubbles up parsing errors', :if => gherkin?(2) do
expect { nodule.parse_text('bad file') }.to raise_error(/Gherkin::Lexer::LexingError.*error on line 1/)
# A different error is thrown on JRuby
if RUBY_PLATFORM == "java"
expect { nodule.parse_text('bad file') }.to raise_error(/Java::GherkinLexer.*_FEATURE_END_/)
else
expect { nodule.parse_text('bad file') }.to raise_error(/Gherkin::Lexer::LexingError.*error on line 1/)
end
end

end
Expand Down

0 comments on commit 10b2777

Please sign in to comment.