spec/hillary/slug/bucket_spec.rb in hillary-0.0.3 vs spec/hillary/slug/bucket_spec.rb in hillary-0.0.4
- old
+ new
@@ -23,9 +23,20 @@
before(:each){storage.directories.create(key: bucket_name)}
subject{Hillary::Slug::Bucket.new(bucket_name, access_key, secret_key)}
+ describe '#exists?' do
+ it 'returns false when the file does not exist' do
+ expect(subject.exists?(canonical_slug_path)).to be_falsy
+ end
+
+ it 'returns true when the file does exist' do
+ bucket.files.create(key: canonical_slug_path, body: StringIO.new(''), public: false)
+ expect(subject.exists?(canonical_slug_path)).to be_truthy
+ end
+ end
+
describe '#write' do
it 'writes the file to the bucket with the given name' do
subject.write(canonical_slug_path, slug_file_path)
expect(bucket.files.get(canonical_slug_path).body).to eq('')
end