ee/spec/lib/gitlab/geo/oauth_session_spec.rb test doesn't actually do anything

While upgrading to Ruby 2.4.4, I came across a warning in this spec: https://gitlab.com/gitlab-org/gitlab-ee/blob/1189ecfc756cccc0e0c88c4d9d45d1a867ed0e76/ee/spec/lib/gitlab/geo/oauth_session_spec.rb#L130-137

WARNING: Using the raise_error matcher without providing a specific error or message risks false positives, since raise_error will match when Ruby raises a NoMethodError, NameError or ArgumentError, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<RSpec::Mocks::MockExpectationError: #<Double (anonymous)> received unexpected message :parsed with (no args)>. Instead consider providing a specific error class or message. This message can be suppressed by setting: RSpec::Expectations.configuration.on_potential_false_positives = :nothing. Called from /Users/stanhu/gitlab/gdk-ee/gitlab/ee/spec/lib/gitlab/geo/oauth_session_spec.rb:134:in `block (4 levels) in <top (required)>'.

This doesn't actually do anything because the raise_error is matching a NoMethodError raised by the Response#parsed double.

/cc: @brodock

Edited May 21, 2018 by Stan Hu
Assignee Loading
Time tracking Loading