require File.expand_path "../test_helper", __FILE__ context "Rugged::Blob tests" do setup do @path = File.dirname(__FILE__) + '/fixtures/testrepo.git/' @repo = Rugged::Repository.new(@path) @oid = "fa49b077972391ad58037050f2a75f74e3671e92" end test "can read the blob data" do blob = @repo.lookup(@oid) assert_equal 9, blob.size assert_equal "new file\n", blob.content assert_equal :blob, blob.type assert_equal @oid, blob.oid end test "can write new blob data" do oid = Rugged::Blob.create(@repo, "a new blob content") rm_loose(oid) end test "gets the complete content if it has nulls" do content = "100644 example_helper.rb\x00\xD3\xD5\xED\x9DA4_"+ "\xE3\xC3\nK\xCD