File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,35 @@ class GridIOTest < Test::Unit::TestCase
122
122
end
123
123
end
124
124
125
+ context "Writing" do
126
+ setup do
127
+ @filename = 'test'
128
+ @length = 50000
129
+ @times = 10
130
+ end
131
+
132
+ should "correctly write multiple chunks from mutiple writes" do
133
+ file = GridIO . new ( @files , @chunks , @filename , 'w' )
134
+
135
+ @times . times do
136
+ file . write ( "1" * @length )
137
+ end
138
+
139
+ file . close
140
+
141
+ file = GridIO . new ( @files , @chunks , @filename , 'r' )
142
+
143
+ total_size = 0
144
+ while !file . eof?
145
+ total_size += file . read ( @length ) . length
146
+ end
147
+
148
+ file . close
149
+
150
+ assert_equal total_size , @times * @length
151
+ end
152
+ end
153
+
125
154
context "Seeking" do
126
155
setup do
127
156
@filename = 'test'
You can’t perform that action at this time.
0 commit comments