Contributing to documentation

22 views
Skip to first unread message

James Doyley

unread,
Sep 25, 2015, 10:20:58 AM9/25/15
to rspec
Hi,

I was looking at the docs, specifically

I agree that it's a design smell, but I want to suggest an example.  I couldn't find out how to contribute to the documentation hence posting here.

I was just thinking a better example as an alternative would be

RSpec.describe User, type: :model do
  subject(:user){ User.new }
 
before(:each) do
    allow(user).to receive(:foo).and_return("bar")
 
end


Myron Marston

unread,
Sep 25, 2015, 10:23:45 AM9/25/15
to rs...@googlegroups.com

The relish docs are kept under source in the repository for each gem under the features directory. The ones you mentioned are here:

Please submit suggested doc changes as a PR to the repo.

Thanks,
Myron


--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/a725b287-f0ac-4315-83ca-c4ab9c03ba05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Fleetwood-Boldt

unread,
Sep 26, 2015, 10:13:07 AM9/26/15
to rs...@googlegroups.com
One thing I've never understood about rspec, and specifically the warning against using allow any instance of, is how to test code that creates objects that you will want to stub.

Since the objects are not created in rspec (but instead inside the tested code), I can't stub them, so I often have to either use allow_any_instance_of or stub out the new method on the class to return doubles.

I understand why allow_any_instance_of is code-smelly but I've never really seen a good approach to this. 






For more options, visit https://groups.google.com/d/optout.

Myron Marston

unread,
Sep 26, 2015, 10:19:50 AM9/26/15
to rs...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages