OSDN Git Service

t#30220:i18n system error message
[pettanr/pettanr.git] / lib / test / s3_picture_spec.rb
index 5d8eee7..b6fcfac 100644 (file)
@@ -55,9 +55,11 @@ describe PictureIO::S3Picture do
       end
     end
     context '例外が発生するとき' do
-      it 'falseが返る' do
+      it 'PictureIO::Error例外が発生する' do
         AWS::S3::S3Object.stub(:exist?).with(any_args()).and_raise(StandardError)
-        @io.exist?('test.get').should be_false
+        lambda {
+          @io.exist?('test.get')
+        }.should raise_error(PictureIO::Error)
       end
     end
   end
@@ -90,9 +92,11 @@ describe PictureIO::S3Picture do
       end
     end
     context '例外が発生するとき' do
-      it 'falseが返る' do
+      it 'PictureIO::Error例外が発生する' do
         AWS::S3::S3Object.stub(:get).with(any_args()).and_raise(StandardError)
-        @io.get('test.get').should be_false
+        lambda {
+          @io.get('test.get')
+        }.should raise_error(PictureIO::Error)
       end
     end
   end
@@ -116,9 +120,11 @@ describe PictureIO::S3Picture do
       end
     end
     context '例外が発生するとき' do
-      it 'falseが返る' do
+      it 'PictureIO::Error例外が発生する' do
         AWS::S3::S3Object.stub(:store).with(any_args()).and_raise(StandardError)
-        @io.put('bindata', 'test.put').should be_false
+        lambda {
+          @io.put('bindata', 'test.put')
+        }.should raise_error(PictureIO::Error)
       end
     end
   end
@@ -142,9 +148,11 @@ describe PictureIO::S3Picture do
       end
     end
     context '例外が発生するとき' do
-      it 'falseが返る' do
+      it 'PictureIO::Error例外が発生する' do
         AWS::S3::S3Object.stub(:delete).with(any_args()).and_raise(StandardError)
-        @io.delete('test.del.not.exist').should be_false
+        lambda {
+          @io.delete('test.del.not.exist')
+        }.should raise_error(PictureIO::Error)
       end
     end
   end