My Rails 7, Ruby 3.1 App has a simple test that is failing. I am not understanding why.
In my App I have added a support directory labelled stuff, which has some GraphQL code in it. So in my tests, I want to do a GraphQL.test(foo: "me", bar: "you").
app/stuff/graphql.rb
In my inflections.rb initializer, I teach the Inflection I want.
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'GraphQL'
end
In my application.rb, I tell Zeitwerk that I have stuff to work with, and the rake task zeitwerk:check says everything is good.
The graphql.rb has a simple test function:
module GraphQL
def self.test(foo:, bar:)
puts "We got a #{foo} and a #{bar}"
end
end
But my tests run, and when testing out this code, the test fails on GraphQL not having a test method.
I am confused by the autoloading and eager loading, and why my tests seem unable to follow the simple setup here.