Skip to content

Commit

Permalink
Fix uninitialized constant RSpec::Rails::OpenStruct error
Browse files Browse the repository at this point in the history
This started to occur on recent test suite runs. It may be related to a json gem update that removed the ostruct dependency as I encountered this with turbo_tests and a fix for that is in serpapi/turbo_tests#49 with more details.
  • Loading branch information
javierjulio authored Apr 8, 2024
1 parent 967a54d commit 9631355
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/rspec/rails/example/view_example_group_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'ostruct'
require 'support/group_failure_formatter'

module RSpec::Rails
Expand Down Expand Up @@ -187,7 +188,7 @@ def _default_file_to_render; end # Stub method
Class.new do
include ViewExampleGroup::ExampleMethods
def controller
@controller ||= OpenStruct.new(params: nil)
@controller ||= ::OpenStruct.new(params: nil)
end
end.new
end
Expand Down

0 comments on commit 9631355

Please sign in to comment.