You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test in backup_tests.rb, namly these guys: describe '#backup' do, aren't actually testing anything.
They only test mock calls because of allow expect. I can delete every function like, tar, zip, upload and the tests are still green after subject.upload.
I'm order to actually test s3_client, AWS files need to be mocked because of fakefs. For a working example have a look at client_test.rb after the PR has been merged.
Example spoofing AWS
before(:all)do# Using doubles without context is unsupported. with_temporary_scope to the rescue.RSpec::Mocks.with_temporary_scopedoallow(Aws::S3::Client).toreceive(:new).and_return(instance_double(Aws::S3::Client))endend
...
Aws.config[:s3]={stub_responses: {list_objects: {contents: contents}}}
The text was updated successfully, but these errors were encountered:
The test in backup_tests.rb, namly these guys:
describe '#backup' do
, aren't actually testing anything.They only test mock calls because of allow expect. I can delete every function like, tar, zip, upload and the tests are still green after subject.upload.
I'm order to actually test s3_client, AWS files need to be mocked because of fakefs. For a working example have a look at client_test.rb after the PR has been merged.
Example spoofing AWS
The text was updated successfully, but these errors were encountered: