Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make tests mirror lib directory and add .autotest file

  • Loading branch information...
commit 3c1f4c5b75f5900f9496df9203bac1e3214d0891 1 parent c7e8e28
Brandon Keepers bkeepers authored
13 .autotest
View
@@ -0,0 +1,13 @@
+Autotest.add_hook :initialize do |at|
+ at.clear_mappings
+
+ at.add_mapping %r%^lib/(.*)\.rb$% do |_, m|
+ at.files_matching %r%^test/#{m[1]}_test.rb$%
+ end
+
+ at.add_mapping(%r%^test/.*\.rb$%) {|filename, _| filename }
+
+ at.add_mapping %r%^test/fixtures/(.*)s.yml% do |_, _|
+ at.files_matching %r%^test/.*\.rb$%
+ end
+end
2  Rakefile
View
@@ -30,7 +30,7 @@ task :default => :test
desc 'Run the unit tests'
Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
+ t.libs << 'lib' << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
2  test/unit/graticule/distance_test.rb → test/graticule/distance_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
+require 'test_helper'
module Graticule
module Distance
2  test/unit/graticule/geocoder/freethepostcode_test.rb → test/graticule/geocoder/freethepostcode_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/geocoder_ca_test.rb → test/graticule/geocoder/geocoder_ca_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/geocoder_us_test.rb → test/graticule/geocoder/geocoder_us_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
3  test/unit/graticule/geocoder/geocoders.rb → test/graticule/geocoder/geocoders.rb
View
@@ -1,5 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
-
+require 'test_helper'
module Graticule
2  test/unit/graticule/geocoder/google_test.rb → test/graticule/geocoder/google_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/host_ip_test.rb → test/graticule/geocoder/host_ip_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  ...unit/graticule/geocoder/local_search_maps_test.rb → test/graticule/geocoder/local_search_maps_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/mapquest_test.rb → test/graticule/geocoder/mapquest_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/multi_test.rb → test/graticule/geocoder/multi_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/multimap_test.rb → test/graticule/geocoder/multimap_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder/yahoo_test.rb → test/graticule/geocoder/yahoo_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
+require 'test_helper'
module Graticule
module Geocoder
2  test/unit/graticule/geocoder_test.rb → test/graticule/geocoder_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
+require 'test_helper'
module Graticule
class GeocoderTest < Test::Unit::TestCase
2  test/unit/graticule/location_test.rb → test/graticule/location_test.rb
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
+require 'test_helper'
module Graticule
class LocationTest < Test::Unit::TestCase
3  test/test_helper.rb
View
@@ -1,11 +1,10 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')
-$:.unshift(File.dirname(__FILE__) + '/mocks')
require 'rubygems'
-require 'yaml'
require 'test/unit'
require 'graticule'
require 'mocha'
+require 'mocks/uri'
TEST_RESPONSE_PATH = File.dirname(__FILE__) + '/fixtures/responses'
Please sign in to comment.
Something went wrong with that request. Please try again.