Skip to content
Browse files

Extract test/helper

  • Loading branch information...
1 parent 8b93402 commit 3d121971fe0d5de9b71d786647d6c99d3e34c01b @josh josh committed with
Showing with 14 additions and 27 deletions.
  1. +11 −0 test/helper.rb
  2. +1 −9 test/test_image_variant_generator.rb
  3. +1 −9 test/test_remote_proxy.rb
  4. +1 −9 test/test_svg_generation.rb
View
11 test/helper.rb
@@ -0,0 +1,11 @@
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..')
+
+require 'rubygems'
+require 'test/unit'
+
+require 'fakeweb'
+require 'mocha'
+
+require 'rack'
+require 'image_server'
+require 'config/env'
View
10 test/test_image_variant_generator.rb
@@ -1,12 +1,4 @@
-$LOAD_PATH.unshift '..'
-
-require "test/unit"
-require 'rubygems'
-require 'fakeweb'
-require 'mocha'
-require 'rack'
-require File.dirname(__FILE__) + '/../image_server'
-require 'config/env'
+require File.join(File.dirname(__FILE__), 'helper')
FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:get, "http://static.shopify.com/image.png", :body => File.read( File.dirname(__FILE__) + '/assets/fish.png'), :content_type => "image/png", :cache_control => 'public, max-age=0')
View
10 test/test_remote_proxy.rb
@@ -1,12 +1,4 @@
-$LOAD_PATH.unshift '..'
-
-require "test/unit"
-require 'rubygems'
-require 'rack'
-require 'mocha'
-
-require File.dirname(__FILE__) + '/../image_server'
-require 'config/env'
+require File.join(File.dirname(__FILE__), 'helper')
# FakeWeb.allow_net_connect = false
# FakeWeb.register_uri(:get, "http://static.shopify.com/test.txt", :body => "Hello World!", :content_type => "text/plain", :cache_control => 'public, max-age=0')
View
10 test/test_svg_generation.rb
@@ -1,12 +1,4 @@
-$LOAD_PATH.unshift '..'
-
-require "test/unit"
-require 'rubygems'
-require 'mocha'
-require 'rack'
-require File.dirname(__FILE__) + '/../image_server'
-require 'config/env'
-
+require File.join(File.dirname(__FILE__), 'helper')
class TestRemoteProxy < Test::Unit::TestCase
StandardResponse = [200, {}, ['OK']]

0 comments on commit 3d12197

Please sign in to comment.
Something went wrong with that request. Please try again.