@@ -42,15 +42,15 @@ def setup
42
42
test "read static BINARY asset" do
43
43
data = @env [ 'binary.png' ] . to_s
44
44
assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " . force_encoding ( "BINARY" ) ,
45
- @env [ 'binary.png' ] . to_s [ 0 ..10 ]
45
+ data [ 0 ..10 ]
46
46
assert_equal Encoding . find ( 'BINARY' ) , data . encoding
47
47
end
48
48
49
49
test "read processed BINARY asset" do
50
50
@env . register_postprocessor ( 'image/png' , :noop_processor ) { |context , data | data }
51
51
data = @env [ 'binary.png' ] . to_s
52
52
assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " . force_encoding ( "BINARY" ) ,
53
- @env [ 'binary.png' ] . to_s [ 0 ..10 ]
53
+ data [ 0 ..10 ]
54
54
assert_equal Encoding . find ( 'BINARY' ) , data . encoding
55
55
end
56
56
else
@@ -79,13 +79,13 @@ def setup
79
79
80
80
test "read static BINARY asset" do
81
81
data = @env [ 'binary.png' ] . to_s
82
- assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " , @env [ 'binary.png' ] . to_s [ 0 ..10 ]
82
+ assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " , data [ 0 ..10 ]
83
83
end
84
84
85
85
test "read processed BINARY asset" do
86
86
@env . register_postprocessor ( 'image/png' , :noop_processor ) { |context , data | data }
87
87
data = @env [ 'binary.png' ] . to_s
88
- assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " , @env [ 'binary.png' ] . to_s [ 0 ..10 ]
88
+ assert_equal "\x89 PNG\r \n \x1A \n \x00 \x00 \x00 " , data [ 0 ..10 ]
89
89
end
90
90
end
91
91
end
0 commit comments