<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,21 +4,11 @@ require &quot;merb-core&quot;
 require &quot;spec&quot;
 require &quot;merb_exceptions&quot;
 
-# Mock out Merb bits that a re required for testing
-module Merb
-  module Plugins
-    def self.config; NotificationSpecHelper.merb_config || {}; end
-  end
-  
-  class Logger
-    def info(msg=''); msg; end
-  end
-  
-  class &lt;&lt; self
-    def env; 'production'; end
-    def logger; Logger.new; end
-  end
-end
+# merb-exceptions needs to include itself into this class
+class Exceptions &lt; Merb::Controller; end
+
+Merb::Plugins.config[:exceptions][:environments] = 'test'
+Merb.start :environment =&gt; 'test'
 
 module NotificationSpecHelper
   def mock_details(opts={})
@@ -30,20 +20,7 @@ module NotificationSpecHelper
     }.merge(opts)
   end
   
-  def default_config
-    {
-      :web_hooks       =&gt; [],
-      :email_addresses =&gt; [],
-      :app_name        =&gt; &quot;Merb Application&quot;,
-      :environments    =&gt; ['production']
-    }
-  end
-  
   def mock_merb_config(opts={})
-    NotificationSpecHelper.merb_config = {:exceptions =&gt; opts}
-  end
-  
-  class &lt;&lt; self
-    attr_accessor :merb_config
+    Merb::Plugins.config[:exceptions].merge!(opts)
   end
 end
\ No newline at end of file</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,18 +12,6 @@ describe MerbExceptions::Notification do
     it &quot;should set the detail values to those provided&quot; do
       Notification.new(mock_details).details.should == mock_details
     end
-    
-    it &quot;should set config defaults when values aren't provided&quot; do
-      config = Notification.new(mock_details).instance_variable_get(:@config)
-      config.should == default_config
-    end
-    
-    it &quot;should allow overriding of default configuration options through the Merb::Plugins.config hash&quot; do
-      opts = { :app_name=&gt;'Testy Mc Testerson', :email_addresses=&gt;['test1@test.com', 'test2@test.com'] }
-      mock_merb_config(opts)
-      config = Notification.new(mock_details).instance_variable_get(:@config)
-      config.should == default_config.merge(opts)
-    end
   end
   
   describe &quot;.deliver!&quot; do
@@ -46,40 +34,45 @@ describe MerbExceptions::Notification do
   
   describe &quot;.deliver_web_hooks!&quot; do
     before :each do
-      mock_merb_config({ :web_hooks =&gt; ['http://www.test1.com', 'http://www.test2.com'] })
+      mock_merb_config({:web_hooks =&gt; ['http://www.test1.com', 'http://www.test2.com']})
       @notification = Notification.new(mock_details)
       @notification.stub!(:post_hook)
     end
     
     it &quot;should call post_hook for each url&quot; do
-      @notification.should_receive(:post_hook).once.with('http://www.test1.com')
-      @notification.should_receive(:post_hook).once.with('http://www.test2.com')
+      @notification.should_receive(:post_hook).
+        once.with('http://www.test1.com')
+      @notification.should_receive(:post_hook).
+        once.with('http://www.test2.com')
       @notification.deliver_web_hooks!
     end
   end
 
   describe &quot;.deliver_emails!&quot; do
     before :each do
-      mock_merb_config({ :email_addresses =&gt; ['user1@test.com', 'user2@test.com'] })
+      mock_merb_config({:email_addresses =&gt; ['user1@test.com', 'user2@test.com']})
       @notification = Notification.new(mock_details)
       @notification.stub!(:send_notification_email)
     end
 
     it &quot;should call send_notification_email for each address&quot; do
-      @notification.should_receive(:send_notification_email).once.with('user1@test.com')
-      @notification.should_receive(:send_notification_email).once.with('user2@test.com')
+      @notification.should_receive(:send_notification_email).
+        once.with('user1@test.com')
+      @notification.should_receive(:send_notification_email).
+        once.with('user2@test.com')
       @notification.deliver_emails!
     end
   end
   
+  # Running tests with test environment
   describe &quot;.should_deliver_notifications?&quot; do
     it &quot;should return true if the current environment is on the config[:environments] list of one item&quot; do
-        mock_merb_config({ :environments =&gt; 'production' })
+        mock_merb_config({ :environments =&gt; 'test' })
         Notification.new(mock_details).should_deliver_notifications?.should be_true
     end
     
     it &quot;should return true if the current environment is on the config[:environments] list as an array&quot; do
-        mock_merb_config({ :environments =&gt; ['staging', 'production'] })
+        mock_merb_config({ :environments =&gt; ['staging', 'test'] })
         Notification.new(mock_details).should_deliver_notifications?.should be_true
     end
 
@@ -88,4 +81,4 @@ describe MerbExceptions::Notification do
         Notification.new(mock_details).should_deliver_notifications?.should be_false
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/unit/notification_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6f147bfc0512a0c36fef2698250de6ebc37c2078</id>
    </parent>
  </parents>
  <author>
    <name>Martyn Loughran</name>
    <email>martyn@new-bamboo.co.uk</email>
  </author>
  <url>http://github.com/newbamboo/merb_exceptions/commit/e3a28c0915af2c5966d37c2d9ac045ecfde70e1f</url>
  <id>e3a28c0915af2c5966d37c2d9ac045ecfde70e1f</id>
  <committed-date>2008-09-29T10:12:41-07:00</committed-date>
  <authored-date>2008-09-29T10:12:41-07:00</authored-date>
  <message>Clean out old stuff from specs

* Now runs merb in test environment
* Use plugin config correctly instead of mocking it all
* Remove tests for code no longer in notifications initializer.</message>
  <tree>ecaf7184ef3767dda6eb260384567cb29876d903</tree>
  <committer>
    <name>Martyn Loughran</name>
    <email>martyn@new-bamboo.co.uk</email>
  </committer>
</commit>
