<?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>duck_punching &#187; actionview</title>
	<atom:link href="http://duckpunching.com/topics/actionview/feed" rel="self" type="application/rss+xml" />
	<link>http://duckpunching.com</link>
	<description>Ruby, Rails and tech. No ducks were harmed in the making of this blog.</description>
	<lastBuildDate>Thu, 24 Jun 2010 07:12:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using ActionView in standalone tests</title>
		<link>http://duckpunching.com/using-actionview-in-standalone-tests</link>
		<comments>http://duckpunching.com/using-actionview-in-standalone-tests#comments</comments>
		<pubDate>Thu, 12 Jun 2008 03:01:54 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[actionview]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[html-scanner]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://duckpunching.com/?p=6</guid>
		<description><![CDATA[When writing Rails plugins I like to be able to test them as a stand-alone library rather than inside a specific Rails project. I find it more productive and it avoids clashes with other plugins. It also allows you to test it against multiple rails versions. One frustration I have had is when just want [...]]]></description>
			<content:encoded><![CDATA[<p>When writing Rails plugins I like to be able to test them as a stand-alone library rather than inside a specific Rails project. I find it more productive and it avoids clashes with other plugins. It also allows you to test it against multiple rails versions.</p>
<p>One frustration I have had is when just want to use ActionView in your tests, because you might be writing a view plugin, if you require &#8216;action_view&#8217; you get the following error:</p>
<pre>MissingSourceFile: no such file to load -- html/document</pre>
<p>This is because the path to the html-scanner library has not been added to the loadpath. This only happens in ActionController. But if we don&#8217;t need or want the overhead of ActionController the following line will include html-scanner in the loadpath and all will be well.</p>
<pre lang="ruby">$:.unshift Gem.searcher.find('actionpack').full_gem_path
  + '/lib/action_controller/vendor/html-scanner'</pre>
<p>This finds the actionpack gem to get the full path. Then with the path to the html-scanner folder, adds it to the loadpath ($:). Now no more pesky load errors.</p>
<p>If there is a cleaner way, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://duckpunching.com/using-actionview-in-standalone-tests/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

