<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog &#187; loris</title>
	<atom:link href="http://monket.net/blog/tag/loris/feed/" rel="self" type="application/rss+xml" />
	<link>http://monket.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 12 Apr 2010 13:11:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Small Update to Loris (0.1.3)</title>
		<link>http://monket.net/blog/2010/04/small-update-to-loris-0-1-3/</link>
		<comments>http://monket.net/blog/2010/04/small-update-to-loris-0-1-3/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 13:11:21 +0000</pubDate>
		<dc:creator>Karl O&#39;Keeffe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js test driver]]></category>
		<category><![CDATA[loris]]></category>

		<guid isPermaLink="false">http://monket.net/blog/?p=300</guid>
		<description><![CDATA[A few months ago I wrote about Loris, a small tool that will automatically run your javascript tests whenever a file changes. I&#8217;ve just released a new version of the Loris gem with a couple of minor fixes: The dependency on win32-process has now been removed from the gem. This means the gem now installs [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago <a href="http://monket.net/blog/2009/11/loris-autotest-for-javascript/">I wrote about Loris</a>, a small tool that will automatically run your javascript tests whenever a file changes.</p>

<p>I&#8217;ve just released a new version of the <a href="http://rubygems.org/gems/loris">Loris gem</a> with a couple of minor fixes:</p>

<ul>
<li><p>The dependency on <code>win32-process</code> has now been removed from the gem. This means the gem now installs correctly on OSX. Windows users will manually need to install the <code>win32-process</code> gem.</p></li>
<li><p>The dependancy on <code>visionmedia-bind</code> has been updated to just <code>bind</code>, reflecting the gems new name on RubyGems.</p></li>
<li><p>The JS Test Driver server is now reset between all tests. This stops it getting into a situation where it failed to pick up changes to files.</p></li>
</ul>

<p>Because <a href="http://rubygems.org/">RubyGems</a> is now the default gem host, this install process is a little simpler.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> loris</pre></div></div>


<p>or on Windows</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> loris
gem <span style="color: #c20cb9; font-weight: bold;">install</span> win32-process</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://monket.net/blog/2010/04/small-update-to-loris-0-1-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loris: Autotest for Javascript</title>
		<link>http://monket.net/blog/2009/11/loris-autotest-for-javascript/</link>
		<comments>http://monket.net/blog/2009/11/loris-autotest-for-javascript/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 14:26:54 +0000</pubDate>
		<dc:creator>Karl O&#39;Keeffe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript lint]]></category>
		<category><![CDATA[js test driver]]></category>
		<category><![CDATA[jspec]]></category>
		<category><![CDATA[loris]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://monket.net/blog/?p=261</guid>
		<description><![CDATA[I&#8217;ve previously written a number of posts on javascript and autotest. Explaining how to integrate javascript lint, unit tests, and growl with the ruby Autotest project. While this all worked, it felt a little clunky as Autotest doesn&#8217;t natively support the idea of running multiple tasks one after the other. Rather than hack at the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://monket.net/blog/tag/autotest/">previously written a number of posts on javascript and autotest</a>. Explaining how to integrate javascript lint, unit tests, and growl with the ruby <a href="http://ph7spot.com/articles/getting_started_with_autotest">Autotest</a> project.</p>

<p>While this all worked, it felt a little clunky as Autotest doesn&#8217;t natively support the idea of running multiple tasks one after the other. Rather than hack at the Autotest codebase, I thought I&#8217;d get some ruby experience by rolling my own autotest-style framework. Not great for reuse of code, but a great way for me to learn :)</p>

<h2>Loris</h2>

<p>Loris will monitor your project and run <a href="http://www.javascriptlint.com/">Javascript Lint</a> and <a href="http://code.google.com/p/js-test-driver/">JS Test Driver</a> whenever a file changes, it will report the results to the command line and using <a href="http://growl.info/">Growl</a>. If required, Loris will automatically start the JS Test Driver server and register your default browser with it.</p>

<h3>Installing</h3>

<p>Loris is hosted on <a href="http://gemcutter.org/">Gemcutter</a>, so you need to install their gem if you haven&#8217;t already.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem update <span style="color: #660033;">--system</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> gemcutter
gem tumble</pre></div></div>


<p>Then to install Loris, just run the following:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> loris</pre></div></div>


<p>Loris has no command line options, and no configuration file (at the moment). It looks for configurations files to decide which tasks to run.</p>

<h3>Configuring Javascript Lint</h3>

<p>To enable Javascript Lint, create a <code>jsl.conf</code> file in the folder where you run Loris. This should be a standard Javascript Lint config file. If you need here is an <a href="http://mike.kruckenberg.com/archives/2009/03/configuration-options-for-javascript-lint.html">example Javascript Lint config file</a></p>

<p>You just need to specify which files Javascipt Lint should process. For example:</p>


<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">### Files
# Specify which files to lint
# Use &quot;+recurse&quot; to enable recursion (disabled by default).
# To add a set of files, use &quot;+process FileName&quot;, &quot;+process Folder\Path\*.js&quot;,
# or &quot;+process Folder\Path\*.htm&quot;.
#
+process src/js/*.js
+process tests/js/*.js</pre></div></div>


<p>If no <code>jsl.conf</code> file is found, the Javascript Lint task is silently skipped.</p>

<h3>Configuring JS Test Driver</h3>

<p>To enable JS Test Driver, create a <code>jsTestDriver.conf</code> file in the folder where you run Loris. This should be a standard <a href="http://code.google.com/p/js-test-driver/wiki/ConfigurationFile">JS Test Driver config file</a>.</p>

<p>This should specify which files JS Test Driver should process, and how it connects to the JS Test Driver server. For example:</p>


<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">server: http://localhost:9876
&nbsp;
load:
  - tests/qunit/equiv.js
  - tests/qunit/QUnitAdapter.js
&nbsp;
  - src/js/*.js
  - tests/js/*.js</pre></div></div>


<p>If no <code>jsTestDriver.conf</code> file is found, the JS Test Driver task is silently skipped.</p>

<p>To make it really simple to run JS Test Driver tests, if the server is set to run on <code>localhost</code>, and Loris doesn&#8217;t detect one running, it will automatically start one, and register your default browser with it.</p>

<p>This makes it a one step process to get automated tests up and running.</p>

<h3>Running</h3>

<p>To run, open a command line window, navigate to the root folder of your project, and run:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">loris</pre></div></div>


<p>Loris will run Javascript Lint, and JS Test Driver tasks (if it finds their configuration files), and will output the results on the command line.</p>

<h4>Example output</h4>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Javascript Lint
success
All files are clean
&nbsp;
0 error(s), 0 warning(s)
JS Test Driver
success
All tests pass
[PASSED] GreeterTest.testGreet
  [LOG] JsTestDriver Hello World!
[PASSED] GreeterTest.testGoodbye
[PASSED] GreeterTest.testSetName
[PASSED] GreeterTest.testSetNameAndNameParamter
[PASSED] Asserts.test OK true succeeds
[PASSED] Asserts.test Equals succeeds
  [LOG] about to call assertEquals
[PASSED] Asserts.test Same assert succeeds
[PASSED] Lifecycle.test Setup and Teardown are run, and can contain assertions
Total 8 tests (Passed: 8; Fails: 0; Errors: 0) (3.00 ms)
  Firefox 1.9.1.4 MacIntel: Run 8 tests (Passed: 8; Fails: 0; Errors 0) (3.00 ms)</pre></div></div>


<p>Every time you make a change to a Javascript file, or a configuration file, Loris will automatically re-run Javascript Lint and JS Test Driver. So you can instant feedback on your changes.</p>

<p>Loris will clear the command line when re-running tasks. So the latest run is always at the top of you command line.</p>

<p>Loris will also report a summary of each task using <a href="http://growl.info/">Growl</a> (if it is installed). This allows you to get quick feedback without needing to refer back to the command line on every change.</p>

<h3>Requirements</h3>

<p>JS Test Driver is written in Java, so you will need to have Java installed to run it.</p>

<p>To get Growl notifications, you will need to install either <a href="http://growl.info/">Growl for OSX</a> or <a href="http://www.growlforwindows.com/">Growl for Windows</a>. Growl for Windows requires the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en">.NET Framework 2.0+</a>.</p>

<h3>Caveat</h3>

<p>Loris is pretty limited at the moment, I just wired up the basics to get it running for a work project.</p>

<p>It doesn&#8217;t have any configuration options at the moment, so you have to follow it&#8217;s assumptions for now. I&#8217;m happy to add configuration options for any element as required.</p>

<p>Loris only comes with a few tasks (Javascript Lint, JS Test Driver, JSpec, and RSpec), but I hope to allow it have new tasks added via new gems (kind of similar to Autotest).</p>

<p>It comes packaged with a version of Javascript Lint, and JS Test Driver, and will use it&#8217;s own versions. It only includes the OSX and Windows versions of Javascript Lint.</p>

<p>If you want to modify the code, just fork the <a href="http://github.com/karl/loris">Loris github project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://monket.net/blog/2009/11/loris-autotest-for-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

