summaryrefslogtreecommitdiffstats
path: root/tests/units/test_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/test_object.rb')
-rw-r--r--tests/units/test_object.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/units/test_object.rb b/tests/units/test_object.rb
index 543f021..427992b 100644
--- a/tests/units/test_object.rb
+++ b/tests/units/test_object.rb
@@ -102,6 +102,15 @@ class TestObject < Test::Unit::TestCase
o = @git.gblob('v2.6:example.txt')
assert_equal('replace with new text', o.contents)
assert_equal('replace with new text', o.contents) # this should be cached
+
+ # make sure the block is called
+ block_called = false
+ o.contents do |f|
+ block_called = true
+ assert_equal('replace with new text', f.read.chomp)
+ end
+
+ assert(block_called)
end
def test_revparse