@@ -19,7 +19,7 @@ class GridTest < Test::Unit::TestCase
19
19
setup do
20
20
@data = "GRIDDATA" * 50000
21
21
@grid = Grid . new ( @db , 'test-fs' )
22
- @id = @grid . put ( @data , 'sample' , :metadata => { 'app' => 'photos' } )
22
+ @id = @grid . put ( @data , :filename => 'sample' , :metadata => { 'app' => 'photos' } )
23
23
end
24
24
25
25
should "retrieve the stored data" do
@@ -58,7 +58,7 @@ class GridTest < Test::Unit::TestCase
58
58
end
59
59
60
60
should "store the file with the old filename api" do
61
- id = @grid . put ( @data , 'sample' , :metadata => @metadata )
61
+ id = @grid . put ( @data , :filename => 'sample' , :metadata => @metadata )
62
62
file = @grid . get ( id )
63
63
assert_equal 'sample' , file . filename
64
64
assert_equal @metadata , file . metadata
@@ -106,7 +106,7 @@ class GridTest < Test::Unit::TestCase
106
106
context "Storing data with a length of zero" do
107
107
setup do
108
108
@grid = Grid . new ( @db , 'test-fs' )
109
- @id = @grid . put ( '' , 'sample' , :metadata => { 'app' => 'photos' } )
109
+ @id = @grid . put ( '' , :filename => 'sample' , :metadata => { 'app' => 'photos' } )
110
110
end
111
111
112
112
should "return the zero length" do
@@ -119,7 +119,7 @@ class GridTest < Test::Unit::TestCase
119
119
setup do
120
120
def read_and_write_stream ( filename , read_length , opts = { } )
121
121
io = File . open ( File . join ( File . dirname ( __FILE__ ) , 'data' , filename ) , 'r' )
122
- id = @grid . put ( io , filename + read_length . to_s , opts )
122
+ id = @grid . put ( io , opts . merge! ( : filename => filename + read_length . to_s ) )
123
123
file = @grid . get ( id )
124
124
io . rewind
125
125
data = io . read
0 commit comments