<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:verdana, helvetica, sans-serif;font-size:10pt"><DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">I posted this in the users mailing list yesterday.&nbsp; I investigated a bit more and found what I believe is the problem.&nbsp; The location below provides the code and a brief explanation of what I found.&nbsp; Note, I am running my tests in spec_server.</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif"><A href="http://pastie.caboo.se/149398">http://pastie.caboo.se/149398</A><BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">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&nbsp; list.&nbsp; 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.</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">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&nbsp; description.<BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">Is there a reason why we wouldn't want to replace shared example groups if they are already defined?</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">Thanks,</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">Chuck<BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif"><BR>&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Forwarded Message ----<BR>From: Charles Grindel &lt;cgrindel@yahoo.com&gt;<BR>To: rspec-users@rubyforge.org<BR>Sent: Thursday, February 7, 2008 10:39:15 AM<BR>Subject: Shared examples not reloading in spec_server<BR><BR>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif">
<DIV>I am currently running RSpec 1.1.3 with ZenTest 3.9.1 on Windows XP.&nbsp; I have noticed that shared examples are not being reloaded by spec_server when they have been updated.&nbsp; Below is a simple example that reproduces the problem.&nbsp; The example code and output is at the location below.</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><A href="http://pastie.caboo.se/148688" target=_blank rel=nofollow>http://pastie.caboo.se/148688</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>I have confirmed that non-shared examples are being reloaded by spec_server.&nbsp; So,&nbsp;here are my questions.</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. Has anyone else noticed this behavior?</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. Does anyone know how I can force spec_server to reload the shared examples?</DIV>
<DIV>&nbsp;</DIV>
<DIV>3. If this smells like a bug, can someone point me to instructions for filing a bug?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Chuck</DIV></DIV>
<DIV>&nbsp;</DIV></DIV></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif"><BR></DIV></div></body></html>