Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 9d823cc

Browse files
author
Brian Durand
committed
cleanup test require statements; remove *.rbc files from package
1 parent 23942a8 commit 9d823cc

12 files changed

+25
-24
lines changed

Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Rake::GemPackageTask.new(spec) do |p|
3131
p.gem_spec = spec
3232
end
3333
Rake.application["package"].prerequisites.unshift("java:build")
34+
Rake.application["package"].prerequisites.unshift("rbx:delete_rbc_files")
3435

3536
desc "Release to rubygems.org"
3637
task :release => :package do
@@ -65,6 +66,16 @@ namespace :java do
6566
end
6667
end
6768

69+
namespace :rbx do
70+
desc "Cleanup *.rbc files in lib directory"
71+
task :delete_rbc_files do
72+
FileList["lib/**/*.rbc"].each do |rbc_file|
73+
File.delete(rbc_file)
74+
end
75+
nil
76+
end
77+
end
78+
6879
namespace :test do
6980
namespace :performance do
7081
desc "Run a speed test on how long it takes to create 100000 weak references"

test/reference_key_map_behavior.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
32

43
module ReferenceKeyMapBehavior
54
def test_uses_the_proper_references

test/reference_queue_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
32

43
class TestReferenceQueue < Test::Unit::TestCase
54
def test_can_add_references

test/reference_value_map_behavior.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
32

43
module ReferenceValueMapBehavior
54
def test_keeps_entries_with_strong_references

test/soft_key_map_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
3-
require File.expand_path("../reference_key_map_behavior", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
42

53
class TestSoftKeyMap < Test::Unit::TestCase
64
include ReferenceKeyMapBehavior

test/soft_reference_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
32

43
class TestSoftReference < Test::Unit::TestCase
54
def test_can_get_non_garbage_collected_objects

test/soft_value_map_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
3-
require File.expand_path("../reference_value_map_behavior", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
42

53
class TestSoftValueMap < Test::Unit::TestCase
64
include ReferenceValueMapBehavior

test/strong_reference_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
32

43
class TestStrongReference < Test::Unit::TestCase
54
def test_can_get_objects

test/test_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test/unit'
2+
require File.expand_path("../../lib/ref", __FILE__)
3+
require File.expand_path("../reference_key_map_behavior", __FILE__)
4+
require File.expand_path("../reference_value_map_behavior", __FILE__)

test/weak_key_map_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
require 'test/unit'
2-
require File.expand_path("../../lib/ref", __FILE__)
3-
require File.expand_path("../reference_key_map_behavior", __FILE__)
1+
require File.expand_path("../test_helper", __FILE__)
42

53
class TestWeakKeyMap < Test::Unit::TestCase
64
include ReferenceKeyMapBehavior

0 commit comments

Comments
 (0)