asset_cloud 2.5.3 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  class BlackholeCloud < AssetCloud::Base
@@ -8,7 +9,7 @@ describe BlackholeCloud do
8
9
  directory = File.dirname(__FILE__) + '/files'
9
10
 
10
11
  before do
11
- @fs = BlackholeCloud.new(directory , 'http://assets/files' )
12
+ @fs = BlackholeCloud.new(directory, 'http://assets/files')
12
13
  end
13
14
 
14
15
  it "should allow access to files using the [] operator" do
@@ -16,12 +17,12 @@ describe BlackholeCloud do
16
17
  end
17
18
 
18
19
  it "should return nil for non existent files" do
19
- @fs['tmp/image.jpg'].exist?.should == false
20
+ expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
20
21
  end
21
22
 
22
23
  it "should still return nil, even if you wrote something there" do
23
24
  @fs['tmp/image.jpg'] = 'test'
24
- @fs['tmp/image.jpg'].exist?.should == false
25
+ expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
25
26
  end
26
27
 
27
28
  describe "when using a sub path" do
@@ -30,12 +31,12 @@ describe BlackholeCloud do
30
31
  end
31
32
 
32
33
  it "should return nil for non existent files" do
33
- @fs['tmp/image.jpg'].exist?.should == false
34
+ expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
34
35
  end
35
36
 
36
37
  it "should still return nil, even if you wrote something there" do
37
38
  @fs['tmp/image.jpg'] = 'test'
38
- @fs['tmp/image.jpg'].exist?.should == false
39
+ expect(@fs['tmp/image.jpg'].exist?).to(eq(false))
39
40
  end
40
41
  end
41
42
  end
@@ -1,58 +1,59 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  class ChainedCloud < AssetCloud::Base
4
- bucket :stuff, AssetCloud::BucketChain.chain( AssetCloud::MemoryBucket,
5
+ bucket :stuff, AssetCloud::BucketChain.chain(AssetCloud::MemoryBucket,
5
6
  AssetCloud::MemoryBucket,
6
- AssetCloud::FileSystemBucket )
7
+ AssetCloud::FileSystemBucket)
7
8
 
8
- bucket :versioned_stuff, AssetCloud::BucketChain.chain( AssetCloud::FileSystemBucket,
9
+ bucket :versioned_stuff, AssetCloud::BucketChain.chain(AssetCloud::FileSystemBucket,
9
10
  AssetCloud::VersionedMemoryBucket,
10
- AssetCloud::MemoryBucket )
11
+ AssetCloud::MemoryBucket)
11
12
  end
12
13
 
13
14
  describe AssetCloud::BucketChain do
14
15
  directory = File.dirname(__FILE__) + '/files'
15
16
 
16
17
  before(:each) do
17
- @cloud = ChainedCloud.new(directory , 'http://assets/files' )
18
+ @cloud = ChainedCloud.new(directory, 'http://assets/files')
18
19
  @bucket_chain = @cloud.buckets[:stuff]
19
20
  @chained_buckets = @bucket_chain.chained_buckets
20
- @chained_buckets.each {|b| b.ls('stuff').each {|asset| asset.delete}}
21
+ @chained_buckets.each { |b| b.ls('stuff').each(&:delete) }
21
22
 
22
23
  @versioned_stuff = @cloud.buckets[:versioned_stuff]
23
24
  end
24
25
 
25
26
  describe ".chain" do
26
27
  it 'should take multiple Bucket classes and return a new Bucket class' do
27
- @bucket_chain.should be_a_kind_of(AssetCloud::BucketChain)
28
+ expect(@bucket_chain).to(be_a_kind_of(AssetCloud::BucketChain))
28
29
  end
29
30
  end
30
31
 
31
32
  describe "#write" do
32
33
  it 'should write to each sub-bucket when everything is kosher and return the result of the first write' do
33
34
  @chained_buckets.each do |bucket|
34
- bucket.should_receive(:write).with('stuff/foo', 'successful creation').and_return('successful creation')
35
+ expect(bucket).to(receive(:write).with('stuff/foo', 'successful creation').and_return('successful creation'))
35
36
  end
36
37
 
37
- @bucket_chain.write('stuff/foo', 'successful creation').should == 'successful creation'
38
+ expect(@bucket_chain.write('stuff/foo', 'successful creation')).to(eq('successful creation'))
38
39
  end
39
40
  it 'should roll back creation-writes and re-raise an error when a bucket raises one' do
40
- @chained_buckets.last.should_receive(:write).with('stuff/foo', 'unsuccessful creation').and_raise('hell')
41
+ expect(@chained_buckets.last).to(receive(:write).with('stuff/foo', 'unsuccessful creation').and_raise('hell'))
41
42
  @chained_buckets[0..-2].each do |bucket|
42
- bucket.should_receive(:write).with('stuff/foo', 'unsuccessful creation').and_return(true)
43
- bucket.should_receive(:delete).with('stuff/foo').and_return(true)
43
+ expect(bucket).to(receive(:write).with('stuff/foo', 'unsuccessful creation').and_return(true))
44
+ expect(bucket).to(receive(:delete).with('stuff/foo').and_return(true))
44
45
  end
45
46
 
46
- lambda { @bucket_chain.write('stuff/foo', 'unsuccessful creation') }.should raise_error(RuntimeError)
47
+ expect { @bucket_chain.write('stuff/foo', 'unsuccessful creation') }.to(raise_error(RuntimeError))
47
48
  end
48
49
  it 'should roll back update-writes and re-raise an error when a bucket raises one' do
49
50
  @bucket_chain.write('stuff/foo', "original value")
50
51
 
51
- @chained_buckets.last.should_receive(:write).with('stuff/foo', 'new value').and_raise('hell')
52
+ expect(@chained_buckets.last).to(receive(:write).with('stuff/foo', 'new value').and_raise('hell'))
52
53
 
53
- lambda { @bucket_chain.write('stuff/foo', 'new value') }.should raise_error(RuntimeError)
54
+ expect { @bucket_chain.write('stuff/foo', 'new value') }.to(raise_error(RuntimeError))
54
55
  @chained_buckets.each do |bucket|
55
- bucket.read('stuff/foo').should == 'original value'
56
+ expect(bucket.read('stuff/foo')).to(eq('original value'))
56
57
  end
57
58
  end
58
59
  end
@@ -62,7 +63,7 @@ describe AssetCloud::BucketChain do
62
63
  @bucket_chain.write('stuff/foo', "successful deletion comin' up")
63
64
 
64
65
  @chained_buckets.each do |bucket|
65
- bucket.should_receive(:delete).with('stuff/foo').and_return(true)
66
+ expect(bucket).to(receive(:delete).with('stuff/foo').and_return(true))
66
67
  end
67
68
 
68
69
  @bucket_chain.delete('stuff/foo')
@@ -70,47 +71,46 @@ describe AssetCloud::BucketChain do
70
71
  it 'should roll back deletions and re-raise an error when a bucket raises one' do
71
72
  @bucket_chain.write('stuff/foo', "this deletion will fail")
72
73
 
73
- @chained_buckets.last.should_receive(:delete).with('stuff/foo').and_raise('hell')
74
+ expect(@chained_buckets.last).to(receive(:delete).with('stuff/foo').and_raise('hell'))
74
75
  @chained_buckets[0..-2].each do |bucket|
75
- bucket.should_receive(:delete).with('stuff/foo').and_return(true)
76
- bucket.should_receive(:write).with('stuff/foo', 'this deletion will fail').and_return(true)
76
+ expect(bucket).to(receive(:delete).with('stuff/foo').and_return(true))
77
+ expect(bucket).to(receive(:write).with('stuff/foo', 'this deletion will fail').and_return(true))
77
78
  end
78
79
 
79
- lambda { @bucket_chain.delete('stuff/foo') }.should raise_error(RuntimeError)
80
+ expect { @bucket_chain.delete('stuff/foo') }.to(raise_error(RuntimeError))
80
81
  end
81
82
  end
82
83
 
83
84
  describe "#read" do
84
85
  it 'should read from only the first available sub-bucket' do
85
- @chained_buckets[0].should_receive(:read).with('stuff/foo').and_raise(NotImplementedError)
86
- @chained_buckets[0].should_receive(:ls).with(nil).and_raise(NoMethodError)
87
- @chained_buckets[0].should_receive(:stat).and_return(:metadata)
86
+ expect(@chained_buckets[0]).to(receive(:read).with('stuff/foo').and_raise(NotImplementedError))
87
+ expect(@chained_buckets[0]).to(receive(:ls).with(nil).and_raise(NoMethodError))
88
+ expect(@chained_buckets[0]).to(receive(:stat).and_return(:metadata))
88
89
 
89
- @chained_buckets[1].should_receive(:read).with('stuff/foo').and_return('bar')
90
- @chained_buckets[1].should_receive(:ls).with(nil).and_return(:some_assets)
91
- @chained_buckets[1].should_not_receive(:stat)
90
+ expect(@chained_buckets[1]).to(receive(:read).with('stuff/foo').and_return('bar'))
91
+ expect(@chained_buckets[1]).to(receive(:ls).with(nil).and_return(:some_assets))
92
+ expect(@chained_buckets[1]).not_to(receive(:stat))
92
93
 
93
94
  @chained_buckets[2..-1].each do |bucket|
94
- bucket.should_not_receive(:read)
95
- bucket.should_not_receive(:ls)
96
- bucket.should_not_receive(:stat)
95
+ expect(bucket).not_to(receive(:read))
96
+ expect(bucket).not_to(receive(:ls))
97
+ expect(bucket).not_to(receive(:stat))
97
98
  end
98
99
 
99
- @bucket_chain.read('stuff/foo').should == 'bar'
100
- @bucket_chain.ls.should == :some_assets
101
- @bucket_chain.stat.should == :metadata
100
+ expect(@bucket_chain.read('stuff/foo')).to(eq('bar'))
101
+ expect(@bucket_chain.ls).to(eq(:some_assets))
102
+ expect(@bucket_chain.stat).to(eq(:metadata))
102
103
  end
103
104
  end
104
105
 
105
-
106
106
  describe "#read_version" do
107
107
  it 'should read from only the first available sub-bucket' do
108
108
  buckets = @versioned_stuff.chained_buckets
109
109
 
110
- buckets[1].should_receive(:read_version).with('stuff/foo',3).and_return('bar')
111
- buckets.last.should_not_receive(:read_version)
110
+ expect(buckets[1]).to(receive(:read_version).with('stuff/foo', 3).and_return('bar'))
111
+ expect(buckets.last).not_to(receive(:read_version))
112
112
 
113
- @versioned_stuff.read_version('stuff/foo', 3).should == 'bar'
113
+ expect(@versioned_stuff.read_version('stuff/foo', 3)).to(eq('bar'))
114
114
  end
115
115
  end
116
116
 
@@ -118,10 +118,10 @@ describe AssetCloud::BucketChain do
118
118
  it 'should read from only the first available sub-bucket' do
119
119
  buckets = @versioned_stuff.chained_buckets
120
120
 
121
- buckets[1].should_receive(:versions).with('versioned_stuff/foo').and_return([1,2,3])
122
- buckets.last.should_not_receive(:versions)
121
+ expect(buckets[1]).to(receive(:versions).with('versioned_stuff/foo').and_return([1, 2, 3]))
122
+ expect(buckets.last).not_to(receive(:versions))
123
123
 
124
- @versioned_stuff.versions('versioned_stuff/foo').should == [1,2,3]
124
+ expect(@versioned_stuff.versions('versioned_stuff/foo')).to(eq([1, 2, 3]))
125
125
  end
126
126
  end
127
127
 
@@ -131,28 +131,28 @@ describe AssetCloud::BucketChain do
131
131
  @cloud['versioned_stuff/foo'] = content
132
132
  end
133
133
  asset = @cloud['versioned_stuff/foo']
134
- asset.value.should == 'three'
135
- asset.rollback(1).value.should == 'one'
136
- asset.versions.should == [1,2,3]
134
+ expect(asset.value).to(eq('three'))
135
+ expect(asset.rollback(1).value).to(eq('one'))
136
+ expect(asset.versions).to(eq([1, 2, 3]))
137
137
  asset.value = 'four'
138
138
  asset.store
139
- asset.versions.should == [1,2,3,4]
139
+ expect(asset.versions).to(eq([1, 2, 3, 4]))
140
140
  end
141
141
  end
142
142
 
143
143
  describe '#respond_to?' do
144
144
  it 'should return true if any chained buckets respond to the given method' do
145
- @bucket_chain.respond_to?(:foo).should == false
146
- @chained_buckets[1].should_receive(:respond_to?).with(:bar).and_return(true)
147
- @bucket_chain.respond_to?(:bar).should == true
145
+ expect(@bucket_chain.respond_to?(:foo)).to(eq(false))
146
+ expect(@chained_buckets[1]).to(receive(:respond_to?).with(:bar).and_return(true))
147
+ expect(@bucket_chain.respond_to?(:bar)).to(eq(true))
148
148
  end
149
149
  end
150
150
 
151
151
  describe '#method_missing' do
152
152
  it 'should try each bucket' do
153
- @chained_buckets[1].should_receive(:buzz).and_return(true)
154
- @chained_buckets[2].should_not_receive(:buzz)
155
- @bucket_chain.buzz.should == true
153
+ expect(@chained_buckets[1]).to(receive(:buzz).and_return(true))
154
+ expect(@chained_buckets[2]).not_to(receive(:buzz))
155
+ expect(@bucket_chain.buzz).to(eq(true))
156
156
  end
157
157
  end
158
158
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe AssetCloud::Bucket do
@@ -7,19 +8,19 @@ describe AssetCloud::Bucket do
7
8
 
8
9
  describe "operations not supported" do
9
10
  it "#ls not supported" do
10
- expect { @bucket.ls('foo')}.to raise_error NotImplementedError
11
+ expect { @bucket.ls('foo') }.to(raise_error(NotImplementedError))
11
12
  end
12
13
 
13
14
  it "#read(key) not supported" do
14
- expect { @bucket.read('foo')}.to raise_error NotImplementedError
15
+ expect { @bucket.read('foo') }.to(raise_error(NotImplementedError))
15
16
  end
16
17
 
17
18
  it "#write(key, data) not supported" do
18
- expect { @bucket.write('foo', 'bar')}.to raise_error NotImplementedError
19
+ expect { @bucket.write('foo', 'bar') }.to(raise_error(NotImplementedError))
19
20
  end
20
21
 
21
22
  it "#delete(key) not supported" do
22
- expect { @bucket.delete('foo')}.to raise_error NotImplementedError
23
+ expect { @bucket.delete('foo') }.to(raise_error(NotImplementedError))
23
24
  end
24
25
  end
25
26
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  class CallbackAsset < AssetCloud::Asset
@@ -21,12 +22,12 @@ class CallbackAsset < AssetCloud::Asset
21
22
  end
22
23
 
23
24
  def valid_value
24
- add_error 'value is not "valid"' unless value == 'valid'
25
+ add_error('value is not "valid"') unless value == 'valid'
25
26
  end
26
27
  end
27
28
 
28
29
  class BasicCloud < AssetCloud::Base
29
- bucket :callback_assets, AssetCloud::MemoryBucket, :asset_class => CallbackAsset
30
+ bucket :callback_assets, AssetCloud::MemoryBucket, asset_class: CallbackAsset
30
31
  end
31
32
 
32
33
  class CallbackCloud < AssetCloud::Base
@@ -39,6 +40,7 @@ class CallbackCloud < AssetCloud::Base
39
40
  before_write :callback_before_write
40
41
 
41
42
  def callback_before_write(*args); end
43
+
42
44
  def callback_after_write(*args); end
43
45
  end
44
46
 
@@ -50,7 +52,7 @@ class MethodRecordingCloud < AssetCloud::Base
50
52
  before_write :callback_before_write
51
53
  after_write :callback_before_write
52
54
 
53
- def method_missing(method, *args)
55
+ def method_missing(method, *_args)
54
56
  @run_callbacks << method.to_sym
55
57
  end
56
58
  end
@@ -62,38 +64,36 @@ describe CallbackCloud do
62
64
  end
63
65
 
64
66
  it "should invoke callbacks after store" do
65
- @fs.should_receive(:callback_before_write).with('tmp/file.txt', 'text').and_return(true)
66
- @fs.should_receive(:callback_after_write).with('tmp/file.txt', 'text').and_return(true)
67
-
67
+ expect(@fs).to(receive(:callback_before_write).with('tmp/file.txt', 'text').and_return(true))
68
+ expect(@fs).to(receive(:callback_after_write).with('tmp/file.txt', 'text').and_return(true))
68
69
 
69
- @fs.write('tmp/file.txt', 'text').should == true
70
- @fs.read('tmp/file.txt').should == 'text'
70
+ expect(@fs.write('tmp/file.txt', 'text')).to(eq(true))
71
+ expect(@fs.read('tmp/file.txt')).to(eq('text'))
71
72
  end
72
73
 
73
74
  it "should invoke callbacks after delete" do
74
- @fs.should_receive(:callback_before_delete).with('tmp/file.txt').and_return(true)
75
- @fs.should_receive(:callback_after_delete).with('tmp/file.txt').and_return(true)
75
+ expect(@fs).to(receive(:callback_before_delete).with('tmp/file.txt').and_return(true))
76
+ expect(@fs).to(receive(:callback_after_delete).with('tmp/file.txt').and_return(true))
76
77
 
77
- @fs.delete('tmp/file.txt').should == 'foo'
78
+ expect(@fs.delete('tmp/file.txt')).to(eq('foo'))
78
79
  end
79
80
 
80
81
  it "should not invoke other callbacks when a before_ filter returns false" do
81
- @fs.should_receive(:callback_before_delete)
82
+ expect(@fs).to(receive(:callback_before_delete)
82
83
  .with('tmp/file.txt')
83
- .and_return(false)
84
- @fs.should_not_receive(:callback_after_delete)
84
+ .and_return(false))
85
+ expect(@fs).not_to(receive(:callback_after_delete))
85
86
 
86
- @fs.delete('tmp/file.txt').should == nil
87
+ expect(@fs.delete('tmp/file.txt')).to(eq(nil))
87
88
  end
88
89
 
89
90
  it "should invoke callbacks even when constructing a new asset" do
90
- @fs.should_receive(:callback_before_write).with('tmp/file.txt', 'hello').and_return(true)
91
- @fs.should_receive(:callback_after_write).with('tmp/file.txt', 'hello').and_return(true)
92
-
91
+ expect(@fs).to(receive(:callback_before_write).with('tmp/file.txt', 'hello').and_return(true))
92
+ expect(@fs).to(receive(:callback_after_write).with('tmp/file.txt', 'hello').and_return(true))
93
93
 
94
94
  asset = @fs.build('tmp/file.txt')
95
95
  asset.value = 'hello'
96
- asset.store.should == true
96
+ expect(asset.store).to(eq(true))
97
97
  end
98
98
  end
99
99
 
@@ -105,12 +105,12 @@ describe MethodRecordingCloud do
105
105
 
106
106
  it 'should record event when invoked' do
107
107
  @fs.write('tmp/file.txt', 'random data')
108
- @fs.run_callbacks.should == [:callback_before_write, :callback_before_write]
108
+ expect(@fs.run_callbacks).to(eq([:callback_before_write, :callback_before_write]))
109
109
  end
110
110
 
111
111
  it 'should record event when assignment operator is used' do
112
112
  @fs['tmp/file.txt'] = 'random data'
113
- @fs.run_callbacks.should == [:callback_before_write, :callback_before_write]
113
+ expect(@fs.run_callbacks).to(eq([:callback_before_write, :callback_before_write]))
114
114
  end
115
115
  end
116
116
 
@@ -122,25 +122,25 @@ describe CallbackAsset do
122
122
  end
123
123
 
124
124
  it "should run before_validate, then validate, then after validate, then before_store, then store" do
125
- @asset.should_receive(:callback_before_store).and_return(true)
126
- @asset.should_not_receive(:callback_after_delete)
125
+ expect(@asset).to(receive(:callback_before_store).and_return(true))
126
+ expect(@asset).not_to(receive(:callback_after_delete))
127
127
 
128
128
  @asset.value = 'foo'
129
- @asset.store.should == true
130
- @asset.value.should == 'valid spice'
129
+ expect(@asset.store).to(eq(true))
130
+ expect(@asset.value).to(eq('valid spice'))
131
131
  end
132
132
 
133
133
  it "should run its after_delete callback after delete is called" do
134
- @asset.should_not_receive(:callback_before_store)
135
- @asset.should_receive(:callback_after_delete).and_return(true)
134
+ expect(@asset).not_to(receive(:callback_before_store))
135
+ expect(@asset).to(receive(:callback_after_delete).and_return(true))
136
136
 
137
- @asset.delete.should == 'bar'
137
+ expect(@asset.delete).to(eq('bar'))
138
138
  end
139
139
 
140
140
  it "not invoke other callbacks when a before_ filter returns false" do
141
- @asset.should_receive(:callback_before_delete).and_return(false)
142
- @asset.should_not_receive(:callback_after_delete)
141
+ expect(@asset).to(receive(:callback_before_delete).and_return(false))
142
+ expect(@asset).not_to(receive(:callback_after_delete))
143
143
 
144
- @asset.delete.should == nil
144
+ expect(@asset.delete).to(eq(nil))
145
145
  end
146
146
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
  require 'fileutils'
3
4
 
@@ -7,12 +8,11 @@ class FileSystemCloud < AssetCloud::Base
7
8
  bucket :tmp, AssetCloud::FileSystemBucket
8
9
  end
9
10
 
10
-
11
11
  describe FileSystemCloud do
12
12
  directory = File.dirname(__FILE__) + '/files'
13
13
 
14
14
  before do
15
- @fs = FileSystemCloud.new(directory , 'http://assets/files' )
15
+ @fs = FileSystemCloud.new(directory, 'http://assets/files')
16
16
  FileUtils.mkdir_p(directory + '/tmp')
17
17
  end
18
18
 
@@ -21,31 +21,31 @@ describe FileSystemCloud do
21
21
  end
22
22
 
23
23
  it "should use invalid bucket for random directories" do
24
- @fs.bucket_for('does-not-exist/file.txt').should be_an_instance_of(AssetCloud::InvalidBucket)
24
+ expect(@fs.bucket_for('does-not-exist/file.txt')).to(be_an_instance_of(AssetCloud::InvalidBucket))
25
25
  end
26
26
 
27
27
  it "should use filesystem bucket for products/ and tmp/ directories" do
28
- @fs.bucket_for('products/file.txt').should be_an_instance_of(AssetCloud::FileSystemBucket)
29
- @fs.bucket_for('tmp/file.txt').should be_an_instance_of(AssetCloud::FileSystemBucket)
28
+ expect(@fs.bucket_for('products/file.txt')).to(be_an_instance_of(AssetCloud::FileSystemBucket))
29
+ expect(@fs.bucket_for('tmp/file.txt')).to(be_an_instance_of(AssetCloud::FileSystemBucket))
30
30
  end
31
31
 
32
32
  it "should return Asset for existing files" do
33
- @fs['products/key.txt'].exist?.should == true
34
- @fs['products/key.txt'].should be_an_instance_of(AssetCloud::Asset)
33
+ expect(@fs['products/key.txt'].exist?).to(eq(true))
34
+ expect(@fs['products/key.txt']).to(be_an_instance_of(AssetCloud::Asset))
35
35
  end
36
36
 
37
37
  it "should be able to test if a file exists or not" do
38
- @fs.stat('products/key.txt').exist?.should == true
39
- @fs.stat('products/key2.txt').exist?.should == false
38
+ expect(@fs.stat('products/key.txt').exist?).to(eq(true))
39
+ expect(@fs.stat('products/key2.txt').exist?).to(eq(false))
40
40
  end
41
41
 
42
42
  it "should be able to list files" do
43
- @fs.ls('products').collect(&:key).should == ['products/key.txt']
43
+ expect(@fs.ls('products').collect(&:key)).to(eq(['products/key.txt']))
44
44
  end
45
45
 
46
46
  describe 'when modifying file system' do
47
47
  it "should call write after storing an asset" do
48
- @fs.buckets[:tmp].should_receive(:write).with('tmp/new_file.test', 'hello world').and_return(true)
48
+ expect(@fs.buckets[:tmp]).to(receive(:write).with('tmp/new_file.test', 'hello world').and_return(true))
49
49
 
50
50
  @fs.build('tmp/new_file.test', 'hello world').store
51
51
  end
@@ -53,21 +53,20 @@ describe FileSystemCloud do
53
53
  it "should be able to create new files" do
54
54
  @fs.build('tmp/new_file.test', 'hello world').store
55
55
 
56
- @fs.stat('tmp/new_file.test').exist.should == true
56
+ expect(@fs.stat('tmp/new_file.test').exist).to(eq(true))
57
57
  end
58
58
 
59
59
  it "should be able to create new files with simple assignment" do
60
60
  @fs['tmp/new_file.test'] = 'hello world'
61
61
 
62
- @fs.stat('tmp/new_file.test').exist.should == true
62
+ expect(@fs.stat('tmp/new_file.test').exist).to(eq(true))
63
63
  end
64
64
 
65
65
  it "should create directories as needed" do
66
66
  @fs.build('tmp/new_file.test', 'hello world').store
67
67
 
68
- @fs['tmp/new_file.test'].exist?.should == true
69
- @fs['tmp/new_file.test'].value.should == 'hello world'
68
+ expect(@fs['tmp/new_file.test'].exist?).to(eq(true))
69
+ expect(@fs['tmp/new_file.test'].value).to(eq('hello world'))
70
70
  end
71
-
72
71
  end
73
72
  end