Add :nocov: to pass simplecov for rubyversion conditional methods
This commit is contained in:
Родитель
40b65357b4
Коммит
464edc8df3
|
@ -160,6 +160,7 @@ module Entitlements
|
|||
# Takes no arguments.
|
||||
#
|
||||
# Returns a Hash.
|
||||
# :nocov:
|
||||
Contract C::None => C::HashOf[String => C::Any]
|
||||
def parsed_data
|
||||
@parsed_data ||= if Entitlements.ruby_version2?
|
||||
|
@ -168,6 +169,7 @@ module Entitlements
|
|||
::YAML.load(File.read(filename), permitted_classes: [Date]).to_h
|
||||
end
|
||||
end
|
||||
# :nocov:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -77,11 +77,14 @@ module Entitlements
|
|||
def read(uid = nil)
|
||||
@people ||= begin
|
||||
Entitlements.logger.debug "Loading people from #{filename.inspect}"
|
||||
|
||||
# :nocov:
|
||||
raw_person_data = if Entitlements.ruby_version2?
|
||||
::YAML.load(File.read(filename)).to_h
|
||||
else
|
||||
::YAML.load(File.read(filename), permitted_classes: [Date]).to_h
|
||||
end
|
||||
# :nocov:
|
||||
|
||||
raw_person_data.map do |id, data|
|
||||
[id, Entitlements::Models::Person.new(uid: id, attributes: data)]
|
||||
|
|
|
@ -32,11 +32,13 @@ module Entitlements
|
|||
raise Errno::ENOENT, "The `manager_map_file` #{manager_map_file} does not exist!"
|
||||
end
|
||||
|
||||
# :nocov:
|
||||
if Entitlements.ruby_version2?
|
||||
::YAML.load(File.read(manager_map_file)).to_h
|
||||
else
|
||||
::YAML.load(File.read(manager_map_file), permitted_classes: [Date]).to_h
|
||||
end
|
||||
# :nocov:
|
||||
end
|
||||
|
||||
u = person.uid.downcase
|
||||
|
|
Загрузка…
Ссылка в новой задаче