diff --git a/Rakefile b/Rakefile index e664de4..e20047d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'test') + desc "Run tests" task :test do Dir['test/**/*_test.rb'].each { |file| require file } diff --git a/test/fake/file_test.rb b/test/fake/file_test.rb index 4dc5930..77c4290 100644 --- a/test/fake/file_test.rb +++ b/test/fake/file_test.rb @@ -1,6 +1,4 @@ -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib') -require 'fakefs/safe' -require 'test/unit' +require "test_helper" class FakeFileTest < Test::Unit::TestCase include FakeFS diff --git a/test/fake/symlink_test.rb b/test/fake/symlink_test.rb index d63208b..8eae46d 100644 --- a/test/fake/symlink_test.rb +++ b/test/fake/symlink_test.rb @@ -1,6 +1,4 @@ -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib') -require 'fakefs/safe' -require 'test/unit' +require "test_helper" class FakeSymlinkTest < Test::Unit::TestCase include FakeFS diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index 6de4556..a0863a4 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -1,6 +1,4 @@ -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') -require 'fakefs/safe' -require 'test/unit' +require "test_helper" class FakeFSTest < Test::Unit::TestCase include FakeFS diff --git a/test/safe_test.rb b/test/safe_test.rb index 4d9ace3..9db2de0 100644 --- a/test/safe_test.rb +++ b/test/safe_test.rb @@ -1,6 +1,4 @@ -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') -require 'fakefs/safe' -require 'test/unit' +require "test_helper" class FakeFSSafeTest < Test::Unit::TestCase def setup diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..745419d --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,3 @@ +$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') +require 'fakefs/safe' +require 'test/unit' diff --git a/test/verify.rb b/test/verify.rb index 8e5cb05..dddb993 100644 --- a/test/verify.rb +++ b/test/verify.rb @@ -3,8 +3,7 @@ # USAGE # # $ ruby test/verify.rb | grep "not implemented" -require 'fakefs/safe' -require 'test/unit' +require "test_helper" class FakeFSVerifierTest < Test::Unit::TestCase (RealFile.methods - Class.new.methods).each do |name|