From a5185ab98611ded25864ffdf3e358e4a139f4928 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 6 May 2022 06:07:56 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/haml_lint/linter/documentation_links_spec.rb | 5 ++-- spec/haml_lint/linter/inline_javascript_spec.rb | 31 +++++++++++++++++++++++ spec/haml_lint/linter/no_plain_nodes_spec.rb | 5 ++-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 spec/haml_lint/linter/inline_javascript_spec.rb (limited to 'spec/haml_lint') diff --git a/spec/haml_lint/linter/documentation_links_spec.rb b/spec/haml_lint/linter/documentation_links_spec.rb index f2aab4304c1..49a720700da 100644 --- a/spec/haml_lint/linter/documentation_links_spec.rb +++ b/spec/haml_lint/linter/documentation_links_spec.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'haml_lint' require 'haml_lint/spec' -require Rails.root.join('haml_lint/linter/documentation_links') + +require_relative '../../../haml_lint/linter/documentation_links' RSpec.describe HamlLint::Linter::DocumentationLinks do include_context 'linter' 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 diff --git a/spec/haml_lint/linter/no_plain_nodes_spec.rb b/spec/haml_lint/linter/no_plain_nodes_spec.rb index 08f7e6131cc..eeb0e4ea96f 100644 --- a/spec/haml_lint/linter/no_plain_nodes_spec.rb +++ b/spec/haml_lint/linter/no_plain_nodes_spec.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'haml_lint' require 'haml_lint/spec' -require Rails.root.join('haml_lint/linter/no_plain_nodes') + +require_relative '../../../haml_lint/linter/no_plain_nodes' RSpec.describe HamlLint::Linter::NoPlainNodes do include_context 'linter' -- cgit v1.2.3