<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Test Driven Websites (TDD and BDD in RoR and JS)</title>
	<atom:link href="http://testdrivenwebsites.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://testdrivenwebsites.com</link>
	<description>Test Driven and Behavior Driven Development in Java Script and Ruby on Rails</description>
	<lastBuildDate>Sat, 22 Oct 2011 12:50:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by Tuo &#187; Jasmine测试</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-54</link>
		<dc:creator><![CDATA[Tuo &#187; Jasmine测试]]></dc:creator>
		<pubDate>Sat, 22 Oct 2011 12:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-54</guid>
		<description><![CDATA[[...]  http://railscasts.com/episodes/261-testing-javascript-with-jasmine jasmine-jquery作者的博客:  http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/ SinonJS: Planning, Cheating and Faking Your Way Through JavaScript [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  http://railscasts.com/episodes/261-testing-javascript-with-jasmine jasmine-jquery作者的博客:  http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/ SinonJS: Planning, Cheating and Faking Your Way Through JavaScript [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by Testando seu código jQuery com Jasmine &#8211; Parte 2 &#124; Tableless</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-53</link>
		<dc:creator><![CDATA[Testando seu código jQuery com Jasmine &#8211; Parte 2 &#124; Tableless]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 14:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-53</guid>
		<description><![CDATA[[...] HTML fixtures in Jasmine (using jasmine-jquery) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] HTML fixtures in Jasmine (using jasmine-jquery) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Different ways of code reuse in RSpec by velesin</title>
		<link>http://testdrivenwebsites.com/2011/08/17/different-ways-of-code-reuse-in-rspec/#comment-51</link>
		<dc:creator><![CDATA[velesin]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 09:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=267#comment-51</guid>
		<description><![CDATA[@John

Hi! Thanks for your post ideas!

How Cucumber and Rspec tests are interwoven is explained in RSpec book (they show full BDD cycle starting with Cucumber test, then using this test for discovery of following, more low-level RSpec tests) but you&#039;re right that this is not fully clear (I&#039;ve also had some problems with grasping these ideas during the first read). RSpec book also omits JavaScript in this process. I think I may try to tackle this problem in one of my future posts.

As for the second idea, I&#039;ve planned a similar post about DRY tests (like this one) but for Cucumber (maybe even as my next post). I think that indeed it may be a good idea to include also a discussion about instance variables and maintaining state in this post.]]></description>
		<content:encoded><![CDATA[<p>@John</p>
<p>Hi! Thanks for your post ideas!</p>
<p>How Cucumber and Rspec tests are interwoven is explained in RSpec book (they show full BDD cycle starting with Cucumber test, then using this test for discovery of following, more low-level RSpec tests) but you&#8217;re right that this is not fully clear (I&#8217;ve also had some problems with grasping these ideas during the first read). RSpec book also omits JavaScript in this process. I think I may try to tackle this problem in one of my future posts.</p>
<p>As for the second idea, I&#8217;ve planned a similar post about DRY tests (like this one) but for Cucumber (maybe even as my next post). I think that indeed it may be a good idea to include also a discussion about instance variables and maintaining state in this post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Different ways of code reuse in RSpec by C. M. Hobbs (@nilmethod)</title>
		<link>http://testdrivenwebsites.com/2011/08/17/different-ways-of-code-reuse-in-rspec/#comment-50</link>
		<dc:creator><![CDATA[C. M. Hobbs (@nilmethod)]]></dc:creator>
		<pubDate>Sat, 27 Aug 2011 21:59:04 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=267#comment-50</guid>
		<description><![CDATA[Thanks for this post!  I&#039;ve been working through learning RSpec and this little writeup was really insightful.]]></description>
		<content:encoded><![CDATA[<p>Thanks for this post!  I&#8217;ve been working through learning RSpec and this little writeup was really insightful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Different ways of code reuse in RSpec by John G. Norman (@tuke)</title>
		<link>http://testdrivenwebsites.com/2011/08/17/different-ways-of-code-reuse-in-rspec/#comment-49</link>
		<dc:creator><![CDATA[John G. Norman (@tuke)]]></dc:creator>
		<pubDate>Fri, 26 Aug 2011 13:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=267#comment-49</guid>
		<description><![CDATA[HI. I&#039;ve been reading through your testing posts. I have a couple of suggestions for future articles:

(1) I find the BDD &quot;jump&quot; from Cucumber to RSpec (or Test::Unit) difficult conceptually. I think your examples may be clearer that in the RSpec book! Anyway, I think that&#039;s a great topic that is hard for people to get right.

(2) I have been noticing that there is a code smell around putting instance variables in Cucumber steps. Maybe it&#039;s OK for a top-level &quot;Given&quot; to instantiate an object under testing. Anyway, it&#039;s interesting to me that in tests using web_steps the &quot;state&quot; is maintained in the browser that is being exercised (so no state in an object is set up with &quot;new&quot;). I wonder if there is any advice on this topic? The RSpec book does have instance variables in steps, but it never really discusses them (indeed, the actual &quot;steps&quot; code examples aren&#039;t even finished in that book - there are just minimalist bits to illustrate issues).]]></description>
		<content:encoded><![CDATA[<p>HI. I&#8217;ve been reading through your testing posts. I have a couple of suggestions for future articles:</p>
<p>(1) I find the BDD &#8220;jump&#8221; from Cucumber to RSpec (or Test::Unit) difficult conceptually. I think your examples may be clearer that in the RSpec book! Anyway, I think that&#8217;s a great topic that is hard for people to get right.</p>
<p>(2) I have been noticing that there is a code smell around putting instance variables in Cucumber steps. Maybe it&#8217;s OK for a top-level &#8220;Given&#8221; to instantiate an object under testing. Anyway, it&#8217;s interesting to me that in tests using web_steps the &#8220;state&#8221; is maintained in the browser that is being exercised (so no state in an object is set up with &#8220;new&#8221;). I wonder if there is any advice on this topic? The RSpec book does have instance variables in steps, but it never really discusses them (indeed, the actual &#8220;steps&#8221; code examples aren&#8217;t even finished in that book &#8211; there are just minimalist bits to illustrate issues).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Different ways of code reuse in RSpec by Link dump for August 25th &#124; The Queue Incorporated</title>
		<link>http://testdrivenwebsites.com/2011/08/17/different-ways-of-code-reuse-in-rspec/#comment-48</link>
		<dc:creator><![CDATA[Link dump for August 25th &#124; The Queue Incorporated]]></dc:creator>
		<pubDate>Fri, 26 Aug 2011 04:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=267#comment-48</guid>
		<description><![CDATA[[...] Different ways of code reuse in RSpec &#171; Test Driven Websites (TDD and BDD in RoR and JS) &#8211; how to DRY out your specs [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Different ways of code reuse in RSpec &laquo; Test Driven Websites (TDD and BDD in RoR and JS) &#8211; how to DRY out your specs [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by velesin</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-47</link>
		<dc:creator><![CDATA[velesin]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 09:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-47</guid>
		<description><![CDATA[Another though:

Think also if it really must be verified in such a complex fashion. When you think deeper about it, you can identify two main parts of your code:
1. opening new window
2. manipulating DOM in a window

Maybe you could split the code in an OO fashion into two parts (window opener and DOM manipulator) that could be tested separately, in isolation?

First test would verify if your code can properly open new window and obtain a handle to some DOM element in this window (but the content of the element would be irrelevant at this point, so you wouldn&#039;t need fixtures).

Second test would verify if DOM is manipulated properly, assuming that new window is already opened and a handle to DOM element you want to manipulate is already obtained. With these assumptions, you could test DOM manipulation only (what can be done in the same window your tests run in - and thus can use jasmine-jquery fixtures to the full extent).

Such approach (if it is possible for you) would not only make tests much simpler and easier to run, but probably also improve the design of your SUT by facilitating decoupling.]]></description>
		<content:encoded><![CDATA[<p>Another though:</p>
<p>Think also if it really must be verified in such a complex fashion. When you think deeper about it, you can identify two main parts of your code:<br />
1. opening new window<br />
2. manipulating DOM in a window</p>
<p>Maybe you could split the code in an OO fashion into two parts (window opener and DOM manipulator) that could be tested separately, in isolation?</p>
<p>First test would verify if your code can properly open new window and obtain a handle to some DOM element in this window (but the content of the element would be irrelevant at this point, so you wouldn&#8217;t need fixtures).</p>
<p>Second test would verify if DOM is manipulated properly, assuming that new window is already opened and a handle to DOM element you want to manipulate is already obtained. With these assumptions, you could test DOM manipulation only (what can be done in the same window your tests run in &#8211; and thus can use jasmine-jquery fixtures to the full extent).</p>
<p>Such approach (if it is possible for you) would not only make tests much simpler and easier to run, but probably also improve the design of your SUT by facilitating decoupling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by velesin</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-46</link>
		<dc:creator><![CDATA[velesin]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 09:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-46</guid>
		<description><![CDATA[By default this is not supported, I think Jasmine was designed to be run inside a single window and didn&#039;t even considered such edge case. However, I think it should be possible to do it manually with a little bit of &quot;hacking&quot;.

I&#039;m thinking about following scenario:

Your JS code runs in window A. It opens window B in order to manipulate its content in some way. In order to be able to manipulate content of window B, code in window A must keep a handle to window B somewhere.

So I wonder if it couldn&#039;t be tested like this:
1. you have a window A with your System Under Test and your Jasmine suite.
2. in one of your specs your SUT tries to open window B
3. your Jasmine code intercept this somehow (e.g. by mocking a method opening window B etc.), obtains a handle to window B, and manipulates the content of window B by injecting a HTML snippet into its DOM (loaded from fixture). In such case loadFixtures method will not work, because it expects to be run in the current window, but I think it may be possible to get fixture&#039;s content by invoking getFixtures and then inject this content into DOM of the window B (this is the &quot;manual hack&quot; part I wrote of earlier)
4. Jasmine lets the rest of your SUT&#039;s code to run (and to do something with window B DOM)
5. Jasmine again uses window B handle (stored earlier) to access window B DOM, and invokes some matchers on window B content.

You need also to remember, that opening window B will be async, so you need to use Jasmine&#039;s async facilities in order to maintain proper open-inject-modify-verify order of your test execution.

PS: this is only a raw idea, it is by no means verified, but I think that with some experimentation there is a chance similar solution may work.]]></description>
		<content:encoded><![CDATA[<p>By default this is not supported, I think Jasmine was designed to be run inside a single window and didn&#8217;t even considered such edge case. However, I think it should be possible to do it manually with a little bit of &#8220;hacking&#8221;.</p>
<p>I&#8217;m thinking about following scenario:</p>
<p>Your JS code runs in window A. It opens window B in order to manipulate its content in some way. In order to be able to manipulate content of window B, code in window A must keep a handle to window B somewhere.</p>
<p>So I wonder if it couldn&#8217;t be tested like this:<br />
1. you have a window A with your System Under Test and your Jasmine suite.<br />
2. in one of your specs your SUT tries to open window B<br />
3. your Jasmine code intercept this somehow (e.g. by mocking a method opening window B etc.), obtains a handle to window B, and manipulates the content of window B by injecting a HTML snippet into its DOM (loaded from fixture). In such case loadFixtures method will not work, because it expects to be run in the current window, but I think it may be possible to get fixture&#8217;s content by invoking getFixtures and then inject this content into DOM of the window B (this is the &#8220;manual hack&#8221; part I wrote of earlier)<br />
4. Jasmine lets the rest of your SUT&#8217;s code to run (and to do something with window B DOM)<br />
5. Jasmine again uses window B handle (stored earlier) to access window B DOM, and invokes some matchers on window B content.</p>
<p>You need also to remember, that opening window B will be async, so you need to use Jasmine&#8217;s async facilities in order to maintain proper open-inject-modify-verify order of your test execution.</p>
<p>PS: this is only a raw idea, it is by no means verified, but I think that with some experimentation there is a chance similar solution may work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by Diego Caliri (@dcaliri)</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-45</link>
		<dc:creator><![CDATA[Diego Caliri (@dcaliri)]]></dc:creator>
		<pubDate>Wed, 24 Aug 2011 15:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-45</guid>
		<description><![CDATA[Heyas, Is there any way of loading 2 fixtures and set 1 as the opener of the second?

Example:

window_1 opens window_2 by clicking a link (not important to test) but then some interactions with JS happends in window_2 and the JS code finishes by making some changes on window_1 by calling sometime at the end opener.$(&#039;#my-selector-on-window_1&#039;).append(&#039;bla bla bla&#039;);

My problem is how to tell jasmine the relationship as window-opener between window_1 and window_2

Ideas?]]></description>
		<content:encoded><![CDATA[<p>Heyas, Is there any way of loading 2 fixtures and set 1 as the opener of the second?</p>
<p>Example:</p>
<p>window_1 opens window_2 by clicking a link (not important to test) but then some interactions with JS happends in window_2 and the JS code finishes by making some changes on window_1 by calling sometime at the end opener.$(&#8216;#my-selector-on-window_1&#8242;).append(&#8216;bla bla bla&#8217;);</p>
<p>My problem is how to tell jasmine the relationship as window-opener between window_1 and window_2</p>
<p>Ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on HTML fixtures in Jasmine (using jasmine-jquery) by Bert Bruynooghe</title>
		<link>http://testdrivenwebsites.com/2010/07/29/html-fixtures-in-jasmine-using-jasmine-jquery/#comment-43</link>
		<dc:creator><![CDATA[Bert Bruynooghe]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 14:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://testdrivenwebsites.com/?p=191#comment-43</guid>
		<description><![CDATA[Nevermind, I was assuming that the fixtures got loaded relatively to the testRunner&#039;s location. I found out I had to use jasmine.getFixtures().fixturesPath...]]></description>
		<content:encoded><![CDATA[<p>Nevermind, I was assuming that the fixtures got loaded relatively to the testRunner&#8217;s location. I found out I had to use jasmine.getFixtures().fixturesPath&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
