Skip to content

Commit

Permalink
Don't actually set config for ID equality.
Browse files Browse the repository at this point in the history
This makes the coverage always work. Thanks to @dgcliff
  • Loading branch information
tpendragon committed Jan 9, 2020
1 parent 1a6d62a commit 7dea70f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions lib/valkyrie/id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ def default_equality(other)
output = (other.class == self.class && other.state == state)
return output if output == true
if output == false && string_equality(other) && Valkyrie.config.id_string_equality.nil?
# :nocov:
warn "[DEPRECATION] Valkyrie::IDs will always be equal to their string counterparts in 3.0.0. " \
"To silence this message, please either compare IDs or set Valkyrie.config.id_string_equality = true."
# :nocov:
end
false
end
Expand Down
2 changes: 1 addition & 1 deletion spec/valkyrie/types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Resource < Valkyrie::Resource
end

it "doesn't echo a deprecated message if configured" do
Valkyrie.config.id_string_equality = false
allow(Valkyrie.config).to receive(:id_string_equality).and_return(false)
expect do
expect(resource.thumbnail_id).not_to eq '123'
end.not_to output(message).to_stderr
Expand Down

0 comments on commit 7dea70f

Please sign in to comment.