dassets 0.14.1 → 0.15.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.
Files changed (41) hide show
  1. checksums.yaml +7 -7
  2. data/.ruby-version +1 -0
  3. data/Gemfile +3 -1
  4. data/README.md +15 -17
  5. data/dassets.gemspec +7 -6
  6. data/lib/dassets.rb +54 -11
  7. data/lib/dassets/asset_file.rb +14 -12
  8. data/lib/dassets/cache.rb +27 -33
  9. data/lib/dassets/config.rb +55 -47
  10. data/lib/dassets/engine.rb +11 -23
  11. data/lib/dassets/file_store.rb +27 -27
  12. data/lib/dassets/server.rb +27 -28
  13. data/lib/dassets/server/request.rb +43 -41
  14. data/lib/dassets/server/response.rb +93 -81
  15. data/lib/dassets/source.rb +13 -8
  16. data/lib/dassets/source_file.rb +100 -82
  17. data/lib/dassets/source_proxy.rb +32 -16
  18. data/lib/dassets/version.rb +3 -1
  19. data/test/helper.rb +18 -24
  20. data/test/support/app.rb +3 -5
  21. data/test/support/factory.rb +1 -2
  22. data/test/support/{public/nested/file3-d41d8cd98f00b204e9800998ecf8427e.txt → linked_source_files/linked_file.txt} +0 -0
  23. data/test/support/source_files/linked +1 -0
  24. data/test/support/source_files/linked_file2.txt +1 -0
  25. data/test/system/rack_tests.rb +55 -59
  26. data/test/unit/asset_file_tests.rb +64 -60
  27. data/test/unit/cache_tests.rb +14 -35
  28. data/test/unit/config_tests.rb +65 -45
  29. data/test/unit/dassets_tests.rb +41 -23
  30. data/test/unit/engine_tests.rb +7 -43
  31. data/test/unit/file_store_tests.rb +42 -31
  32. data/test/unit/server/request_tests.rb +48 -53
  33. data/test/unit/server/response_tests.rb +79 -81
  34. data/test/unit/server_tests.rb +3 -9
  35. data/test/unit/source_file_tests.rb +73 -72
  36. data/test/unit/source_proxy_tests.rb +78 -89
  37. data/test/unit/source_tests.rb +58 -50
  38. metadata +78 -70
  39. data/test/support/public/file2-9bbe1047cffbb590f59e0e5aeff46ae4.txt +0 -1
  40. data/test/support/public/grumpy_cat-b0d1f399a916f7a25c4c0f693c619013.jpg +0 -0
  41. data/test/support/public/nested/a-thing.txt-7413d18f2eba9c695a880aff67fde135.no-use +0 -4
@@ -1,17 +1,11 @@
1
- require 'assert'
2
- require 'dassets/server'
1
+ require "assert"
2
+ require "dassets/server"
3
3
 
4
4
  class Dassets::Server
5
-
6
5
  class UnitTests < Assert::Context
7
6
  desc "Dassets::Server"
8
- setup do
9
- @server = Dassets::Server.new('a rack app goes here')
10
- end
11
- subject{ @server }
7
+ subject { Dassets::Server.new("test rack app") }
12
8
 
13
9
  should have_imeths :call, :call!
14
-
15
10
  end
16
-
17
11
  end
@@ -1,19 +1,18 @@
1
- require 'assert'
2
- require 'dassets/source_file'
1
+ require "assert"
2
+ require "dassets/source_file"
3
3
 
4
- require 'dassets/asset_file'
5
- require 'dassets/cache'
6
- require 'dassets/source_proxy'
4
+ require "dassets/asset_file"
5
+ require "dassets/cache"
6
+ require "dassets/source_proxy"
7
7
 
8
8
  class Dassets::SourceFile
9
-
10
9
  class UnitTests < Assert::Context
11
10
  desc "Dassets::SourceFile"
11
+ subject { Dassets::SourceFile.new(@file_path) }
12
+
12
13
  setup do
13
- @file_path = TEST_SUPPORT_PATH.join('app/assets/file1.txt').to_s
14
- @source_file = Dassets::SourceFile.new(@file_path)
14
+ @file_path = TEST_SUPPORT_PATH.join("app/assets/file1.txt").to_s
15
15
  end
16
- subject{ @source_file }
17
16
 
18
17
  should have_readers :file_path
19
18
  should have_imeths :source, :asset_file, :digest_path
@@ -21,74 +20,97 @@ class Dassets::SourceFile
21
20
  should have_cmeth :find_by_digest_path
22
21
 
23
22
  should "know its file path" do
24
- assert_equal @file_path.to_s, subject.file_path
23
+ assert_that(subject.file_path).equals(@file_path.to_s)
25
24
  end
26
25
 
27
26
  should "know its configured source" do
28
- exp_source = Dassets.config.sources.select{ |s| @file_path.include?(s.path) }.last
29
- assert_equal exp_source, subject.source
27
+ exp_source =
28
+ Dassets.config.sources.select{ |s| @file_path.include?(s.path) }.last
29
+ assert_that(subject.source).equals(exp_source)
30
30
  end
31
31
 
32
32
  should "know its asset file" do
33
- assert_kind_of Dassets::AssetFile, subject.asset_file
34
- assert_equal Dassets::AssetFile.new(subject.digest_path), subject.asset_file
33
+ assert_that(subject.asset_file).is_kind_of(Dassets::AssetFile)
34
+ assert_that(subject.asset_file)
35
+ .equals(Dassets::AssetFile.new(subject.digest_path))
35
36
  end
36
37
 
37
38
  should "know its digest path" do
38
- assert_equal 'file1.txt', subject.digest_path
39
+ assert_that(subject.digest_path).equals("file1.txt")
39
40
  end
40
41
 
41
42
  should "not memoize its compiled source" do
42
43
  compiled1 = subject.compiled
43
44
  compiled2 = subject.compiled
44
- assert_not_same compiled2, compiled1
45
+ assert_that(compiled2).is_not(compiled1)
45
46
  end
46
47
 
47
48
  should "know if it exists" do
48
- assert subject.exists?
49
+ assert_that(subject.exists?).is_true
49
50
  end
50
51
 
51
52
  should "use the mtime of its file as its mtime" do
52
- assert_equal File.mtime(subject.file_path), subject.mtime
53
+ assert_that(subject.mtime).equals(File.mtime(subject.file_path))
53
54
  end
54
55
 
55
56
  should "use the response headers of its source as its response headers" do
56
- assert_same subject.source.response_headers, subject.response_headers
57
+ assert_that(subject.response_headers).is(subject.source.response_headers)
57
58
  end
58
59
 
59
60
  should "be findable by its digest path" do
60
61
  found = Dassets::SourceFile.find_by_digest_path(subject.digest_path)
61
62
 
62
- assert_equal subject, found
63
- assert_not_same subject, found
63
+ assert_that(found).equals(subject)
64
+ assert_that(found).is_not(subject)
65
+ end
66
+ end
67
+
68
+ class EngineTests < UnitTests
69
+ desc "compiled against engines"
70
+
71
+ setup do
72
+ @file_path =
73
+ TEST_SUPPORT_PATH.join("app/assets/nested/a-thing.txt.useless.dumb")
64
74
  end
65
75
 
76
+ should "build the digest path appropriately" do
77
+ assert_that(subject.digest_path).equals("nested/a-thing.txt.no-use")
78
+ end
79
+
80
+ should "compile the source content appropriately" do
81
+ file_content = File.read(@file_path)
82
+ exp_compiled_content = [file_content, "DUMB", "USELESS"].join("\n")
83
+ assert_that(subject.compiled).equals(exp_compiled_content)
84
+ end
66
85
  end
86
+ end
67
87
 
68
- class NullSourceTests < UnitTests
88
+ class Dassets::NullSourceFile
89
+ class UnitTests < Assert::Context
69
90
  setup do
70
- Dassets.config.combination 'file3.txt', ['file1.txt', 'file2.txt']
91
+ Dassets.config.combination "file3.txt", ["file1.txt", "file2.txt"]
71
92
  end
93
+
72
94
  teardown do
73
- Dassets.config.combinations.delete('file3.txt')
95
+ Dassets.config.combinations.delete("file3.txt")
74
96
  end
75
97
 
76
98
  should "find a null src file if finding by an unknown digest path" do
77
- null_src = Dassets::NullSourceFile.new('not/found/digest/path')
78
- found = Dassets::SourceFile.find_by_digest_path('not/found/digest/path')
99
+ null_src = Dassets::NullSourceFile.new("not/found/digest/path")
100
+ found = Dassets::SourceFile.find_by_digest_path("not/found/digest/path")
79
101
 
80
- assert_equal null_src, found
81
- assert_not_same null_src, found
102
+ assert_that(found).equals(null_src)
103
+ assert_that(found).is_not(null_src)
82
104
 
83
- assert_equal '', null_src.file_path
84
- assert_equal false, null_src.exists?
85
- assert_nil null_src.compiled
86
- assert_nil null_src.mtime
87
- assert_equal Hash.new, null_src.response_headers
105
+ assert_that(null_src.file_path).equals("")
106
+ assert_that(null_src.exists?).equals(false)
107
+ assert_that(null_src.compiled).is_nil
108
+ assert_that(null_src.mtime).is_nil
109
+ assert_that(null_src.response_headers).equals(Hash.new)
88
110
  end
89
111
 
90
112
  should "pass options to a null src when finding by an unknown digest path" do
91
- null_src = Dassets::NullSourceFile.new('not/found/digest/path')
113
+ null_src = Dassets::NullSourceFile.new("not/found/digest/path")
92
114
  null_src_new_called_with = []
93
115
  Assert.stub(Dassets::NullSourceFile, :new) do |*args|
94
116
  null_src_new_called_with = args
@@ -96,26 +118,26 @@ class Dassets::SourceFile
96
118
  end
97
119
 
98
120
  options = {
99
- :content_cache => Dassets::Cache::NoCache.new,
100
- :fingerprint_cache => Dassets::Cache::NoCache.new
121
+ content_cache: Dassets::NoCache.new,
122
+ fingerprint_cache: Dassets::NoCache.new,
101
123
  }
102
- Dassets::SourceFile.find_by_digest_path('not/found/digest/path', options)
124
+ Dassets::SourceFile.find_by_digest_path("not/found/digest/path", **options)
103
125
 
104
- exp = ['not/found/digest/path', options]
105
- assert_equal exp, null_src_new_called_with
126
+ exp = ["not/found/digest/path", options]
127
+ assert_that(null_src_new_called_with).equals(exp)
106
128
  end
107
129
 
108
- should "'proxy' the digest path if the path is a combination" do
109
- src_proxy = Dassets::SourceProxy.new('file3.txt')
110
- null_combo_src = Dassets::NullSourceFile.new('file3.txt')
130
+ should "proxy the digest path if the path is a combination" do
131
+ src_proxy = Dassets::SourceProxy.new("file3.txt")
132
+ null_combo_src = Dassets::NullSourceFile.new("file3.txt")
111
133
 
112
- assert_equal src_proxy.exists?, null_combo_src.exists?
113
- assert_equal src_proxy.content, null_combo_src.compiled
114
- assert_equal src_proxy.mtime, null_combo_src.mtime
134
+ assert_that(null_combo_src.exists?).equals(src_proxy.exists?)
135
+ assert_that(null_combo_src.compiled).equals(src_proxy.content)
136
+ assert_that(null_combo_src.mtime).equals(src_proxy.mtime)
115
137
  end
116
138
 
117
139
  should "pass options to its source proxy when the path is a combination" do
118
- src_proxy = Dassets::SourceProxy.new('file3.txt')
140
+ src_proxy = Dassets::SourceProxy.new("file3.txt")
119
141
  src_proxy_new_called_with = []
120
142
  Assert.stub(Dassets::SourceProxy, :new) do |*args|
121
143
  src_proxy_new_called_with = args
@@ -123,34 +145,13 @@ class Dassets::SourceFile
123
145
  end
124
146
 
125
147
  options = {
126
- :content_cache => Dassets::Cache::NoCache.new,
127
- :fingerprint_cache => Dassets::Cache::NoCache.new
148
+ content_cache: Dassets::NoCache.new,
149
+ fingerprint_cache: Dassets::NoCache.new,
128
150
  }
129
- Dassets::NullSourceFile.new('file3.txt', options)
151
+ Dassets::NullSourceFile.new("file3.txt", **options)
130
152
 
131
- exp = ['file3.txt', options]
132
- assert_equal exp, src_proxy_new_called_with
153
+ exp = ["file3.txt", options]
154
+ assert_that(src_proxy_new_called_with).equals(exp)
133
155
  end
134
-
135
156
  end
136
-
137
- class EngineTests < UnitTests
138
- desc "compiled against engines"
139
- setup do
140
- @file_path = TEST_SUPPORT_PATH.join('app/assets/nested/a-thing.txt.useless.dumb')
141
- @source_file = Dassets::SourceFile.new(@file_path)
142
- end
143
-
144
- should "build the digest path appropriately" do
145
- assert_equal 'nested/a-thing.txt.no-use', subject.digest_path
146
- end
147
-
148
- should "compile the source content appropriately" do
149
- file_content = File.read(@file_path)
150
- exp_compiled_content = [ file_content, 'DUMB', 'USELESS' ].join("\n")
151
- assert_equal exp_compiled_content, subject.compiled
152
- end
153
-
154
- end
155
-
156
157
  end
@@ -1,213 +1,202 @@
1
- require 'assert'
2
- require 'dassets/source_proxy'
1
+ require "assert"
2
+ require "dassets/source_proxy"
3
3
 
4
- require 'digest/md5'
5
- require 'dassets/cache'
6
- require 'dassets/source_file'
7
- require 'dassets/source_proxy'
4
+ require "digest/md5"
5
+ require "dassets/cache"
6
+ require "dassets/source_file"
7
+ require "dassets/source_proxy"
8
8
 
9
9
  class Dassets::SourceProxy
10
-
11
10
  class UnitTests < Assert::Context
12
11
  desc "Dassets::SourceProxy"
13
- setup do
14
- @source_proxy = Dassets::SourceProxy.new(Factory.string)
15
- end
16
- subject{ @source_proxy }
12
+ subject { Dassets::SourceProxy.new(Factory.string) }
17
13
 
18
14
  should have_readers :digest_path, :content_cache, :fingerprint_cache
19
15
  should have_readers :source_files
20
16
  should have_imeths :key, :content, :fingerprint, :mtime, :response_headers
21
17
  should have_imeths :exists?
22
-
23
18
  end
24
19
 
25
20
  class NotComboTests < UnitTests
26
21
  desc "when the digest path is not a combination"
27
- setup do
28
- @source_proxy = Dassets::SourceProxy.new('file1.txt')
29
- end
22
+ subject { Dassets::SourceProxy.new("file1.txt") }
30
23
 
31
24
  should "know its digest path" do
32
- assert_equal 'file1.txt', subject.digest_path
25
+ assert_that(subject.digest_path).equals("file1.txt")
33
26
  end
34
27
 
35
28
  should "use no cache by default" do
36
- assert_kind_of Dassets::Cache::NoCache, subject.content_cache
37
- assert_kind_of Dassets::Cache::NoCache, subject.fingerprint_cache
29
+ assert_that(subject.content_cache).is_kind_of(Dassets::NoCache)
30
+ assert_that(subject.fingerprint_cache).is_kind_of(Dassets::NoCache)
38
31
  end
39
32
 
40
33
  should "have a single source file" do
41
- assert_equal 1, subject.source_files.size
42
- exp = Dassets::SourceFile.find_by_digest_path('file1.txt')
43
- assert_equal exp, subject.source_files.first
34
+ assert_that(subject.source_files.size).equals(1)
35
+ exp = Dassets::SourceFile.find_by_digest_path("file1.txt")
36
+ assert_that(subject.source_files.first).equals(exp)
44
37
  end
45
38
 
46
39
  should "use its digest path and mtime as its key" do
47
40
  exp = "#{subject.digest_path} -- #{subject.mtime}"
48
- assert_equal exp, subject.key
41
+ assert_that(subject.key).equals(exp)
49
42
  end
50
43
 
51
44
  should "get its content from the compiled source of the single source file" do
52
- assert_equal subject.source_files.first.compiled, subject.content
45
+ assert_that(subject.content).equals(subject.source_files.first.compiled)
53
46
  end
54
47
 
55
48
  should "get its fingerprint by MD5 hashing the content" do
56
49
  exp = Digest::MD5.new.hexdigest(subject.content)
57
- assert_equal exp, subject.fingerprint
50
+ assert_that(subject.fingerprint).equals(exp)
58
51
  end
59
52
 
60
53
  should "use its single source file's max mtime as its mtime" do
61
- assert_equal subject.source_files.first.mtime, subject.mtime
54
+ assert_that(subject.mtime).equals(subject.source_files.first.mtime)
62
55
  end
63
56
 
64
57
  should "use its single source file's response headers as its resonse headers" do
65
- assert_equal subject.source_files.first.response_headers, subject.response_headers
58
+ assert_that(subject.response_headers)
59
+ .equals(subject.source_files.first.response_headers)
66
60
  end
67
61
 
68
62
  should "exist if its single source file exists" do
69
- assert_equal subject.source_files.first.exists?, subject.exists?
63
+ assert_that(subject.exists?).equals(subject.source_files.first.exists?)
70
64
  end
71
-
72
65
  end
73
66
 
74
67
  class ComboSetupTests < UnitTests
75
68
  setup do
76
- Dassets.config.combination 'file3.txt', ['file1.txt', 'file2.txt']
77
- Dassets.config.combination 'file4.txt', []
78
- Dassets.config.combination 'file5.txt', ['file3.txt', 'file4.txt']
69
+ Dassets.config.combination "file3.txt", ["file1.txt", "file2.txt"]
70
+ Dassets.config.combination "file4.txt", []
71
+ Dassets.config.combination "file5.txt", ["file3.txt", "file4.txt"]
79
72
  end
73
+
80
74
  teardown do
81
- Dassets.config.combinations.delete('file5.txt')
82
- Dassets.config.combinations.delete('file4.txt')
83
- Dassets.config.combinations.delete('file3.txt')
75
+ Dassets.config.combinations.delete("file5.txt")
76
+ Dassets.config.combinations.delete("file4.txt")
77
+ Dassets.config.combinations.delete("file3.txt")
84
78
  end
85
-
86
79
  end
87
80
 
88
81
  class ComboTests < ComboSetupTests
89
82
  desc "when the digest path is a combination to multiple source files"
83
+ subject { Dassets::SourceProxy.new("file3.txt") }
84
+
90
85
  setup do
91
86
  @exp_source_files = [
92
- Dassets::SourceFile.find_by_digest_path('file1.txt'),
93
- Dassets::SourceFile.find_by_digest_path('file2.txt')
87
+ Dassets::SourceFile.find_by_digest_path("file1.txt"),
88
+ Dassets::SourceFile.find_by_digest_path("file2.txt")
94
89
  ]
95
- @source_proxy = Dassets::SourceProxy.new('file3.txt')
96
90
  end
97
91
 
98
92
  should "know its digest path" do
99
- assert_equal 'file3.txt', subject.digest_path
93
+ assert_that(subject.digest_path).equals("file3.txt")
100
94
  end
101
95
 
102
96
  should "know its source files" do
103
- assert_equal 2, subject.source_files.size
104
- assert_equal @exp_source_files, subject.source_files
97
+ assert_that(subject.source_files.size).equals(2)
98
+ assert_that(subject.source_files).equals(@exp_source_files)
105
99
  end
106
100
 
107
101
  should "get its content from the compiled source of its source files" do
108
- exp = subject.source_files.map{ |f| f.compiled }.join("\n")
109
- assert_equal exp, subject.content
102
+ exp = subject.source_files.map { |f| f.compiled }.join("\n")
103
+ assert_that(subject.content).equals(exp)
110
104
  end
111
105
 
112
106
  should "use its source files' max mtime as its mtime" do
113
- exp = subject.source_files.map{ |f| f.mtime }.max
114
- assert_equal exp, subject.mtime
107
+ exp = subject.source_files.map { |f| f.mtime }.max
108
+ assert_that(subject.mtime).equals(exp)
115
109
  end
116
110
 
117
111
  should "use its source files' merged response headers as its response headers" do
118
- exp = subject.source_files.inject(Hash.new) do |hash, file|
119
- hash.merge!(file.response_headers)
120
- end
121
- assert_equal exp, subject.response_headers
112
+ exp =
113
+ subject.source_files.reduce(Hash.new) { |hash, file|
114
+ hash.merge!(file.response_headers)
115
+ }
116
+ assert_that(subject.response_headers).equals(exp)
122
117
  end
123
118
 
124
119
  should "exist if its all its source files exist" do
125
- exp = subject.source_files.inject(true){ |res, f| res && f.exists? }
126
- assert_equal exp, subject.exists?
120
+ exp = subject.source_files.reduce(true) { |res, f| res && f.exists? }
121
+ assert_that(subject.exists?).equals(exp)
127
122
  end
128
-
129
123
  end
130
124
 
131
125
  class EmptyComboTests < ComboSetupTests
132
126
  desc "when the digest path is an empty combination"
133
- setup do
134
- @source_proxy = Dassets::SourceProxy.new('file4.txt')
135
- end
127
+ subject { Dassets::SourceProxy.new("file4.txt") }
136
128
 
137
129
  should "not have any source files" do
138
- assert_equal 0, subject.source_files.size
130
+ assert_that(subject.source_files.size).equals(0)
139
131
  end
140
132
 
141
133
  should "have empty content" do
142
- assert_equal '', subject.content
134
+ assert_that(subject.content).equals("")
143
135
  end
144
136
 
145
137
  should "have no mtime" do
146
- assert_nil subject.mtime
138
+ assert_that(subject.mtime).is_nil
147
139
  end
148
140
 
149
141
  should "exist" do
150
- assert_true subject.exists?
142
+ assert_that(subject.exists?).is_true
151
143
  end
152
-
153
144
  end
154
145
 
155
146
  class ComboWithEmptyComboTests < ComboSetupTests
156
- desc "when the digest path is a combination that includes an empty combination"
157
- setup do
158
- @source_proxy = Dassets::SourceProxy.new('file5.txt')
159
- end
147
+ desc "when the digest path is a combination that includes an empty "\
148
+ "combination"
149
+ subject { Dassets::SourceProxy.new("file5.txt") }
160
150
 
161
151
  should "ignore the mtime of the empty combination" do
162
- exp_mtime = subject.source_files.map{ |f| f.mtime }.compact.max
163
- assert_equal exp_mtime, subject.mtime
152
+ exp_mtime = subject.source_files.map { |f| f.mtime }.compact.max
153
+ assert_that(subject.mtime).equals(exp_mtime)
164
154
  end
165
-
166
155
  end
167
156
 
168
157
  class NoCacheTests < UnitTests
169
158
  desc "with a `NoCache` cache handler"
170
- setup do
171
- @cache = Dassets::Cache::NoCache.new
172
- @source_proxy = Dassets::SourceProxy.new('file1.txt', {
173
- :content_cache => @cache,
174
- :fingerprint_cache => @cache
175
- })
176
- end
159
+ subject {
160
+ cache = Dassets::NoCache.new
161
+ Dassets::SourceProxy.new(
162
+ "file1.txt",
163
+ content_cache: cache,
164
+ fingerprint_cache: cache,
165
+ )
166
+ }
177
167
 
178
168
  should "not cache its source content/fingerprint" do
179
169
  content1 = subject.content
180
170
  content2 = subject.content
181
- assert_not_same content2, content1
171
+ assert_that(content2).is_not(content1)
182
172
 
183
173
  finger1 = subject.fingerprint
184
174
  finger2 = subject.fingerprint
185
- assert_not_same finger2, finger1
175
+ assert_that(finger2).is_not(finger1)
186
176
  end
187
-
188
177
  end
189
178
 
190
179
  class MemCacheTests < UnitTests
191
180
  desc "with a `MemCache` cache handler"
192
- setup do
193
- @content_cache = Dassets::Cache::MemCache.new
194
- @fingerprint_cache = Dassets::Cache::MemCache.new
195
- @source_proxy = Dassets::SourceProxy.new('file1.txt', {
196
- :content_cache => @content_cache,
197
- :fingerprint_cache => @fingerprint_cache
198
- })
199
- end
181
+ subject {
182
+ content_cache = Dassets::MemCache.new
183
+ fingerprint_cache = Dassets::MemCache.new
184
+
185
+ Dassets::SourceProxy.new(
186
+ "file1.txt",
187
+ content_cache: content_cache,
188
+ fingerprint_cache: fingerprint_cache,
189
+ )
190
+ }
200
191
 
201
192
  should "cache its source content/fingerprint in memory" do
202
193
  content1 = subject.content
203
194
  content2 = subject.content
204
- assert_same content2, content1
195
+ assert_that(content2).is(content1)
205
196
 
206
197
  finger1 = subject.fingerprint
207
198
  finger2 = subject.fingerprint
208
- assert_same finger2, finger1
199
+ assert_that(finger2).is(finger1)
209
200
  end
210
-
211
201
  end
212
-
213
202
  end