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
{{ message }}
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
bundle exec rspec spec/example_spec.rb
Example
is expected to receive some_method([0, 1, 2, 3, 4, 5]) 1 time
Finished in 0.00696 seconds (files took 0.52326 seconds to load)
1 example, 0 failures
Actual behavior
bundle exec rspec spec/example_spec.rb
Example
is expected to receive some_method (FAILED - 1)
Failures:
1) Example is expected to receive some_method
Failure/Error: expect(some_object).to receive(:some_method).with(args)
ArgumentError:
Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations.
# ./spec/example_spec.rb:6:in `block (2 levels) in <top (required)>'
Finished in 0.00769 seconds (files took 0.54186 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/example_spec.rb:5 # Example is expected to receive some_method
The text was updated successfully, but these errors were encountered:
bestwebua
changed the title
ArgumentError: Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations
ArgumentError: Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations for boolean objects
Dec 30, 2020
This is a deliberate bug fix for rspec-mocks (not rspec-expectations, theres no stubbing here) that was released (rspec/rspec-mocks#1357), because we cannot modify frozen objects to proxy them, you would normally get a cryptic TypeError which we prevent by raising an ArgumentError before it can happen.
Subject of the issue
Stub for boolean object raises
ArgumentError: Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations
.Your environment
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: