Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/haml_lint/linter/inline_javascript_spec.rb')
-rw-r--r--spec/haml_lint/linter/inline_javascript_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/haml_lint/linter/inline_javascript_spec.rb b/spec/haml_lint/linter/inline_javascript_spec.rb
new file mode 100644
index 00000000000..fb35bb68247
--- /dev/null
+++ b/spec/haml_lint/linter/inline_javascript_spec.rb
@@ -0,0 +1,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