diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 00000000..6185c319 --- /dev/null +++ b/.standard.yml @@ -0,0 +1,3 @@ +ignore: + - 'lib/**/*': + - Lint/UnreachableCode diff --git a/lib/clusterable/ocn_resolution.rb b/lib/clusterable/ocn_resolution.rb index 25ba7918..1ddfe191 100644 --- a/lib/clusterable/ocn_resolution.rb +++ b/lib/clusterable/ocn_resolution.rb @@ -3,21 +3,21 @@ module Clusterable # A mapping from a deprecated OCN to a resolved OCN class OCNResolution -# include Mongoid::Document -# -# # store_in collection: "resolutions", database: "test", client: "default" -# field :deprecated -# field :resolved -# field :ocns, type: Array -# -# embedded_in :cluster -# validates :deprecated, uniqueness: true -# validates_presence_of :deprecated, :resolved, :ocns -# index(ocns: 1) -# -# scope :for_cluster, lambda { |_cluster| -# where(:$in => ocns) -# } + # include Mongoid::Document + # + # # store_in collection: "resolutions", database: "test", client: "default" + # field :deprecated + # field :resolved + # field :ocns, type: Array + # + # embedded_in :cluster + # validates :deprecated, uniqueness: true + # validates_presence_of :deprecated, :resolved, :ocns + # index(ocns: 1) + # + # scope :for_cluster, lambda { |_cluster| + # where(:$in => ocns) + # } def ==(other) self.class == other.class && deprecated == other.deprecated && resolved == other.resolved diff --git a/spec/clusterable/holding_spec.rb b/spec/clusterable/holding_spec.rb index fed76bb0..d0d94818 100644 --- a/spec/clusterable/holding_spec.rb +++ b/spec/clusterable/holding_spec.rb @@ -61,24 +61,24 @@ end # can't just skip -- fields is not defined -# (described_class.fields.keys - ["date_received", "uuid", "_id"]).each do |attr| -# it "== is false if #{attr} doesn't match" do -# # ensure attribute in h2 is different from h but -# # of the same logical type -# -# case h[attr] -# when String -# h2[attr] = "#{h[attr]}junk" -# when Numeric -# h2[attr] = h[attr] + 1 -# when true, false, nil -# h2[attr] = !h[attr] -# end -# -# expect(h[attr]).not_to eq(h2[attr]) -# expect(h).not_to eq(h2) -# end -# end + # (described_class.fields.keys - ["date_received", "uuid", "_id"]).each do |attr| + # it "== is false if #{attr} doesn't match" do + # # ensure attribute in h2 is different from h but + # # of the same logical type + # + # case h[attr] + # when String + # h2[attr] = "#{h[attr]}junk" + # when Numeric + # h2[attr] = h[attr] + 1 + # when true, false, nil + # h2[attr] = !h[attr] + # end + # + # expect(h[attr]).not_to eq(h2[attr]) + # expect(h).not_to eq(h2) + # end + # end end describe "#same_as?" do diff --git a/spec/clustering/cluster_holding_spec.rb b/spec/clustering/cluster_holding_spec.rb index 5b11e9e8..b113d955 100644 --- a/spec/clustering/cluster_holding_spec.rb +++ b/spec/clustering/cluster_holding_spec.rb @@ -138,7 +138,6 @@ def new_submission(holding, date: Date.today) expect { described_class.new(h2).cluster }.to raise_exception(/same UUID/) end end - end describe "#delete" do diff --git a/spec/enum_chron_spec.rb b/spec/enum_chron_spec.rb index 0cb38f0b..be0048dd 100644 --- a/spec/enum_chron_spec.rb +++ b/spec/enum_chron_spec.rb @@ -4,12 +4,12 @@ require "enum_chron" class DummyRecord -# include Mongoid::Document -# include EnumChron -# field :enum_chron -# field :n_enum -# field :n_chron -# field :n_enum_chron + # include Mongoid::Document + # include EnumChron + # field :enum_chron + # field :n_enum + # field :n_chron + # field :n_enum_chron end RSpec.xdescribe EnumChron do