Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up tests so they run without an app

  • Loading branch information...
commit 139706251560547677eb99b5ae85ef2f4d0643ca 1 parent e636161
@jyurek jyurek authored
Showing with 6 additions and 4 deletions.
  1. +4 −2 lib/mile_marker.rb
  2. +2 −2 test/test_helper.rb
View
6 lib/mile_marker.rb
@@ -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
@@ -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 ||= {
View
4 test/test_helper.rb
@@ -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
@@ -12,4 +12,4 @@ def response
end
end
Test::Unit::TestCase.send :include, MockResponse
-Thoughtbot::MileMarkerHelper.send :include, MockResponse
+Thoughtbot::MileMarkerHelper.send :include, MockResponse
Please sign in to comment.
Something went wrong with that request. Please try again.