rubocop-discourse 3.13.3 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -3
- data/lib/rubocop/cop/discourse/plugins/call_requires_plugin.rb +1 -2
- data/lib/rubocop/cop/discourse/plugins/no_monkey_patching.rb +5 -12
- data/lib/rubocop/cop/discourse/plugins/use_plugin_instance_on.rb +1 -2
- data/lib/rubocop/cop/discourse/services/empty_lines_around_blocks.rb +6 -12
- data/lib/rubocop/cop/discourse/services/group_keywords.rb +2 -7
- data/lib/rubocop/discourse/version.rb +1 -1
- data/rubocop-core.yml +2 -143
- data/rubocop-discourse.gemspec +15 -2
- data/rubocop-layout.yml +2 -80
- data/rubocop-rspec.yml +9 -215
- metadata +5 -35
- data/.github/workflows/ci.yml +0 -41
- data/.gitignore +0 -1
- data/.rspec +0 -1
- data/.rubocop.yml +0 -9
- data/.streerc +0 -2
- data/Gemfile +0 -11
- data/Rakefile +0 -8
- data/spec/fixtures/controllers/bad_controller.rb +0 -5
- data/spec/fixtures/controllers/base_controller.rb +0 -11
- data/spec/fixtures/controllers/good_controller.rb +0 -4
- data/spec/fixtures/controllers/inherit_from_outside_controller.rb +0 -5
- data/spec/fixtures/controllers/namespaced_parent_controller.rb +0 -5
- data/spec/fixtures/controllers/no_requires_plugin_controller.rb +0 -5
- data/spec/fixtures/controllers/requires_plugin_controller.rb +0 -6
- data/spec/lib/rubocop/cop/discourse/services/empty_lines_around_blocks_spec.rb +0 -309
- data/spec/lib/rubocop/cop/discourse/services/group_keywords_spec.rb +0 -137
- data/spec/lib/rubocop/cop/fabricator_shorthand_spec.rb +0 -71
- data/spec/lib/rubocop/cop/no_add_reference_active_record_migrations_spec.rb +0 -47
- data/spec/lib/rubocop/cop/no_mixing_multisite_and_standard_specs_spec.rb +0 -68
- data/spec/lib/rubocop/cop/no_mocking_jobs_enqueue_spec.rb +0 -31
- data/spec/lib/rubocop/cop/no_reset_column_information_migrations_spec.rb +0 -33
- data/spec/lib/rubocop/cop/only_top_level_multisite_specs_spec.rb +0 -78
- data/spec/lib/rubocop/cop/plugins/call_requires_plugin_spec.rb +0 -79
- data/spec/lib/rubocop/cop/plugins/namespace_constants_spec.rb +0 -40
- data/spec/lib/rubocop/cop/plugins/namespace_methods_spec.rb +0 -84
- data/spec/lib/rubocop/cop/plugins/no_monkey_patching_spec.rb +0 -91
- data/spec/lib/rubocop/cop/plugins/use_plugin_instance_on_spec.rb +0 -37
- data/spec/lib/rubocop/cop/plugins/use_require_relative_spec.rb +0 -24
- data/spec/lib/rubocop/cop/time_eq_matcher_spec.rb +0 -23
- data/spec/spec_helper.rb +0 -15
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
RSpec.describe RuboCop::Cop::Discourse::TimeEqMatcher, :config do
|
|
4
|
-
subject(:cop) { described_class.new(config) }
|
|
5
|
-
|
|
6
|
-
let(:config) { RuboCop::Config.new }
|
|
7
|
-
|
|
8
|
-
it "raises an offense if a timestamp is compared using `eq`" do
|
|
9
|
-
offenses = inspect_source(<<~RUBY)
|
|
10
|
-
expect(user.created_at).to eq(Time.zone.now)
|
|
11
|
-
RUBY
|
|
12
|
-
|
|
13
|
-
expect(offenses.first.message).to match(described_class::MSG)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "passes if a timestamp is compared using `eq_time`" do
|
|
17
|
-
offenses = inspect_source(<<~RUBY)
|
|
18
|
-
expect(user.created_at).to eq_time(Time.zone.now)
|
|
19
|
-
RUBY
|
|
20
|
-
|
|
21
|
-
expect(offenses).to be_empty
|
|
22
|
-
end
|
|
23
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
Bundler.setup
|
|
5
|
-
|
|
6
|
-
# Require supporting files exposed for testing.
|
|
7
|
-
require "rubocop"
|
|
8
|
-
require "rubocop/rspec/support"
|
|
9
|
-
|
|
10
|
-
require "rubocop-discourse" # and any other gems you need
|
|
11
|
-
|
|
12
|
-
RSpec.configure do |config|
|
|
13
|
-
config.include RuboCop::RSpec::ExpectOffense
|
|
14
|
-
# some (optional) config here
|
|
15
|
-
end
|