Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

now using test_helper

  • Loading branch information...
commit 4ddfd75e8d567f20e621fd7e9639e322ddf7868b 1 parent a059d49
@rsl authored
View
2  Rakefile
@@ -35,7 +35,7 @@ end
desc 'Test Stringex using ActiveRecord ORM'
Rake::TestTask.new(:test_active_record) do |t|
ENV['ADAPTER'] = 'active_record'
- t.libs << 'lib'
+ t.libs << 'lib' << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
View
3  test/acts_as_url/adapter/active_record.rb
@@ -3,9 +3,8 @@
require 'active_record'
RAILS_ROOT = File.expand_path(File.dirname(__FILE__))
-$: << File.join(File.expand_path(File.dirname(__FILE__)), '../../../lib')
-require File.join(File.expand_path(File.dirname(__FILE__)), '../../../init.rb')
+require "stringex"
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "acts_as_url.sqlite3")
View
4 test/acts_as_url_test.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8
-require 'test/unit'
-
+require 'test_helper'
+# NOTE: Stringex gets required inside the adapter
adapter = ENV['ADAPTER'] || 'active_record'
require File.join(File.expand_path(File.dirname(__FILE__)), "acts_as_url/adapter/#{adapter}.rb")
View
8 test/string_extensions_test.rb
@@ -1,13 +1,11 @@
# encoding: UTF-8
+require "test_helper"
+require "stringex"
+
if RUBY_VERSION.to_f < 1.9
$KCODE = "U"
end
-require "test/unit"
-
-$: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
-require File.join(File.expand_path(File.dirname(__FILE__)), "../init.rb")
-
class StringExtensionsTest < Test::Unit::TestCase
def test_to_html
require "rubygems"
View
2  test/test_helper.rb
@@ -0,0 +1,2 @@
+require 'test/unit'
+$: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
View
3  test/unicode_point_suite/basic_greek_test.rb
@@ -1,7 +1,6 @@
# encoding: UTF-8
require "test/unit"
-
-require File.join(File.expand_path(File.dirname(__FILE__)), "../../init.rb")
+require "stringex"
require File.join(File.expand_path(File.dirname(__FILE__)), "codepoint_test_helper.rb")
include CodepointTestHelper
View
3  test/unicode_point_suite/basic_latin_test.rb
@@ -1,7 +1,6 @@
# encoding: UTF-8
require "test/unit"
-
-require File.join(File.expand_path(File.dirname(__FILE__)), "../../init.rb")
+require "stringex"
require File.join(File.expand_path(File.dirname(__FILE__)), "codepoint_test_helper.rb")
include CodepointTestHelper
View
7 test/unidecoder_localization_alias_test.rb
@@ -1,9 +1,6 @@
# encoding: UTF-8
-
-require "test/unit"
-
-$: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
-require File.join(File.expand_path(File.dirname(__FILE__)), "../init.rb")
+require "test_helper"
+require "stringex"
class UnidecoderLocalizationAliasTest < Test::Unit::TestCase
def setup
View
7 test/unidecoder_localization_test.rb
@@ -1,9 +1,6 @@
# encoding: UTF-8
-
-require "test/unit"
-
-$: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
-require File.join(File.expand_path(File.dirname(__FILE__)), "../init.rb")
+require "test_helper"
+require "stringex"
class UnidecoderLocalizationTest < Test::Unit::TestCase
def setup
View
7 test/unidecoder_test.rb
@@ -1,9 +1,6 @@
# encoding: UTF-8
-
-require "test/unit"
-
-$: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
-require File.join(File.expand_path(File.dirname(__FILE__)), "../init.rb")
+require "test_helper"
+require "stringex"
class UnidecoderTest < Test::Unit::TestCase
# Silly phrases courtesy of Frank da Cruz
Please sign in to comment.
Something went wrong with that request. Please try again.