Skip to content

Commit

Permalink
Allow cucumber feature to match old and new syntax error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed May 29, 2012
1 parent 9c034b3 commit 35161a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions features/command_line_interface/stdin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,5 @@ Feature: Reek reads from $stdin when no files are given
$stdin -- 0 warnings
"""
And stderr reports:
"""
$stdin: Racc::ParseError:
parse error on value "$end" ($end)
And it reports a parsing error

"""
8 changes: 8 additions & 0 deletions features/step_definitions/reek_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
@last_stderr.chomp.should == string
end

Then /^it reports a parsing error$/ do
if RUBY_VERSION < "1.9.3"
@last_stderr.chomp.should match /Racc::ParseError/
else
@last_stderr.chomp.should match /RipperRubyParser::SyntaxError/
end
end

Then /^it reports the current version$/ do
@last_stdout.should == "reek #{Reek::VERSION}\n"
end

0 comments on commit 35161a2

Please sign in to comment.