Skip to content

Commit 3a6d994

Browse files
committed
fixes for caching test on jruby
diff --git a/test/caching_test.rb b/test/caching_test.rb index 4ccef91..c6d9808 100644 --- a/test/caching_test.rb +++ b/test/caching_test.rb @@ -1,4 +1,5 @@ require File.expand_path('../support/test_helper', __FILE__) +require 'tempfile' class CachingTestTest < Minitest::Test def setup @@ -6,8 +7,10 @@ class CachingTestTest < Minitest::Test end def teardown - @schema.close - @schema.unlink + if @Schema + @schema.close + @schema.unlink + end JSON::Validator.clear_cache end
1 parent c045ab9 commit 3a6d994

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/caching_test.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
require File.expand_path('../support/test_helper', __FILE__)
2+
require 'tempfile'
23

34
class CachingTestTest < Minitest::Test
45
def setup
56
@schema = Tempfile.new(['schema', '.json'])
67
end
78

89
def teardown
9-
@schema.close
10-
@schema.unlink
10+
if @schema
11+
@schema.close
12+
@schema.unlink
13+
end
1114

1215
JSON::Validator.clear_cache
1316
end

0 commit comments

Comments
 (0)