@@ -8,28 +8,46 @@ def setup
8
8
end
9
9
10
10
def test_fillmurray
11
- refute_nil @tester . image ( grayscale : false , width : '300' , height : '300' ) . match ( %r{https://www\. fillmurray\. com/(\d +)/(\d +)} )
11
+ Gem ::Deprecate . skip_during do
12
+ refute_nil @tester . image ( grayscale : false , width : '300' , height : '300' ) . match ( %r{https://www\. fillmurray\. com/(\d +)/(\d +)} )
13
+ end
14
+ end
15
+
16
+ def test_image_deprecation_message
17
+ _out , err = capture_output do
18
+ @tester . image ( grayscale : false , width : '300' , height : '300' )
19
+ end
20
+
21
+ assert_match ( /Faker::Fillmurray.image is deprecated; use Faker::LoremFlickr.image instead\. / , err )
12
22
end
13
23
14
24
def test_fillmurray_with_grayscale
15
- assert_equal ( 'g/' , @tester . image ( grayscale : true , width : '300' , height : '300' ) . match ( %r{https://www\. fillmurray\. com/(g?/?)(\d +)/(\d +)} ) [ 1 ] )
25
+ Gem ::Deprecate . skip_during do
26
+ assert_equal ( 'g/' , @tester . image ( grayscale : true , width : '300' , height : '300' ) . match ( %r{https://www\. fillmurray\. com/(g?/?)(\d +)/(\d +)} ) [ 1 ] )
27
+ end
16
28
end
17
29
18
30
def test_fillmurray_with_incorrect_height_format
19
- assert_raise ArgumentError do
20
- @tester . image ( grayscale : false , width : '300' , height : 'nine-thousand' )
31
+ Gem ::Deprecate . skip_during do
32
+ assert_raise ArgumentError do
33
+ @tester . image ( grayscale : false , width : '300' , height : 'nine-thousand' )
34
+ end
21
35
end
22
36
end
23
37
24
38
def test_fillmurray_with_incorrect_width_format
25
- assert_raise ArgumentError do
26
- @tester . image ( grayscale : false , width : 'three-hundred' )
39
+ Gem ::Deprecate . skip_during do
40
+ assert_raise ArgumentError do
41
+ @tester . image ( grayscale : false , width : 'three-hundred' )
42
+ end
27
43
end
28
44
end
29
45
30
46
def test_fillmurray_with_incorrect_grayscale
31
- assert_raise ArgumentError do
32
- @tester . image ( grayscale : 'gray' , width : '300' , height : '400' )
47
+ Gem ::Deprecate . skip_during do
48
+ assert_raise ArgumentError do
49
+ @tester . image ( grayscale : 'gray' , width : '300' , height : '400' )
50
+ end
33
51
end
34
52
end
35
53
end
0 commit comments