Skip to content

Commit

Permalink
Add expect_syntax_error spec helper
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov committed Jul 30, 2024
1 parent 1bd7ae7 commit 80f1817
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ def report_on_exception=(value)
ARGV.unshift $0
MSpecRun.main
end

def expect_syntax_error(ruby_src)
-> { eval(ruby_src) }.should raise_error(SyntaxError)
end

0 comments on commit 80f1817

Please sign in to comment.