Skip to content

Commit

Permalink
Update Haml check for newer versions of the Haml gem
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstegman committed Nov 29, 2023
1 parent 3749ec4 commit 1fa946a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/ammeter/rspec/generator/matchers/have_correct_syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@
require 'haml'

begin
Haml::Engine.new(code)
Haml::Parser.new({}).call(code)
rescue Haml::SyntaxError
false
rescue NameError
true
begin
Haml::Engine.new(code)
rescue Haml::SyntaxError
false
rescue NameError
true
end
end
end

Expand Down

0 comments on commit 1fa946a

Please sign in to comment.