You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just by looking at the cmpimplementation and tests I couldn't understand, is this the designed behaviour, or the behaviour is undefined?
Semantically, it would make sense to load rspec/mocks.rb first, and then rspec/mocks/any_instance.rb, not the other way around.
Some discussion in rspec-rails regarding the issues it may cause. rspec-rails PR to change the helper template to use Pathname#glob instead of Dir.[].
A workaround rspec-rails plans to take is to sort_by(&:to_s) to get back to the string representation-like ordering.
There's an ordering difference when using the built-in
<=>
vs the string representation one:And the latter corresponds to the classic alternative:
Just by looking at the
cmp
implementation and tests I couldn't understand, is this the designed behaviour, or the behaviour is undefined?Semantically, it would make sense to load
rspec/mocks.rb
first, and thenrspec/mocks/any_instance.rb
, not the other way around.Some discussion in rspec-rails regarding the issues it may cause.
rspec-rails PR to change the helper template to use
Pathname#glob
instead ofDir.[]
.A workaround rspec-rails plans to take is to
sort_by(&:to_s)
to get back to the string representation-like ordering.(semi-)Related cops:
The text was updated successfully, but these errors were encountered: