Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
Cleaned up tests so they run without an app
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Dec 30, 2008
1 parent e636161 commit 1397062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/mile_marker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize_mile_marker(request = nil)

def add_initialize_mile_marker()
init_code = initialize_mile_marker()
return if init_code.blank?
return if init_code.nil? || init_code.empty?
response.body.gsub! /<\/(head)>/i, init_code + '</\1>' if response.body.respond_to?(:gsub!)
end
end
Expand All @@ -21,7 +21,9 @@ class MileMarker
# The environments in which to enable the Mile Marker functionality to run. Defaults
# to 'development' only.
@@environments = ['development']
cattr_accessor :environments
class << self
attr_accessor :environments
end

def self.options
@options ||= {
Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ENV['RAILS_ENV'] = 'test'

require 'test/unit'
require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
require File.join(File.dirname(File.dirname(__FILE__)), "lib", "mile_marker")
require 'ostruct'

module MockResponse
Expand All @@ -12,4 +12,4 @@ def response
end
end
Test::Unit::TestCase.send :include, MockResponse
Thoughtbot::MileMarkerHelper.send :include, MockResponse
Thoughtbot::MileMarkerHelper.send :include, MockResponse

0 comments on commit 1397062

Please sign in to comment.