Extract common requires in test files to test/test_helper.rb Run individual spec files with RUBYLIB=test ruby test/<test-file> (Thanks mislav)

This commit is contained in:
Scott Taylor 2009-12-02 02:52:37 -05:00
parent 52462b0e46
commit c2ccf482b9
7 changed files with 10 additions and 14 deletions

View File

@ -1,3 +1,5 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'test')
desc "Run tests" desc "Run tests"
task :test do task :test do
Dir['test/**/*_test.rb'].each { |file| require file } Dir['test/**/*_test.rb'].each { |file| require file }

View File

@ -1,6 +1,4 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib') require "test_helper"
require 'fakefs/safe'
require 'test/unit'
class FakeFileTest < Test::Unit::TestCase class FakeFileTest < Test::Unit::TestCase
include FakeFS include FakeFS

View File

@ -1,6 +1,4 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib') require "test_helper"
require 'fakefs/safe'
require 'test/unit'
class FakeSymlinkTest < Test::Unit::TestCase class FakeSymlinkTest < Test::Unit::TestCase
include FakeFS include FakeFS

View File

@ -1,6 +1,4 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') require "test_helper"
require 'fakefs/safe'
require 'test/unit'
class FakeFSTest < Test::Unit::TestCase class FakeFSTest < Test::Unit::TestCase
include FakeFS include FakeFS

View File

@ -1,6 +1,4 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') require "test_helper"
require 'fakefs/safe'
require 'test/unit'
class FakeFSSafeTest < Test::Unit::TestCase class FakeFSSafeTest < Test::Unit::TestCase
def setup def setup

3
test/test_helper.rb Normal file
View File

@ -0,0 +1,3 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'fakefs/safe'
require 'test/unit'

View File

@ -3,8 +3,7 @@
# USAGE # USAGE
# #
# $ ruby test/verify.rb | grep "not implemented" # $ ruby test/verify.rb | grep "not implemented"
require 'fakefs/safe' require "test_helper"
require 'test/unit'
class FakeFSVerifierTest < Test::Unit::TestCase class FakeFSVerifierTest < Test::Unit::TestCase
(RealFile.methods - Class.new.methods).each do |name| (RealFile.methods - Class.new.methods).each do |name|