2020-09-02 08:10:35 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-08-18 14:10:07 -04:00
|
|
|
require 'rubocop_spec_helper'
|
2020-09-02 08:10:35 -04:00
|
|
|
require_relative '../../../../rubocop/cop/gitlab/intersect'
|
|
|
|
|
2021-01-07 13:10:38 -05:00
|
|
|
RSpec.describe RuboCop::Cop::Gitlab::Intersect do
|
2020-09-02 08:10:35 -04:00
|
|
|
it 'flags the use of Gitlab::SQL::Intersect.new' do
|
|
|
|
expect_offense(<<~SOURCE)
|
|
|
|
Gitlab::SQL::Intersect.new([foo])
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the `FromIntersect` concern, instead of using `Gitlab::SQL::Intersect` directly
|
|
|
|
SOURCE
|
|
|
|
end
|
|
|
|
end
|