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

rubocop 0.41.1 (was 0.40.0)

This commit is contained in:
Jared Beck 2016-06-27 03:02:33 -04:00
parent 595bb43d7b
commit fc071b2d13
11 changed files with 27 additions and 27 deletions

View file

@ -5,15 +5,15 @@ Metrics/AbcSize:
Max: 30 # Goal: 15
Metrics/ClassLength:
Max: 400
Max: 327
Exclude:
- test/**/*
Metrics/CyclomaticComplexity:
Max: 13 # Goal: 6
Max: 8 # Goal: 6
Metrics/ModuleLength:
Max: 317
Metrics/PerceivedComplexity:
Max: 16 # Goal: 7
Max: 10 # Goal: 7

View file

@ -35,7 +35,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "generator_spec", "~> 0.9.3"
s.add_development_dependency "database_cleaner", "~> 1.2"
s.add_development_dependency "pry-nav", "~> 0.2.4"
s.add_development_dependency "rubocop", "~> 0.40.0"
s.add_development_dependency "rubocop", "~> 0.41.1"
s.add_development_dependency "timecop", "~> 0.8.0"
if defined?(JRUBY_VERSION)

View file

@ -25,7 +25,7 @@ describe Gadget, type: :model do
describe "Methods" do
describe "Instance", versioning: true do
describe "private" do
describe '#changed_notably?' do
describe "#changed_notably?" do
subject { Gadget.new(created_at: Time.now) }
context "create events" do

View file

@ -14,19 +14,19 @@ describe JoinedVersion, type: :model, versioning: true do
describe "VersionConcern::ClassMethods" do
before { widget } # persist a widget
describe '#subsequent' do
describe "#subsequent" do
it "shouldn't error out when there is a default_scope that joins" do
JoinedVersion.subsequent(version).first
end
end
describe '#preceding' do
describe "#preceding" do
it "shouldn't error out when there is a default scope that joins" do
JoinedVersion.preceding(version).first
end
end
describe '#between' do
describe "#between" do
it "shouldn't error out when there is a default scope that joins" do
JoinedVersion.between(Time.now, 1.minute.from_now).first
end
@ -35,7 +35,7 @@ describe JoinedVersion, type: :model, versioning: true do
end
describe "Methods" do
describe '#index' do
describe "#index" do
it { is_expected.to respond_to(:index) }
it "shouldn't error out when there is a default scope that joins" do

View file

@ -11,7 +11,7 @@ if JsonVersion.table_exists?
describe "Methods" do
describe "Class" do
describe '#where_object' do
describe "#where_object" do
it { expect(JsonVersion).to respond_to(:where_object) }
it "escapes values" do
@ -50,7 +50,7 @@ if JsonVersion.table_exists?
end
end
describe '#where_object_changes' do
describe "#where_object_changes" do
it { expect(JsonVersion).to respond_to(:where_object_changes) }
it "escapes values" do

View file

@ -4,7 +4,7 @@ module Kitchen
describe Banana, type: :model do
it { is_expected.to be_versioned }
describe '#versions' do
describe "#versions" do
it "returns instances of Kitchen::BananaVersion", versioning: true do
banana = described_class.create!
expect(banana.versions.first).to be_a(Kitchen::BananaVersion)

View file

@ -45,7 +45,7 @@ describe PaperTrail::Version, type: :model do
describe "Instance" do
subject { PaperTrail::Version.new }
describe '#paper_trail_originator' do
describe "#paper_trail_originator" do
it { is_expected.to respond_to(:paper_trail_originator) }
context "No previous versions" do
@ -89,7 +89,7 @@ describe PaperTrail::Version, type: :model do
end
end
describe '#terminator' do
describe "#terminator" do
let(:attributes) { { whodunnit: FFaker::Name.first_name } }
subject { PaperTrail::Version.new attributes }
@ -100,7 +100,7 @@ describe PaperTrail::Version, type: :model do
end
end
describe '#version_author' do
describe "#version_author" do
it { is_expected.to respond_to(:version_author) }
it "should be an alias for the `terminator` method" do
@ -140,7 +140,7 @@ describe PaperTrail::Version, type: :model do
end
end
describe '#where_object' do
describe "#where_object" do
it { expect(PaperTrail::Version).to respond_to(:where_object) }
context "invalid arguments" do
@ -205,7 +205,7 @@ describe PaperTrail::Version, type: :model do
end
end
describe '#where_object_changes' do
describe "#where_object_changes" do
context "invalid arguments" do
it "should raise an error" do
expect {

View file

@ -140,7 +140,7 @@ describe Widget, type: :model do
describe "Methods" do
describe "Instance", versioning: true do
describe '#paper_trail.originator' do
describe "#paper_trail.originator" do
describe "return value" do
let(:orig_name) { FFaker::Name.name }
let(:new_name) { FFaker::Name.name }
@ -192,7 +192,7 @@ describe Widget, type: :model do
end
end
describe '#version_at' do
describe "#version_at" do
context "Timestamp argument is AFTER object has been destroyed" do
it "should return `nil`" do
widget.update_attribute(:name, "foobar")
@ -202,7 +202,7 @@ describe Widget, type: :model do
end
end
describe '#whodunnit' do
describe "#whodunnit" do
it { is_expected.to respond_to(:whodunnit) }
context "no block given" do
@ -250,7 +250,7 @@ describe Widget, type: :model do
end
end
describe '#touch_with_version' do
describe "#touch_with_version" do
it "creates a version" do
count = widget.versions.size
# Travel 1 second because MySQL lacks sub-second resolution

View file

@ -1,7 +1,7 @@
require "rails_helper"
describe PaperTrail, type: :module, versioning: true do
describe '#config' do
describe "#config" do
it { is_expected.to respond_to(:config) }
it "should allow for config values to be set" do
@ -17,7 +17,7 @@ describe PaperTrail, type: :module, versioning: true do
end
end
describe '#configure' do
describe "#configure" do
it { is_expected.to respond_to(:configure) }
it "should be an alias for the `config` method" do

View file

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

View file

@ -943,7 +943,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
context "A reified item" do
setup do
widget = Widget.create name: "Bob"
%w( Tom Dick Jane ).each { |name| widget.update_attributes name: name }
%w(Tom Dick Jane).each { |name| widget.update_attributes name: name }
@version = widget.versions.last
@widget = @version.reify
end
@ -972,7 +972,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
context "with versions" do
setup do
@widget.save
%w( Tom Dick Jane ).each { |name| @widget.update_attributes name: name }
%w(Tom Dick Jane).each { |name| @widget.update_attributes name: name }
end
should "have a previous version" do
@ -1405,7 +1405,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
context "A reified item with a column -version- and custom version_method" do
setup do
widget = LegacyWidget.create(name: "foo", version: 2)
%w( bar baz ).each { |name| widget.update_attributes name: name }
%w(bar baz).each { |name| widget.update_attributes name: name }
@version = widget.versions.last
@widget = @version.reify
end