Sha256: 41ac1dcbd546e73da7e819c615bf6994f93ef6fd06718ce1850b2ba18c1d1f80
Contents?: true
Size: 800 Bytes
Versions: 6
Compression:
Stored size: 800 Bytes
Contents
# frozen_string_literal: true RSpec.describe RuboCop::Cop::Discourse::Plugins::UseRequireRelative, :config do subject(:cop) { described_class.new(config) } let(:config) { RuboCop::Config.new } context "when using `load`" do it "registers an offense" do expect_offense(<<~RUBY) load File.expand_path("../app/jobs/onceoff/voting_ensure_consistency.rb", __FILE__) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Discourse/Plugins/UseRequireRelative: Use `require_relative` instead of `load`. RUBY end end context "when using `require_relative`" do it "does not register an offense" do expect_no_offenses(<<~RUBY) require_relative "app/controllers/encrypt_controller.rb" RUBY end end end
Version data entries
6 entries across 6 versions & 1 rubygems