Fix an error on Ruby 2.0

This commit is contained in:
Takashi Kokubun 2015-03-30 21:01:15 +09:00
parent 9d4b6187ad
commit ee9937659d
1 changed files with 4 additions and 3 deletions

View File

@ -37,9 +37,10 @@ describe Hamlit::Engine do
%9
HAML
rescue Hamlit::SyntaxError => e
return unless e.respond_to?(:backtrace_locations)
line_number = e.backtrace_locations.first.to_s.match(/:(\d+):/)[1]
expect(line_number).to eq('8')
if e.respond_to?(:backtrace_locations)
line_number = e.backtrace_locations.first.to_s.match(/:(\d+):/)[1]
expect(line_number).to eq('8')
end
end
end
end