In a Rspec test, I'm creating and extending the "Queryable" class:
let(:queryable) do
class Queryable
include FeatureQuery
end.new
end
that class doesn't exist in the app, but the FeatureQuery modules does. This code works well, but it feels ugly and hacky: is there a way to do it using a rspec double?
I'm not sure if this counts as "less ugly and hacky", but you can create an anonymous class to bypass giving this test class a name:
A couple of other options you could consider are:
FeatureQuery.FeatureQuerymodule directly, rather than some class it gets included into.