Skip to content

Commit

Permalink
Require ostruct to fix test failure
Browse files Browse the repository at this point in the history
This resolves the following OpenStruct error. There is only 1 reference to OpenStruct in this file, no other references in the code base.

```
NameError:
uninitialized constant RSpec::Rails::OpenStruct
# ./spec/rspec/rails/example/view_example_group_spec.rb:190:in `controller'
# ./spec/rspec/rails/example/view_example_group_spec.rb:196:in `block (3 levels) in <module:Rails>'
# /home/runner/work/rspec-rails/rspec-core/lib/rspec/core/example.rb:263:in `instance_exec'
```

This could be caused by a recent gem update like `json` as I encountered this with serpapi/turbo_tests#49 as I use turbo_tests to run my rspec test suite.
  • Loading branch information
javierjulio authored and JonRowe committed Apr 10, 2024
1 parent 13958cc commit 883d87a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 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

0 comments on commit 883d87a

Please sign in to comment.