@@ -19,7 +19,7 @@ class GridTest < Test::Unit::TestCase
1919 setup do
2020 @data = "GRIDDATA" * 50000
2121 @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' } )
2323 end
2424
2525 should "retrieve the stored data" do
@@ -58,7 +58,7 @@ class GridTest < Test::Unit::TestCase
5858 end
5959
6060 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 )
6262 file = @grid . get ( id )
6363 assert_equal 'sample' , file . filename
6464 assert_equal @metadata , file . metadata
@@ -106,7 +106,7 @@ class GridTest < Test::Unit::TestCase
106106 context "Storing data with a length of zero" do
107107 setup do
108108 @grid = Grid . new ( @db , 'test-fs' )
109- @id = @grid . put ( '' , 'sample' , :metadata => { 'app' => 'photos' } )
109+ @id = @grid . put ( '' , :filename => 'sample' , :metadata => { 'app' => 'photos' } )
110110 end
111111
112112 should "return the zero length" do
@@ -119,7 +119,7 @@ class GridTest < Test::Unit::TestCase
119119 setup do
120120 def read_and_write_stream ( filename , read_length , opts = { } )
121121 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 ) )
123123 file = @grid . get ( id )
124124 io . rewind
125125 data = io . read
0 commit comments