We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c383123 commit 86f0f31Copy full SHA for 86f0f31
test/refdb_test.rb
@@ -1,11 +1,5 @@
1
require "test_helper"
2
3
-class TestBackend < Rugged::Refdb::Backend::Custom
4
- def compress
5
- puts "compress!"
6
- end
7
-end
8
-
9
class RefdbTest < Rugged::TestCase
10
def setup
11
@repo = FixtureRepo.from_rugged("testrepo.git")
@@ -33,9 +27,16 @@ def test_set_backend_reuse_error
33
27
34
28
def test_custom_backend
35
29
refdb = Rugged::Refdb.new(@repo)
30
+
31
+ compress_calls = 0
36
32
backend = TestBackend.new(@repo)
+ backend.send(:define_singleton_method, :compress) do
+ compress_calls += 1
+ end
37
38
refdb.backend = backend
39
refdb.compress
40
+ assert_equal 1, compress_calls
41
end
42
0 commit comments