diff --git a/spec_helper.rb b/spec_helper.rb index af1c38587..34bc068a5 100644 --- a/spec_helper.rb +++ b/spec_helper.rb @@ -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