<?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>rob aldred</title>
	<atom:link href="http://robaldred.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://robaldred.co.uk</link>
	<description>cars, f1, bikes, tech tips &#38; what ever i&#039;m interested in this week</description>
	<lastBuildDate>Thu, 25 Feb 2010 14:31:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding additional configuration args to selenium rc using cucumber and webrat</title>
		<link>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/</link>
		<comments>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 14:30:50 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webrat]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=183</guid>
		<description><![CDATA[I use cucumber, webrat and selenium RC a lot day to day, all are great pieces of kit, which make my life so much easier, but I&#8217;m always trying to find ways to make these ever easier.
Selenium RC has alot of options which are settable when booting the selenium-server java application.
Many of these options are [...]]]></description>
			<content:encoded><![CDATA[<p>I use cucumber, webrat and selenium RC a lot day to day, all are great pieces of kit, which make my life so much easier, but I&#8217;m always trying to find ways to make these ever easier.<br />
Selenium RC has alot of options which are settable when booting the selenium-server java application.<br />
Many of these options are not available when using selenium with cucumber and webrat.</p>
<p>I have <a href="https://webrat.lighthouseapp.com/projects/10503/tickets/307-ability-to-pass-additional-args-to-the-selenium-rc-server">raised an issue for webrat</a> and produced a patch that enables you to pass additional arguments during the setup of your webrat instance, these are then passed on to the Selenium RC startup command. </p>
<p>Until this is prioritised and added to the webrat core, I have an on-the-fly solution that enables the additional args, the following code should be added to your `env.rb`</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">module</span> Webrat<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">class</span> Configuration<br />
&nbsp; &nbsp; attr_accessor <span style="color:#ff3333; font-weight:bold;">:selenium_additional_args</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">module</span> AdditionalArgs &nbsp;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>base<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; base.<span style="color:#9900CC;">alias_method_chain</span> <span style="color:#ff3333; font-weight:bold;">:start</span>, <span style="color:#ff3333; font-weight:bold;">:additional_args</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> start_with_additional_args<br />
&nbsp; &nbsp; remote_control.<span style="color:#9900CC;">additional_args</span> = Webrat.<span style="color:#9900CC;">configuration</span>.<span style="color:#9900CC;">selenium_additional_args</span><br />
&nbsp; &nbsp; start_without_additional_args<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
Webrat.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span> &nbsp;<br />
&nbsp; ... &nbsp;<br />
&nbsp; <span style="color:#9900CC;">config</span>.<span style="color:#9900CC;">selenium_additional_args</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;-firefoxProfileTemplate '../../Library/Application Support/Firefox/Profiles/selenium'&quot;</span>, <span style="color:#996600;">&quot;-singleWindow&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; ...<br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#6666ff; font-weight:bold;">Webrat::Selenium::SeleniumRCServer</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#9966CC; font-weight:bold;">include</span>, AdditionalArgs<span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing ActionMailer models with Rspec</title>
		<link>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/</link>
		<comments>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:41:05 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[actionmailer]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=163</guid>
		<description><![CDATA[You might think testing ActionMailer sounds like a challenge, actually it&#8217;s just as easy as testing other classes, you just have to know the methods to use to change the state/content of the deliveries.
Here we have a simple example of how you might test a mailer for your order receipt
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475require File.dirname&#40;__FILE__&#41; + '/../spec_helper'

describe OrderMailer do
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>You might think testing ActionMailer sounds like a challenge, actually it&#8217;s just as easy as testing other classes, you just have to know the methods to use to change the state/content of the deliveries.</p>
<p>Here we have a simple example of how you might test a mailer for your order receipt</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/../spec_helper'</span><br />
<br />
describe OrderMailer <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; <br />
&nbsp; describe <span style="color:#996600;">&quot;receipt&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; <br />
&nbsp; &nbsp; before<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:each</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@order</span> = mock_model<span style="color:#006600; font-weight:bold;">&#40;</span>Order<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span> = mock_model<span style="color:#006600; font-weight:bold;">&#40;</span>Customer<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; it <span style="color:#996600;">&quot;should render successfully&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">create_receipt</span><span style="color:#006600; font-weight:bold;">&#40;</span>@order<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should_not</span> raise_error<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; describe <span style="color:#996600;">&quot;rendered without error&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; before<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:each</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span> = OrderMailer.<span style="color:#9900CC;">create_receipt</span><span style="color:#006600; font-weight:bold;">&#40;</span>@order<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have an order number&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.order_number'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">id</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have order details&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.order_details&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a billing address&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.billing.address&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a delivery address&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.delivery.address&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have customer contact details&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#contact_details&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.landline'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">landline</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.mobile'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">mobile</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.email'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">email</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a list of items&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.line_items&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have totals&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.totals&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.sub_total'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">sub_total</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.vat'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">vat</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.postage'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">postage</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.total'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">total</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should deliver successfully&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span>@mailer<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should_not</span> raise_error<br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; describe <span style="color:#996600;">&quot;and delivered&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should be added to the delivery queue&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span>@mailer<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should</span> change<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">deliveries</span>,:size<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">by</span><span style="color:#006600; font-weight:bold;">&#40;</span>1<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>rendering the following output:</p>
<div id="attachment_176" class="wp-caption alignnone" style="width: 310px"><a href="http://robaldred.co.uk/wp-content/uploads/2009/12/Screen-shot-2009-12-14-at-11.37.58.png"><img src="http://robaldred.co.uk/wp-content/uploads/2009/12/Screen-shot-2009-12-14-at-11.37.58-300x262.png" alt="ActionMailer test output from textmate rspec bundle" title="ActionMailer test output from textmate rspec bundle" width="300" height="262" class="size-medium wp-image-176" /></a><p class="wp-caption-text">ActionMailer test output from textmate rspec bundle</p></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add https (ssl) support to your osx mac development machine with signed certificate</title>
		<link>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/</link>
		<comments>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 15:07:31 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[authority]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[self-signed]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=138</guid>
		<description><![CDATA[It became apparent that getting mod_ssl working correctly without browser warnings when developing sites that take payments is a bit of pain. Mainly because there is no free way to have a root authority sign your Certificate Signing Request (CSR).
There is how ever a short cut, given that you are using Apache, mod_ssl, openssl and [...]]]></description>
			<content:encoded><![CDATA[<p>It became apparent that getting mod_ssl working correctly without browser warnings when developing sites that take payments is a bit of pain. Mainly because there is no free way to have a root authority sign your Certificate Signing Request (CSR).</p>
<p>There is how ever a short cut, given that you are using Apache, mod_ssl, openssl and Firefox.</p>
<p>We&#8217;re going to generate our own Certificate Authority (CA), this is CA is only going to work for us so if your generating a certificate for production, you&#8217;ll need to send your CSR to a proper CA such as VeriSign</p>
<p>Step1, Make a temporary folder we can work in.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>ssltemp</div></div>
<p>Step2, generate our private key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span></div></div>
<p>You will be asked for a passphrase in the creation of this key. (just use 12345) or anything but<em>do not forget this passphrase!</em> You’ll have to do this all over if you forget the passphrase. You will need this passphrase later on in the process.</p>
<p>Step3, generate a CSR from our private  key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr</div></div>
<p>you&#8217;ll be asked for the following information:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Country Name <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span> letter code<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>AU<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter your country code here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
State or Province Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>full name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Some-State<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Enter your state here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Locality Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, city<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter your city here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Organization Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, company<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Internet Widgits Pty Ltd<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter something here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Organizational Unit Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, section<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter something here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>this is the important one<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Email Address <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>your e-mail address<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Make sure you fill in `Common Name` with your domain you want this certificate for, this should match your apache vhost `ServerName` setting</p>
<p>Now, looking at the directory we&#8217;re working in, you should have the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>rob:~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>ssltemp<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span><br />
total 12<br />
drwxr-xr-x &nbsp; &nbsp;5 rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 126 Nov 14 17:01 .<br />
drwx------ &nbsp; 38 rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; 1248 Nov 14 16:57 ..<br />
<span style="color: #660033;">-rw-r--r--</span> &nbsp; &nbsp;1 rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 729 Nov 14 17:01 server.csr<br />
<span style="color: #660033;">-rw-r--r--</span> &nbsp; &nbsp;<span style="color: #000000;">1</span> rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">963</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">59</span> server.key</div></div>
<p>Step4, create the private key for our CA</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> ca.key <span style="color: #000000;">1024</span></div></div>
<p>Again, you’ll be asked for a passphrase, which, again, you should not forget.</p>
<p>Step5, create CA certificate using the key we just made</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-days</span> 365 <span style="color: #660033;">-key</span> ca.key <span style="color: #660033;">-out</span> ca.crt</div></div>
<p>You will be asked for similar information you were asked for when we make the web server certificate earlier; this information should be about you, enter something like the following</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Country Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>2 letter code<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>AU<span style="color: #7a0874; font-weight: bold;">&#93;</span>:GB<br />
State or Province Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>full name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Some-State<span style="color: #7a0874; font-weight: bold;">&#93;</span>:Cheshire<br />
Locality Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, city<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:Stockport<br />
Organization Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, company<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Internet Widgits Pty Ltd<span style="color: #7a0874; font-weight: bold;">&#93;</span>:My CA<br />
Organizational Unit Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, section<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:My CA <span style="color: #000000; font-weight: bold;">for</span> Dev<br />
Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:Rob Aldred<br />
Email Address <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:raldred<span style="color: #000000; font-weight: bold;">@</span>gmail.com</div></div>
<p>Now you will have 4 files your directory; server.key, server.csr, ca.key, ca.crt<br />
Next is the important park, signing our certificate request.</p>
<p>The easiest way to do this is to use the sign.sh script contained in the mod_ssl source,<br />
or you can get it here: <a href="http://bit.ly/4MtUqX">sign.sh</a><br />
copy the script to the working directory</p>
<p>Step6, make sign.sh executable and sign our CSR</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x sign.sh<br />
.<span style="color: #000000; font-weight: bold;">/</span>sign.sh server.csr</div></div>
<p>you should get something like the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CA signing: server.csr -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; server.crt:<br />
Using configuration from ca.config<br />
Enter PEM pass phrase:<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subjects Distinguished Name is <span style="color: #c20cb9; font-weight: bold;">as</span> follows<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :PRINTABLE:<span style="color: #ff0000;">'GB'</span><br />
stateOrProvinceName &nbsp; :PRINTABLE:<span style="color: #ff0000;">'Cheshire'</span><br />
localityName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'Stockport'</span><br />
organizationName &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'Testing'</span><br />
organizationalUnitName:PRINTABLE:<span style="color: #ff0000;">'Testing'</span><br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'localhost'</span><br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:IA5STRING:<span style="color: #ff0000;">'raldred@gmail.com'</span><br />
Certificate is to be certified <span style="color: #000000; font-weight: bold;">until</span> Nov 14 23:09:20 2010 GMT <span style="color: #7a0874; font-weight: bold;">&#40;</span>365 days<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Sign the certificate? <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>:y<br />
<br />
1 out of 1 certificate requests certified, commit? <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>y<br />
Write out database with 1 new entries<br />
Data Base Updated<br />
CA verifying: server.crt <span style="color: #000000; font-weight: bold;">&amp;</span>lt;-<span style="color: #000000; font-weight: bold;">&amp;</span>gt; CA cert<br />
server.crt: OK</div></div>
<p>Answer &#8216;y&#8217; to the question asking to Sign the certificate [y/n]</p>
<p>Step7, remove password requirement from server key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.original<br />
openssl rsa <span style="color: #660033;">-in</span> server.key.original <span style="color: #660033;">-out</span> server.key</div></div>
<p>you be asked for the passphase</p>
<p>Step8, copy files to our webserver</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>certs<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Step9, add the configuration to your VirtualHost block listening on the SSL port 443</p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span><br />
<span style="color: #00007f;">SSLCertificateFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/server.crt&quot;</span><br />
<span style="color: #00007f;">SSLCertificateKeyFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/server.key&quot;</span><br />
<span style="color: #00007f;">SSLCACertificateFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/ca.crt&quot;</span></div></div>
<p>Step10, Tell apache to listen on 443<br />
By default there is a file in /etc/apache2/extras called httpd-ssl.conf<br />
this needs to edited and included in /etc/apache2/httpd.conf its commented out initially.</p>
<p><em>Depending where you are defining your VirtualHost blocks</em><br />
Comment out or remove the _default_ virtualHost block in httpd-ssl.conf, this will cause errors when starting apache because we have no configured certificate for the example apache provites</p>
<p>Edit your httpd.conf to include the etc/httpd-ssl.conf file, scroll to the bottom the file, you&#8217;ll notice its commented out at around line #476</p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;"># Secure (SSL/TLS) connections</span><br />
<span style="color: #adadad; font-style: italic;"># Include /private/etc/apache2/extra/httpd-ssl.conf</span></div></div>
<p>Just remove the # and move onto the next step</p>
<blockquote><p><em>I use a seperate vhosts folder in extra, containing individual conf files for each virtualhost, they are included in the extra/httpd-vhosts.conf files using the following:</em></p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">Include</span> /private/etc/apache2/extra/vhosts/*.conf</div></div>
</blockquote>
<p>Step10, restart apache</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl restart</div></div>
<p>Step11, (a few steps in itself) Add our CA to Firefox so it think its a trusted authority<br />
Go to Preferences (Cmd + ,)<br />
Go to Advanced<br />
Go to Encryption<br />
Click &#8216;View Certificates&#8217;<br />
Choose the &#8216;Authorities&#8217; tab<br />
Click &#8216;Import&#8217;<br />
Hit Shift + Cmd + g to open the go to folder window<br />
Enter &#8216;/etc/apache2/certs&#8217; (You might be asked to authenticate with your system password)<br />
Select the ca.crt file we generated earlier and click &#8216;Open&#8217;<br />
Firefox will ask you:<br />
Do you want to trust &#8220;My CA&#8221; for the following purposes?<br />
Just select Trust this CA to identify websites<br />
Click &#8216;OK&#8217;<br />
Restart your browser</p>
<p>If you&#8217;ve followed everything correctly when you go to https://localhost (or whatever CommonName you specified)<br />
You will get a ssl encrypted site and no warnings about the certificate not being trusted.</p>
<div id="attachment_161" class="wp-caption alignnone" style="width: 310px"><a href="http://robaldred.co.uk/wp-content/uploads/2009/11/verified_cert.jpg"><img class="size-medium wp-image-161" title="verified_cert" src="http://robaldred.co.uk/wp-content/uploads/2009/11/verified_cert-300x125.jpg" alt="Example showing a local vhost with a verified cert" width="300" height="125" /></a><p class="wp-caption-text">Example showing a local vhost with a verified cert</p></div>
<p>If apache doesn&#8217;t come backup then apache&#8217;s config checks program is your best friend.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #660033;">-S</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cucumber pretty html formatter for textmate</title>
		<link>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/</link>
		<comments>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 11:23:48 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=105</guid>
		<description><![CDATA[I&#8217;ve been using cucumber a lot recently along with the textmate bundle for it.
The HTML output cucumber creates is fine, but not all that pretty.
I&#8217;ve created a new formatter for cucumber to generate HTML enhanced with some javascript.
My inspiration came from the textmate bundle for rspec.
You can grap it off my github.
Here&#8217;s some screenshots:
UPDATE: I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://cukes.info" target="_blank">cucumber</a> a lot recently along with the textmate bundle for it.<br />
The HTML output cucumber creates is fine, but not all that pretty.</p>
<p>I&#8217;ve created a new formatter for cucumber to generate HTML enhanced with some javascript.<br />
My inspiration came from the textmate bundle for <a href="http://rspec.info" target="_blank">rspec</a>.</p>
<p>You can grap it off my <a href="http://github.com/raldred/cucumber_textmate/tree/master" target="_blank">github</a>.<br />
Here&#8217;s some screenshots:</p>

<a href='http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/cucumber_failure-2/' title='cucumber_failure'><img width="150" height="150" src="http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_failure-150x150.jpg" class="attachment-thumbnail" alt="" title="cucumber_failure" /></a>
<a href='http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/cucumber_full-2/' title='cucumber_full'><img width="150" height="150" src="http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_full-150x150.jpg" class="attachment-thumbnail" alt="" title="cucumber_full" /></a>

<p><strong>UPDATE:</strong> I replaced the original html formatter in cucumber; as of 19th November my fork has been merged into Aslak&#8217;s cucumber/master upgrade to the cucumber 0.4.5 release.<br />
<a href="http://bit.ly/6beSgO">View the commit history</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Restart macports MySQL 5 on OSX</title>
		<link>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/</link>
		<comments>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 16:14:52 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mysql mac osx launchdaemons]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/</guid>
		<description><![CDATA[sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl unload <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>org.macports.mysql5.plist<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>org.macports.mysql5.plist</div></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell Latitude D430 OSx86 working install guide using iPC PPF5 Final</title>
		<link>http://robaldred.co.uk/2009/06/dell-latitude-d430-osx86-install-guide-using-ipc-ppf5-final/</link>
		<comments>http://robaldred.co.uk/2009/06/dell-latitude-d430-osx86-install-guide-using-ipc-ppf5-final/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 20:12:31 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[hackintosh]]></category>
		<category><![CDATA[iPC]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[osx86]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=88</guid>
		<description><![CDATA[I had an iMac for a while now and have been thinking of getting a Macbook aswell.
Just recently I&#8217;ve been given a Dell D430 I&#8217;ve heard a lot about OSx86 and tried to do it once before with a kalyway install but failed miserably. This Dell D430 has a good spec match to the macbooks [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I had an iMac for a while now and have been thinking of getting a Macbook aswell.</strong></p>
<p>Just recently I&#8217;ve been given a Dell D430 I&#8217;ve heard a lot about OSx86 and tried to do it once before with a kalyway install but failed miserably. This Dell D430 has a good spec match to the macbooks and seems to be supported a bit so thought i&#8217;d give it a whirl.</p>
<p>It took about 6 hours, 2 of them spent downloading the 4.3gb iPC DVD from Rapidshare (btw, jDownloader + Rapidshare premium ftw)</p>
<p>I burnt the ISO to a Blank 4.7 DVD, popped it into my Lenovo USB DVD Combo drive (No DVD/CD on the D430)<br />
to my amazement the OSX installer booted up straight away.</p>
<p><strong>Note: You&#8217;ll need a USB KB + Mouse for the first boot, the installer works with the D430&#8217;s kb + trackpad but after install it needs little more work.</strong></p>
<p>Install done using iPC OSX 10.5.6 PPF5 Universal Final &#8211; Base<br />
Use the following options when installing:</p>
<p>- Kernel: Voodoo 9.5.0<br />
- Video: Intel GMA950<br />
- Chipset: LegacyAppleIntelPIIXATA<br />
- Audio: Sigmatel 9200 (Might not work, if not fix later with Apple HDA Patcher instructions below)<br />
- Ethernet: Intel 82566MM/DC (Not tested, I use Wifi)<br />
- Wireless: Intel PROSet/Wireless 3945<br />
- USB: Patched USB + PCGenUSBEHCI<br />
- Fixes &amp; Patches: ACPI Fix<br />
Time Machine Patch<br />
IOPCIFamily.kext patched<br />
Seatbelt.kext 10.5.5<br />
USB Mount Fix<br />
PS/2 Device Support (Both KB + Mouse)<br />
DSDT Patch<br />
- All Applications</p>
<p>Restart remember to use &#8220;-f&#8221; flag when starting up for the first time.</p>
<p><strong>KEYBOARD AND MOUSE Install</strong></p>
<p>1.    Download Package <a href="http://www.insanelymac.com/forum/index.php?act=attach&amp;type=post&amp;id=34259" target="_blank">PS2Fix1054</a>.<br />
2.    Right Click on the Package -&gt; Open With -&gt; Pacifist<br />
3.    After 15 Seconds, Click on Not Yet (Support Charles if you use this App)<br />
4.    Expand contents of &#8220;Choice0&#8243;<br />
5.    Expand contents of &#8220;appleps2controller.pkg&#8221;<br />
6.    Right Click &#8220;ApplePS2Controller.kext&#8221; and select the option &#8220;Install to default location&#8221;</p>
<p><strong>To solve the kernel panics when mounting dmg&#8217;s</strong><br />
Install this <a href="http://dl.getdropbox.com/u/384839/Drivers/seatbelt%2010.5.5.kext.zip">seatbelt.kext</a> from 10.5.5 over the one from 10.5.6, use osx86tools for install<br />
Remember to fix permissions.</p>
<p><strong>Audio Fix:</strong><br />
Download <a href="http://www.insanelymac.com/forum/index.php?act=attach&amp;type=post&amp;id=42389" target="_blank">Apple HDA Patcher 1.20</a><br />
and the correctly patch file for the <a href="http://psykopat.free.fr/apple/AppleHDA/sigmatel/Stac9200.txt">Sigmatel 9200 audio</a></p>
<p><strong>Battery Monitor: </strong><em>(Source: http://mydellmini.com/forum/mac-os-x/871-battery-monitor.html)</em></p>
<p>You&#8217;ll need the following Kext collection,<br />
<a href="http://robaldred.co.uk/wp-content/uploads/2009/06/Kexts.zip">Kexts for battery monitor</a><br />
We only need PowerManagement.bundle + AppleACPIBatteryManager.kext</p>
<p>First is PowerManagement.bundle, that goes into to /System/Library/SystemConfiguration folder<br />
Then there&#8217;s AppleACPIBatteryManager.kext, that goes into the /System/Libary/Extensions directory. Fix the extension permissions with osx86tools, reboot with -f</p>
<p><strong>Summary</strong><em><br />
</em></p>
<p>There is only 1 thing I cannot get working (Which <span>I&#8217;m</span> still working on finding a fix) the SD Card reader, it seems to freeze the laptop when a card is inserted.</p>
<p>If everything goes smoothly you should have OSX up and running on your Dell within an hour.<br />
Winner Winner!</p>
<p>Thanks for reading &amp; good luck<br />
<em>Rob</em></p>
<h6><em>Thanks to <a href="http://www.insanelymac.com" target="_blank">Insanely Mac </a>for being an invaluable resource for me <img src='http://robaldred.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></h6>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/06/dell-latitude-d430-osx86-install-guide-using-ipc-ppf5-final/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Restarting syslog process on Mac OSX</title>
		<link>http://robaldred.co.uk/2009/05/restarting-syslog-process-on-mac-osx/</link>
		<comments>http://robaldred.co.uk/2009/05/restarting-syslog-process-on-mac-osx/#comments</comments>
		<pubDate>Fri, 29 May 2009 11:31:45 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[syslog]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=71</guid>
		<description><![CDATA[I&#8217;ve been working on a project which uses syslog.
In order for the changes I made to syslog.conf to take effect I needed to restart the syslogd process
Yes I could restart my computer but that&#8217;s just too much effort.
I found a simple solution using the built in Mac Launch Daemons

~#: launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
~#: launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

syslogd [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a project which uses syslog.<br />
In order for the changes I made to syslog.conf to take effect I needed to restart the syslogd process</p>
<p>Yes I could restart my computer but that&#8217;s just too much effort.<br />
I found a simple solution using the built in Mac Launch Daemons</p>
<pre lang="shell">
~#: launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
~#: launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
</pre>
<p>syslogd will now have reloaded with any config changes you made.</p>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/05/restarting-syslog-process-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Sync iPhone with multiple computers from tinyfish</title>
		<link>http://robaldred.co.uk/2009/03/how-to-sync-iphone-with-multiple-computers-from-tinyfish/</link>
		<comments>http://robaldred.co.uk/2009/03/how-to-sync-iphone-with-multiple-computers-from-tinyfish/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 15:20:33 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=64</guid>
		<description><![CDATA[Nice and simple method to flawlessly enable syncing your iphone + iPods to multiple machines, works on Mac + Windows!
I used HexEdit.app, now I have my iPhone syncing to both my home + work iMac’s with iTunes 8.1

 How to Sync iPhone with multiple computers
UPDATE: IT DOES WORK WITH ITUNES 8 ( THANKS DILLY! )
In [...]]]></description>
			<content:encoded><![CDATA[<p>Nice and simple method to flawlessly enable syncing your iphone + iPods to multiple machines, works on Mac + Windows!<br />
I used HexEdit.app, now I have my iPhone syncing to both my home + work iMac’s with iTunes 8.1</p>
<blockquote>
<h3><a href="http://tinyfish.net/2008/07/18/how-to-sync-iphone-with-multiple-computers/"> How to Sync iPhone with multiple computers</a></h3>
<p>UPDATE: IT DOES WORK WITH ITUNES 8 ( THANKS DILLY! )</p>
<p>In order to sync your iPhone with multiple computers you always had to “erase” one iTunes library and sync with another, no longer! Thanks to Andrew Grant at Shiny Things who create a step by step instruction for syncing your iPhone with multiple computers and giving you full manual control on how you want to organize your iPhone music between multiple iTunes libraries.</p>
<p>This is NOT for the faint hearted as it does involve tweaking of files, please proceed with caution and BACKUP everything, especially your “iTunes Library” and “iTunes Music Library.xml” files before proceeding. I have performed this and it works flawlessly but if for any reason your iTunes or your iPhone or your data becomes destroyed, I am NOT responsible. Now that we have gotten the disclaimer aside, let’s proceed with the fun stuff.</p></blockquote>
<p>(via <a href="http://tinyfish.net/2008/07/18/how-to-sync-iphone-with-multiple-computers/">tinyfish.net</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/03/how-to-sync-iphone-with-multiple-computers-from-tinyfish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google thinks every result is spam/malware?</title>
		<link>http://robaldred.co.uk/2009/01/google-thinks-every-result-is-spammalware/</link>
		<comments>http://robaldred.co.uk/2009/01/google-thinks-every-result-is-spammalware/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 15:10:08 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/2009/01/google-thinks-every-result-is-spammalware/</guid>
		<description><![CDATA[I&#8217;ve turned my computer on today gone to search google and found that all the results have a warning under them&#8230;
&#8220;This site may harm your computer&#8221;
even amazon&#8230; what are google doing to me?
Clicking on them gives me a google page that blocks me access to the page.  
//Update @ 15:16 GMT
It would appear that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve turned my computer on today gone to search google and found that all the results have a warning under them&#8230;</p>
<blockquote><p>&#8220;This site may harm your computer&#8221;</p></blockquote>
<p>even amazon&#8230; what are google doing to me?</p>
<p>Clicking on them gives me a google page that blocks me access to the page. <img src='http://robaldred.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div id="attachment_54" class="wp-caption alignnone" style="width: 310px"><a href="http://robaldred.co.uk/wp-content/uploads/2009/01/malware_google.jpg"><img src="http://robaldred.co.uk/wp-content/uploads/2009/01/malware_google-300x251.jpg" alt="Google reckons all it&#039;s results are harmful" title="malware_google" width="300" height="251" class="size-medium wp-image-54" /></a><p class="wp-caption-text">Google reckons all it's results are harmful</p></div>
<p>//Update @ 15:16 GMT<br />
It would appear that I am not the only one, Google is actually broken, someone&#8217;s committed some broken code, whoops.</p>
<p>Theres loads of threads on the <a href="http://www.google.com/support/forum/p/Web+Search?hl=en">Google support forum</a> about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/01/google-thinks-every-result-is-spammalware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom log files for your ruby on rails applications</title>
		<link>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/</link>
		<comments>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 15:38:47 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=27</guid>
		<description><![CDATA[Sometimes logging is required but putting the messages in the Rails log isn’t the answer.For example you need to see the progress of customers through your order placement cycle, you ideally need this seperate to any other in a custom log file?
There is a solution and it&#8217;s easy&#8230; To create an order progress log, simply [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes logging is required but putting the messages in the Rails log isn’t the answer.For example you need to see the progress of customers through your order placement cycle, you ideally need this seperate to any other in a custom log file?</p>
<p>There is a solution and it&#8217;s easy&#8230; To create an order progress log, simply create a new instance of <em>Logger</em> and pass it a <em>File</em> instance for your own logfile.<br />
Create a new model which inherits from <em>Logger</em></p>
<pre lang="ruby">class OrderProgressLogger &lt; Logger
  def format_message(severity, timestamp, progname, msg)
  "#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
  end
end</pre>
<p>Create initializer called logs.rb in RAILS_ROOT/config/initializers with the following content:</p>
<pre lang="ruby">order_progress_logfile = File.open("#{RAILS_ROOT}/log/order_progress.log", 'a')
order_progress_logfile.sync = true
ORDER_PROGRESS_LOG = OrderProcessLogger.new(order_progress_logfile)</pre>
<p>After a restart of your mongrel or passenger <em>ORDER_PROGRESS_LOG</em> will be available through out your application.<br />
You log to it just as you would <em>DEFAULT_RAILS_LOGGER</em> like so&#8230;</p>
<pre lang="ruby">ORDER_PROGRESS_LOG.debug "Starting order placement method"
ORDER_PROGRESS_LOG.error "Could not create order record"</pre>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
