<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,14 +1,6 @@
 class LighthouseProject
   def initialize
     validate_state
-    Lighthouse.account = account
-    Lighthouse.token = token
-
-    if File.exist?(cache_file_name)
-      @ticket_cache = YAML.load_file(cache_file_name)
-    else
-      @ticket_cache = {}
-    end
   end
 
   def project
@@ -24,6 +16,8 @@ class LighthouseProject
   end
 
   def get_tickets(ticketnumbers)
+    init_cache
+    init_lighthouse
     ticketnumbers.map do |ticket_num|
       ticket = @ticket_cache[ticket_num]
       if (!ticket)
@@ -43,6 +37,19 @@ private
     end
   end
 
+  def init_cache
+    if File.exist?(cache_file_name)
+      @ticket_cache = YAML.load_file(cache_file_name)
+    else
+      @ticket_cache = {}
+    end
+  end
+
+  def init_lighthouse
+    Lighthouse.account = account
+    Lighthouse.token = token
+  end
+
   def cache_file_name
     File.expand_path(&quot;~/.gil/#{account}.#{project}.cache.yml&quot;)
   end</diff>
      <filename>scripts/gil/lib/gil/lighthouse_project.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,31 @@
 require File.dirname(__FILE__) + '/../spec_helper'
+
+describe &quot;LighthouseProject&quot; do
+  it &quot;should use the Git class to verify the lighthouse account information when constructed&quot; do
+    Git.should_receive(:get_config_value).with(&quot;gil.account&quot;).and_return(&quot;account&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.project&quot;).and_return(&quot;11111&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.token&quot;).and_return(&quot;token&quot;)
+    LighthouseProject.new
+  end
+
+  it &quot;should complain if no account could be found&quot; do
+    Git.should_receive(:get_config_value).with(&quot;gil.account&quot;).and_return(&quot;&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.project&quot;).any_number_of_times.and_return(&quot;11111&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.token&quot;).any_number_of_times.and_return(&quot;token&quot;)
+    lambda { LighthouseProject.new }.should raise_error(RuntimeError, &quot;No account was found in .git config.&quot;)
+  end
+
+  it &quot;should complain if no project could be found&quot; do
+    Git.should_receive(:get_config_value).with(&quot;gil.account&quot;).any_number_of_times.and_return(&quot;account&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.project&quot;).and_return(&quot;&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.token&quot;).any_number_of_times.and_return(&quot;token&quot;)
+    lambda { LighthouseProject.new }.should raise_error(RuntimeError, &quot;No project was found in .git config.&quot;)
+  end
+
+  it &quot;should complain if no token could be found&quot; do
+    Git.should_receive(:get_config_value).with(&quot;gil.account&quot;).any_number_of_times.and_return(&quot;account&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.project&quot;).any_number_of_times.and_return(&quot;11111&quot;)
+    Git.should_receive(:get_config_value).with(&quot;gil.token&quot;).and_return(&quot;&quot;)
+    lambda { LighthouseProject.new }.should raise_error(RuntimeError, &quot;No token was found in .git config.&quot;)
+  end
+end</diff>
      <filename>scripts/gil/spec/gil/lighthouse_project_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1131e6ae2b5d61c4b4ebc678a11ca2c9ed014632</id>
    </parent>
  </parents>
  <author>
    <name>Simon Jefford</name>
    <email>simon.jefford@gmail.com</email>
  </author>
  <url>http://github.com/simonjefford/tinyprojects/commit/db29ce410471d61d14f070430ae73b881f8caaa9</url>
  <id>db29ce410471d61d14f070430ae73b881f8caaa9</id>
  <committed-date>2008-05-22T13:33:10-07:00</committed-date>
  <authored-date>2008-05-22T13:33:10-07:00</authored-date>
  <message>Started to add some spec coverage for LighthouseProject</message>
  <tree>20843d7dbb7dae45ab0bce1ba58eb089aefd33ac</tree>
  <committer>
    <name>Simon Jefford</name>
    <email>simon.jefford@gmail.com</email>
  </committer>
</commit>
