Sha256: 86a749d0218dff8ab2fc1ab85c9b80fb22a0fd99a3d4d23a65018d19b336abfe
Contents?: true
Size: 631 Bytes
Versions: 2
Compression:
Stored size: 631 Bytes
Contents
# frozen_string_literal: true RSpec.describe RuboCop::Cop::Discourse::TimeEqMatcher, :config do subject(:cop) { described_class.new(config) } let(:config) { RuboCop::Config.new } it "raises an offense if a timestamp is compared using `eq`" do offenses = inspect_source(<<~RUBY) expect(user.created_at).to eq(Time.zone.now) RUBY expect(offenses.first.message).to match(described_class::MSG) end it "passes if a timestamp is compared using `eq_time`" do offenses = inspect_source(<<~RUBY) expect(user.created_at).to eq_time(Time.zone.now) RUBY expect(offenses).to be_empty end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-discourse-3.9.3 | spec/lib/rubocop/cop/time_eq_matcher_spec.rb |
rubocop-discourse-3.9.2 | spec/lib/rubocop/cop/time_eq_matcher_spec.rb |