diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/haml_lint | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/haml_lint')
-rw-r--r-- | spec/haml_lint/linter/documentation_links_spec.rb | 5 | ||||
-rw-r--r-- | spec/haml_lint/linter/inline_javascript_spec.rb | 31 | ||||
-rw-r--r-- | spec/haml_lint/linter/no_plain_nodes_spec.rb | 5 |
3 files changed, 37 insertions, 4 deletions
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' |