From addf0660939b7dae0f6528c592d1b8a4d7ce5be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20Mari=C3=A9?= Date: Fri, 3 Mar 2017 10:12:27 -0800 Subject: [PATCH] adds rutbocop-rspec and rubocop-thread_safety --- .rubocop.yml | 12 ++++++++++++ .rubocop_todo.yml | 20 ++++++++++++++++++++ paper_trail.gemspec | 2 ++ spec/modules/version_number_spec.rb | 7 ------- spec/paper_trail_spec.rb | 5 +++++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4d8aaabe..6b5e6c01 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cadc7cd3..d3e8dfc9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 diff --git a/paper_trail.gemspec b/paper_trail.gemspec index c13efaa6..a80f2ff3 100644 --- a/paper_trail.gemspec +++ b/paper_trail.gemspec @@ -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" diff --git a/spec/modules/version_number_spec.rb b/spec/modules/version_number_spec.rb index ca60dda5..85896bfe 100644 --- a/spec/modules/version_number_spec.rb +++ b/spec/modules/version_number_spec.rb @@ -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 diff --git a/spec/paper_trail_spec.rb b/spec/paper_trail_spec.rb index bab6a113..5b4a6ce4 100644 --- a/spec/paper_trail_spec.rb +++ b/spec/paper_trail_spec.rb @@ -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" }