push
travis-ci
3 of 3 new or added lines in 1 file covered. (100.0%)
78 existing lines in 13 files now uncovered.1807 of 1887 relevant lines covered (95.76%)
2186.06 hits per line
1 |
module Zip |
11✔ |
2 |
module IOExtras |
11✔ |
3 |
# Implements many of the output convenience methods of IO.
|
|
4 |
# relies on <<
|
|
5 |
module AbstractOutputStream |
11✔ |
6 |
include FakeIO
|
11✔ |
7 |
|
|
8 |
def write(data) |
11✔ |
9 |
self << data
|
814✔ |
10 |
data.to_s.bytesize |
803✔ |
11 |
end
|
|
12 |
|
|
13 |
def print(*params) |
11✔ |
14 |
self << params.join($,) << $\.to_s |
77✔ |
15 |
end
|
|
16 |
|
|
17 |
def printf(a_format_string, *params) |
11✔ |
18 |
self << format(a_format_string, *params)
|
11✔ |
19 |
end
|
|
20 |
|
|
21 |
def putc(an_object) |
11✔ |
22 |
self << case an_object |
16✔ |
23 |
when Integer |
|
24 |
an_object.chr |
11✔ |
25 |
when String |
|
26 |
an_object |
11✔ |
27 |
else
|
|
UNCOV
28
|
raise TypeError, 'putc: Only Integer and String supported' |
× |
29 |
end
|
10✔ |
30 |
an_object |
22✔ |
31 |
end
|
|
32 |
|
|
33 |
def puts(*params) |
11✔ |
34 |
params << "\n" if params.empty? |
77✔ |
35 |
params.flatten.each do |element|
|
77✔ |
36 |
val = element.to_s |
165✔ |
37 |
self << val
|
165✔ |
38 |
self << "\n" unless val[-1, 1] == "\n" |
154✔ |
39 |
end
|
|
40 |
end
|
|
41 |
end
|
|
42 |
end
|
|
43 |
end
|