travis-ci
50 of 50 new or added lines in 2 files covered. (100.0%)
805 of 839 relevant lines covered (95.95%)
58.13 hits per line
1 |
require 'forwardable'
|
7 all except jruby-head ✔ |
2 |
|
|
3 |
module Wisper |
7 all except jruby-head ✔ |
4 |
class Configuration |
7 all except jruby-head ✔ |
5 |
attr_reader :broadcasters
|
7 all except jruby-head ✔ |
6 |
|
|
7 |
def initialize |
7 all except jruby-head ✔ |
8 |
@broadcasters = Broadcasters.new |
21 all except jruby-head ✔ |
9 |
end
|
|
10 |
|
|
11 |
def broadcaster(name, broadcaster) |
7 all except jruby-head ✔ |
12 |
@broadcasters[name] = broadcaster
|
91 all except jruby-head ✔ |
13 |
end
|
|
14 |
|
|
15 |
class Broadcasters |
7 all except jruby-head ✔ |
16 |
extend Forwardable
|
7 all except jruby-head ✔ |
17 |
|
|
18 |
def_delegators :@data, :fetch, :[], :[]=, :empty?, :include?, :clear |
7 all except jruby-head ✔ |
19 |
|
|
20 |
def initialize |
7 all except jruby-head ✔ |
21 |
@data = {}
|
21 all except jruby-head ✔ |
22 |
end
|
|
23 |
|
|
24 |
def fetch(key) |
7 all except jruby-head ✔ |
25 |
raise KeyError, "broadcaster not found for #{key}" unless include?(key) |
355 all except jruby-head ✔ |
26 |
@data[key]
|
372 all except jruby-head ✔ |
27 |
end
|
|
28 |
end
|
|
29 |
end
|
|
30 |
end
|