[rspec-devel] Solution for 'Shared examples not reloading in spec_server'

Charles Grindel cgrindel at yahoo.com
Fri Feb 8 14:30:56 EST 2008

I posted this in the users mailing list yesterday.  I investigated a bit more and found what I believe is the problem.  The location below provides the code and a brief explanation of what I found.  Note, I am running my tests in spec_server.


The add_shared_example_group method in SharedExampleGroup calls the guard_against_redefining_existing_example_group method expecting it to raise an error if it should not proceed with the add of the new example group. When I would change a file that contained shared example groups, the guard method never raised an error and the redefined example groups were added to the end of the  list.  However, when a shared example group is included in another example group, the find method that looks for the shared example group starts looking from the beginning of the list and would always find the original version of the example.

Since I want the new version of the example group to replace the old version, I changed the guard_against_redefining_existing_example_group method to remove any existing example group from the list if they have the same  description.

Is there a reason why we wouldn't want to replace shared example groups if they are already defined?


----- Forwarded Message ----
From: Charles Grindel <cgrindel at yahoo.com>
To: rspec-users at rubyforge.org
Sent: Thursday, February 7, 2008 10:39:15 AM
Subject: Shared examples not reloading in spec_server

I am currently running RSpec 1.1.3 with ZenTest 3.9.1 on Windows XP.  I have noticed that shared examples are not being reloaded by spec_server when they have been updated.  Below is a simple example that reproduces the problem.  The example code and output is at the location below.
I have confirmed that non-shared examples are being reloaded by spec_server.  So, here are my questions.
1. Has anyone else noticed this behavior?
2. Does anyone know how I can force spec_server to reload the shared examples?
3. If this smells like a bug, can someone point me to instructions for filing a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20080208/08e5b093/attachment-0001.html 

More information about the rspec-devel mailing list