1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Merge pull request #935 from Dorian/add-rubocop-extensions

Add rubocop extensions: rubocop-rspec and rubocop-thread_safety
This commit is contained in:
Jared Beck 2017-03-04 11:41:51 -05:00 committed by GitHub
commit fa70dbf069
5 changed files with 39 additions and 7 deletions

View file

@ -1,3 +1,7 @@
require:
- rubocop-rspec
- rubocop-thread_safety
inherit_from: .rubocop_todo.yml
# Please:
@ -105,3 +109,11 @@ Style/StringLiterals:
# because it makes the code harder to edit, and makes lines unnecessarily long.
Style/SpaceAroundOperators:
AllowForAlignment: false
ThreadSafety/NewThread:
Exclude:
- 'test/functional/thread_safety_test.rb'
ThreadSafety/InstanceVariableInClassMethod:
Exclude:
- 'lib/paper_trail.rb'

View file

@ -1,3 +1,5 @@
require: rubocop-rspec
# Remove these configuration records
# one by one as the offenses are removed from the code base.
@ -12,3 +14,21 @@ Metrics/PerceivedComplexity:
Style/FrozenStringLiteralComment:
Enabled: false
RSpec/InstanceVariable:
Enabled: false
RSpec/ExampleWording:
Enabled: false
RSpec/DescribedClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/NotToNot:
Enabled: false
RSpec/FilePath:
Enabled: false

View file

@ -42,6 +42,8 @@ has been destroyed.
s.add_development_dependency "database_cleaner", "~> 1.2"
s.add_development_dependency "pry-nav", "~> 0.2.4"
s.add_development_dependency "rubocop", "~> 0.41.1"
s.add_development_dependency "rubocop-rspec", "~> 1.5.1"
s.add_development_dependency "rubocop-thread_safety", "~> 0.3.1"
s.add_development_dependency "timecop", "~> 0.8.0"
s.add_development_dependency "sqlite3", "~> 1.2"
s.add_development_dependency "pg", "~> 0.19.0"

View file

@ -34,10 +34,3 @@ describe PaperTrail::VERSION do
end
end
end
describe PaperTrail do
describe "#version" do
it { is_expected.to respond_to(:version) }
it { expect(subject.version).to eq(PaperTrail::VERSION::STRING) }
end
end

View file

@ -61,6 +61,11 @@ describe PaperTrail do
end
end
describe :version do
it { expect(PaperTrail).to respond_to(:version) }
it { expect(PaperTrail.version).to eq(PaperTrail::VERSION::STRING) }
end
describe :whodunnit do
before(:all) { PaperTrail.whodunnit = "foobar" }