Skip to content

Commit

Permalink
standardrb fixes
Browse files Browse the repository at this point in the history
globally ignore "unreachable code" from the raise "not implemented"
stuff
  • Loading branch information
aelkiss committed Dec 19, 2024
1 parent 99b4021 commit e25f7eb
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- 'lib/**/*':
- Lint/UnreachableCode
30 changes: 15 additions & 15 deletions lib/clusterable/ocn_resolution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions spec/clusterable/holding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion spec/clustering/cluster_holding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/enum_chron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e25f7eb

Please sign in to comment.