Skip to content

Commit

Permalink
Add reject stub for credentials testing
Browse files Browse the repository at this point in the history
Upstream in `fog-core` the method was inverted to use `select` rather
than a negated reject for Rubocop style rules. That caused this spec to
fail as only `reject` was stubbed.

This stubs `select` as well so this should work for both versions, older
versions of `fog-core` and newer ones.
  • Loading branch information
tokengeek committed Dec 10, 2024
1 parent 195c6e9 commit 0763d3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/fog/compute/brightbox_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
}

@credential_guard = Minitest::Mock.new
# Stub for older versions of fog-core
def @credential_guard.reject
{}
end

# Stub for newer versions of fog-core
def @credential_guard.select
{}
end

Fog.stub :credentials, @credential_guard do
@service = Fog::Brightbox::Compute.new(@arguments)
end
Expand Down

0 comments on commit 0763d3d

Please sign in to comment.