blob: fb35bb68247383eb9c628198954bbefb03338937 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# frozen_string_literal: true
require 'fast_spec_helper'
require 'haml_lint'
require 'haml_lint/spec'
require 'rspec-parameterized'
require_relative '../../../haml_lint/linter/inline_javascript'
RSpec.describe HamlLint::Linter::InlineJavaScript do # rubocop:disable RSpec/FilePath
using RSpec::Parameterized::TableSyntax
include_context 'linter'
let(:message) { described_class::MSG }
where(:haml, :should_report) do
'%script' | true
'%javascript' | false
':javascript' | true
':markdown' | false
end
with_them do
if params[:should_report]
it { is_expected.to report_lint message: message }
else
it { is_expected.not_to report_lint }
end
end
end
|