Skip to content

Commit 86f0f31

Browse files
Cleaner test case.
1 parent c383123 commit 86f0f31

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/refdb_test.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
require "test_helper"
22

3-
class TestBackend < Rugged::Refdb::Backend::Custom
4-
def compress
5-
puts "compress!"
6-
end
7-
end
8-
93
class RefdbTest < Rugged::TestCase
104
def setup
115
@repo = FixtureRepo.from_rugged("testrepo.git")
@@ -33,9 +27,16 @@ def test_set_backend_reuse_error
3327

3428
def test_custom_backend
3529
refdb = Rugged::Refdb.new(@repo)
30+
31+
compress_calls = 0
3632
backend = TestBackend.new(@repo)
33+
backend.send(:define_singleton_method, :compress) do
34+
compress_calls += 1
35+
end
3736

3837
refdb.backend = backend
3938
refdb.compress
39+
40+
assert_equal 1, compress_calls
4041
end
4142
end

0 commit comments

Comments
 (0)