@@ -8,11 +8,11 @@ def setup
88 end
99
1010 def test_placeholdit
11- refute_nil @tester . image . match ( %r{https://via \. placeholder \. com /(.+)(png?)} ) [ 1 ]
11+ refute_nil @tester . image . match ( %r{https://placehold \. co /(.+)(png?)} ) [ 1 ]
1212 end
1313
1414 def test_avatar_with_custom_size
15- assert_equal ( '3x3' , @tester . image ( size : '3x3' ) . match ( %r{https://via \. placeholder \. com /+(\d +x\d +)} ) [ 1 ] )
15+ assert_equal ( '3x3' , @tester . image ( size : '3x3' ) . match ( %r{https://placehold \. co /+(\d +x\d +)} ) [ 1 ] )
1616 end
1717
1818 def test_avatar_with_incorrect_size
@@ -22,7 +22,7 @@ def test_avatar_with_incorrect_size
2222 end
2323
2424 def test_avatar_with_supported_format
25- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)} , @tester . image ( size : '300x300' , format : 'jpg' )
25+ assert_match %r{https://placehold \. co /(.+)(jpg?)} , @tester . image ( size : '300x300' , format : 'jpg' )
2626 end
2727
2828 def test_avatar_with_incorrect_format
@@ -32,15 +32,15 @@ def test_avatar_with_incorrect_format
3232 end
3333
3434 def test_avatar_background_with_correct_six_char_hex
35- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/ffffff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'ffffff' )
35+ assert_match %r{https://placehold \. co /(.+)(jpg?)/ffffff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'ffffff' )
3636 end
3737
3838 def test_avatar_background_with_correct_three_char_hex
39- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/fff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' )
39+ assert_match %r{https://placehold \. co /(.+)(jpg?)/fff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' )
4040 end
4141
4242 def test_avatar_background_with_random_color
43- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/[a-f0-9]{6}} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : :random )
43+ assert_match %r{https://placehold \. co /(.+)(jpg?)/[a-f0-9]{6}} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : :random )
4444 end
4545
4646 def test_avatar_background_with_wrong_six_char_hex
@@ -62,15 +62,15 @@ def test_avatar_background_with_wrong_three_char_hex
6262 end
6363
6464 def test_avatar_font_color_with_correct_six_char_hex
65- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/ffffff/000000} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'ffffff' , text_color : '000000' )
65+ assert_match %r{https://placehold \. co /(.+)(jpg?)/ffffff/000000} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'ffffff' , text_color : '000000' )
6666 end
6767
6868 def test_avatar_font_color_with_correct_three_char_hex
69- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/fff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' )
69+ assert_match %r{https://placehold \. co /(.+)(jpg?)/fff} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' )
7070 end
7171
7272 def test_avatar_font_color_with_random_color
73- assert_match %r{https://via \. placeholder \. com /(.+)(jpg?)/fff/[a-f0-9]{6}} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : :random )
73+ assert_match %r{https://placehold \. co /(.+)(jpg?)/fff/[a-f0-9]{6}} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : :random )
7474 end
7575
7676 def test_avatar_font_color_with_wrong_six_char_hex
@@ -92,10 +92,10 @@ def test_avatar_font_color_with_wrong_three_char_hex
9292 end
9393
9494 def test_text_not_present
95- assert_match %r{https://via \. placeholder \. com /[^\\ ?]+$} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' )
95+ assert_match %r{https://placehold \. co /[^\\ ?]+$} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' )
9696 end
9797
9898 def test_text_present
99- assert_match %r{https://via \. placeholder \. com /(.+)\? text=hello} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' , text : 'hello' )
99+ assert_match %r{https://placehold \. co /(.+)\? text=hello} , @tester . image ( size : '300x300' , format : 'jpg' , background_color : 'fff' , text_color : '000' , text : 'hello' )
100100 end
101101end
0 commit comments