From ee9937659d8fe7a3a7b5ea98cba8832bcbd81ac6 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 30 Mar 2015 21:01:15 +0900 Subject: [PATCH] Fix an error on Ruby 2.0 --- spec/hamlit/engine/error_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/hamlit/engine/error_spec.rb b/spec/hamlit/engine/error_spec.rb index 6e5bd843..03433b5d 100644 --- a/spec/hamlit/engine/error_spec.rb +++ b/spec/hamlit/engine/error_spec.rb @@ -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