<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/ruby/tags/testing</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 03:11:04 GMT</pubDate>
<item>
<title>(Ruby) Watchr config for use with PHPUnit - noah</title>
<link>http://snipplr.com/view/51383/watchr-config-for-use-with-phpunit/</link>
<description><![CDATA[ <p>A simple [Watchr](https://github.com/mynyml/watchr) config for running PHPUnit tests.

This will run a [Pake](https://github.com/indeyets/pake/wiki) task called "test" and ring the system bell if the task fails.  *Ringing the system bell* is especially nice when running inside a GNU Screen session.

*Installation*

To install you need [RubyGems](http://rubyforge.org).  Then type:

        sudo gem install watchr</p> ]]></description>
<pubDate>Thu, 31 Mar 2011 14:28:22 GMT</pubDate>
<guid>http://snipplr.com/view/51383/watchr-config-for-use-with-phpunit/</guid>
</item>
<item>
<title>(Ruby) analysis of Hudson JUNit logfiles - noah</title>
<link>http://snipplr.com/view/44499/analysis-of-hudson-junit-logfiles/</link>
<description><![CDATA[ <p>assuming you are standing in`$HUDSON_HOME/jobs/job_foo/builds/123`</p> ]]></description>
<pubDate>Sat, 20 Nov 2010 17:15:44 GMT</pubDate>
<guid>http://snipplr.com/view/44499/analysis-of-hudson-junit-logfiles/</guid>
</item>
<item>
<title>(Ruby) Howto set up a Rake task to start and stop the Selenium-RC server - noah</title>
<link>http://snipplr.com/view/27992/howto-set-up-a-rake-task-to-start-and-stop-the-seleniumrc-server/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 08 Feb 2010 23:01:08 GMT</pubDate>
<guid>http://snipplr.com/view/27992/howto-set-up-a-rake-task-to-start-and-stop-the-seleniumrc-server/</guid>
</item>
<item>
<title>(Ruby) Howto set up a Rake task to run Cucumber features and generate reports - noah</title>
<link>http://snipplr.com/view/27990/howto-set-up-a-rake-task-to-run-cucumber-features-and-generate-reports/</link>
<description><![CDATA[ <p>Note that Rake is slower than just running `cucumber`</p> ]]></description>
<pubDate>Mon, 08 Feb 2010 22:41:45 GMT</pubDate>
<guid>http://snipplr.com/view/27990/howto-set-up-a-rake-task-to-run-cucumber-features-and-generate-reports/</guid>
</item>
<item>
<title>(Ruby) Howto set up a Rake task to run RSpec spec docs - noah</title>
<link>http://snipplr.com/view/27985/howto-set-up-a-rake-task-to-run-rspec-spec-docs/</link>
<description><![CDATA[ <p>A `rake :spec` task, is created by default just from including the RSpec rake module.

The way to *stop RSpec tasks from failing* the entire Rake job when a test barfs, is by setting `fail_on_error` to false.</p> ]]></description>
<pubDate>Mon, 08 Feb 2010 21:23:31 GMT</pubDate>
<guid>http://snipplr.com/view/27985/howto-set-up-a-rake-task-to-run-rspec-spec-docs/</guid>
</item>
<item>
<title>(Ruby) How to call JavaScript in the Application Under Test, from Selenium - noah</title>
<link>http://snipplr.com/view/19872/how-to-call-javascript-in-the-application-under-test-from-selenium/</link>
<description><![CDATA[ <p>When writing functional tests with Selenium, it is often convenient to call JavaScript functions and methods, that are part of the Web application you are testing.  After all, Selenium is a functional testing framework for Web UI and most of the exciting bits of Web UI are JS (sorry, all you CSS hackers, but them's the facts). 

The problem is that it's not immediately obvious how you can access the DOM of the Application Under Test (AUT).  Selenium Core (in which all Selenium tests execute) is a frame set, and if you simply try to call your JavaScript with `getEval`, you'll get an error because `getEval` references Selenium Core's DOM, not the DOM of the AUT.

Fortunately the answer is simple.  Use `this.browserbot.getCurrentWindow()` to get a reference to the `window` object in *your* DOM.  Then you can execute any of the JS that lives in your page, right from Selenium!

This example uses the Ruby driver, but the principle is the same regardless of which language you use.</p> ]]></description>
<pubDate>Thu, 17 Sep 2009 13:14:43 GMT</pubDate>
<guid>http://snipplr.com/view/19872/how-to-call-javascript-in-the-application-under-test-from-selenium/</guid>
</item>
<item>
<title>(Ruby) factory girl example - jnunemaker</title>
<link>http://snipplr.com/view/9350/factory-girl-example/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 28 Oct 2008 23:58:50 GMT</pubDate>
<guid>http://snipplr.com/view/9350/factory-girl-example/</guid>
</item>
<item>
<title>(Ruby) make Ruby strings behave like files - cczona</title>
<link>http://snipplr.com/view/5417/make-ruby-strings-behave-like-files/</link>
<description><![CDATA[ <p>This is handy for testing, when you need to simulate an open file or open URI.  Why, and the Pickaxe book, have better examples</p> ]]></description>
<pubDate>Thu, 13 Mar 2008 18:38:19 GMT</pubDate>
<guid>http://snipplr.com/view/5417/make-ruby-strings-behave-like-files/</guid>
</item>
<item>
<title>(Ruby) Verifier objects - pmccann</title>
<link>http://snipplr.com/view/2631/verifier-objects/</link>
<description><![CDATA[ <p>Niiice... (stolen from linked site via planetrubyonrails.com)</p> ]]></description>
<pubDate>Sat, 12 May 2007 16:39:41 GMT</pubDate>
<guid>http://snipplr.com/view/2631/verifier-objects/</guid>
</item>
<item>
<title>(Ruby) fixture_file_upload Example - tjstankus</title>
<link>http://snipplr.com/view/1716/fixturefileupload-example/</link>
<description><![CDATA[ <p>fixture_file_upload is another nifty Rails testing feature. It allows you to create "MIME-encoded content that would normally be uploaded by a browser input field." (Part in quotes straight from Agile Web Development with Rails, v2). Put your files to test in test/fixtures/files. You have to create the 'files' directory; rails doesn't do it for you.</p> ]]></description>
<pubDate>Sun, 26 Nov 2006 03:24:28 GMT</pubDate>
<guid>http://snipplr.com/view/1716/fixturefileupload-example/</guid>
</item>
<item>
<title>(Ruby) ARTestHelper - Catfish</title>
<link>http://snipplr.com/view/1099/artesthelper/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 20 Sep 2006 03:42:34 GMT</pubDate>
<guid>http://snipplr.com/view/1099/artesthelper/</guid>
</item>
<item>
<title>(Ruby) Test for required attributes - tjstankus</title>
<link>http://snipplr.com/view/291/test-for-required-attributes/</link>
<description><![CDATA[ <p>A fairly DRY way to test for required attributes of a model. It's sort of an alternative to fixtures. It breaks the one-assertion-per-test rule that some people favor. Drop in your unit test and edit as necessary.

A better (yet not quite perfect) approach:
http://johnwilger.com/articles/2005/12/07/a-bit-of-dryness-for-unit-tests-in-rails</p> ]]></description>
<pubDate>Sat, 08 Jul 2006 20:17:13 GMT</pubDate>
<guid>http://snipplr.com/view/291/test-for-required-attributes/</guid>
</item>
</channel>
</rss>