[rspec-users] shared_example can't have the same name even if defined it different specs

drewB dbatshaw at gmail.com
Thu Mar 18 17:18:50 EDT 2010


I am writing some specs related to permissions for different kinds of
users.  Every user has some common examples to test in many different
specs.  For example, all users can view, and edit their profile.
Also, all users can view their own "history."  So I have two spec
files, say profile_controller_spec and history_controller_spec.

They might look like http://gist.github.com/336898

Using these files RSpec will give an error that 'User' is already
registered as a shared group, even though they are defined in separate
files and example groups.

Is it suppose to behave that way?  Seems like a hassle to have to
prepend the controller name to each shared_example_for.


More information about the rspec-users mailing list