placeholdit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/placeholdit.rb +1 -1
- data/lib/placeholdit/version.rb +1 -1
- data/spec/placeholdit_spec.rb +12 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3b8f2b508699eabb713806b141a99e2a2a17a0a
|
4
|
+
data.tar.gz: 6267cca22bd0bcce185062574af09e919462b0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff30bb8d4f4b0f5c1d23af9a427ec9d78c57fc135ff7991b20aa0ab2199f23737e30d4cff153d3d6813bc2b2dde1ade6e46fa1a64402bab438039c901c222044
|
7
|
+
data.tar.gz: 0a9fb474036253cd7027a185cafe5096cc79f77a463d294259649d88e83892bb69d282b9c08367469218b17337aa675d5e023c812486be06811fef2dea74bd1d
|
data/lib/placeholdit.rb
CHANGED
data/lib/placeholdit/version.rb
CHANGED
data/spec/placeholdit_spec.rb
CHANGED
@@ -8,42 +8,42 @@ describe Placeholdit::ViewHelpers do
|
|
8
8
|
let(:view) { MyView.new }
|
9
9
|
|
10
10
|
it "should accept integers as params" do
|
11
|
-
view.placeholdit_image_tag(500).
|
11
|
+
expect(view.placeholdit_image_tag(500)).to eq "<img src='https://placehold.it/500' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should accept a string" do
|
15
|
-
view.placeholdit_image_tag("500").
|
15
|
+
expect(view.placeholdit_image_tag("500")).to eq "<img src='https://placehold.it/500' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should accept a componded WxH" do
|
19
|
-
view.placeholdit_image_tag("500x500").
|
19
|
+
expect(view.placeholdit_image_tag("500x500")).to eq "<img src='https://placehold.it/500x500' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should accept custom text" do
|
23
|
-
view.placeholdit_image_tag("500x500", text: 'Buy me!').
|
23
|
+
expect(view.placeholdit_image_tag("500x500", text: 'Buy me!')).to eq "<img src='https://placehold.it/500x500&text=Buy me!' alt='Buy me!' class='placeholder' height='500' width='500' />"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should accept custom colors" do
|
27
|
-
view.placeholdit_image_tag("500", text_color: 'fff', background_color: '000').
|
27
|
+
expect(view.placeholdit_image_tag("500", text_color: 'fff', background_color: '000')).to eq "<img src='https://placehold.it/500/000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should strip the pound from hex colors" do
|
31
|
-
view.placeholdit_image_tag("500", text_color: '#fff', background_color: '000').
|
32
|
-
view.placeholdit_image_tag("500", text_color: '#fff', background_color: '#000000').
|
33
|
-
view.placeholdit_image_tag("500", text_color: 'fff', background_color: '#000000').
|
34
|
-
view.placeholdit_image_tag("500", text_color: 'ffffff', background_color: '#000000').
|
31
|
+
expect(view.placeholdit_image_tag("500", text_color: '#fff', background_color: '000')).to eq "<img src='https://placehold.it/500/000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
32
|
+
expect(view.placeholdit_image_tag("500", text_color: '#fff', background_color: '#000000')).to eq "<img src='https://placehold.it/500/000000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
33
|
+
expect(view.placeholdit_image_tag("500", text_color: 'fff', background_color: '#000000')).to eq "<img src='https://placehold.it/500/000000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
34
|
+
expect(view.placeholdit_image_tag("500", text_color: 'ffffff', background_color: '#000000')).to eq "<img src='https://placehold.it/500/000000/ffffff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should accept title" do
|
38
|
-
view.placeholdit_image_tag("500", title: "Lorem ipsum").
|
38
|
+
expect(view.placeholdit_image_tag("500", title: "Lorem ipsum")).to eq "<img src='https://placehold.it/500' alt='A placeholder image' class='placeholder' height='500' width='500' title='Lorem ipsum' />"
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should alias to placeholdit" do
|
42
|
-
view.placeholdit("500", text_color: 'fff', background_color: '000').
|
42
|
+
expect(view.placeholdit("500", text_color: 'fff', background_color: '000')).to eq "<img src='https://placehold.it/500/000/fff' alt='A placeholder image' class='placeholder' height='500' width='500' />"
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should accept style" do
|
46
|
-
view.placeholdit_image_tag("500", style: "float:right;").
|
46
|
+
expect(view.placeholdit_image_tag("500", style: "float:right;")).to eq "<img src='https://placehold.it/500' alt='A placeholder image' class='placeholder' height='500' width='500' style='float:right;' />"
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: placeholdit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Mehlhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|