preadly-bulbasaur 0.7.0 → 0.7.1
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75b989582785e56fa7033a634ef68f664118cc2b
|
4
|
+
data.tar.gz: a622c9d1db2fc88f0b053859bcd8e6ea3ec4ee69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a4cc64a0ea8f231b59f4446ca1319bece8f51ca41900d427c1fd4e585f3dba855919a2ca21da0314d903798a3bc124134c357ab1436adf4bdb7c6f4174626c
|
7
|
+
data.tar.gz: cb01394e15a2b9cd0e376d2b438ab4237398bc104b7fd1c93e0bf312d4cf485f7cba236a9dff04005ce398a1a0bcb25a9ee550af593379b7ff684da939505de2
|
data/lib/bulbasaur/version.rb
CHANGED
@@ -4,7 +4,7 @@ RSpec.describe Bulbasaur::NormalizeImageSources do
|
|
4
4
|
subject { described_class.new(html, target_attrs).call }
|
5
5
|
|
6
6
|
describe '#call' do
|
7
|
-
let(:html) { '<img src="http://somewhere.to/get/a-pixel.gif" data-lazy-src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200">' }
|
7
|
+
let(:html) { '<img src="http://somewhere.to/get/a-pixel.gif" data-lazy-src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200"><img src="http://somewhere.to/get/another-pixel.gif" data-image="http://somewhere.to/get/the-other-real-image.jpg"><img src="http://somewhere.to/get/a-third-pixel.gif" data-src="http://somewhere.to/get/the-third-real-image.jpg">' }
|
8
8
|
|
9
9
|
context 'when there are no target attributes' do
|
10
10
|
let(:target_attrs) { [] }
|
@@ -15,10 +15,10 @@ RSpec.describe Bulbasaur::NormalizeImageSources do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
context 'when there are target attributes' do
|
18
|
-
let(:target_attrs) { %w(data-lazy-src) }
|
18
|
+
let(:target_attrs) { %w(data-lazy-src data-image) }
|
19
19
|
|
20
|
-
it 'returns the HTML code with the image tags adjusted' do
|
21
|
-
expect(subject).to eq '<img src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200">'
|
20
|
+
it 'returns the HTML code with the specified image tags adjusted' do
|
21
|
+
expect(subject).to eq '<img src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200"><img src="http://somewhere.to/get/the-other-real-image.jpg"><img src="http://somewhere.to/get/a-third-pixel.gif" data-src="http://somewhere.to/get/the-third-real-image.jpg">'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|