rmuh 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +6 -6
- data/Rakefile +3 -6
- data/examples/basic_parsing.rb +41 -0
- data/examples/basic_serverstats.rb +22 -0
- data/examples/serverstats_advanced.rb +26 -0
- data/examples/serverstats_cache.rb +35 -0
- data/lib/rmuh/serverstats/advanced.rb +2 -2
- data/lib/rmuh/serverstats/base.rb +2 -0
- data/lib/rmuh/version.rb +1 -1
- data/spec/examples_spec.rb +46 -0
- data/spec/rmuh_rpt_log_fetch_spec.rb +17 -15
- data/spec/rmuh_rpt_log_parsers_base_spec.rb +30 -7
- data/spec/rmuh_rpt_log_parsers_unitedoperationslog_spec.rb +66 -60
- data/spec/rmuh_rpt_log_parsers_unitedoperationsrpt_spec.rb +21 -20
- data/spec/rmuh_rpt_log_util_unitedoperations_spec.rb +51 -51
- data/spec/rmuh_rpt_log_util_unitedoperationslog_spec.rb +25 -21
- data/spec/rmuh_rpt_log_util_unitedoperationsrpt_spec.rb +68 -63
- data/spec/rmuh_rpt_spec.rb +8 -8
- data/spec/rmuh_serverstats_base_spec.rb +39 -23
- metadata +7 -1
@@ -11,56 +11,60 @@ describe RMuh::RPT::Log::Util::UnitedOperationsLog do
|
|
11
11
|
|
12
12
|
context '::ONE_DAY' do
|
13
13
|
it 'should be an instance of Fixnum' do
|
14
|
-
|
15
|
-
|
14
|
+
expect(
|
15
|
+
RMuh::RPT::Log::Util::UnitedOperationsLog::ONE_DAY
|
16
|
+
).to be_an_instance_of Fixnum
|
16
17
|
end
|
17
18
|
|
18
19
|
it 'should be 24 hours in seconds' do
|
19
|
-
RMuh::RPT::Log::Util::UnitedOperationsLog::ONE_DAY.
|
20
|
+
expect(RMuh::RPT::Log::Util::UnitedOperationsLog::ONE_DAY).to eql 86_400
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
24
|
context '::TIME' do
|
24
25
|
it 'should be an instance of String' do
|
25
|
-
|
26
|
-
|
26
|
+
expect(
|
27
|
+
RMuh::RPT::Log::Util::UnitedOperationsLog::TIME
|
28
|
+
).to be_an_instance_of String
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
30
32
|
context '::GUID' do
|
31
33
|
it 'should be an instance of Regexp' do
|
32
|
-
|
33
|
-
|
34
|
+
expect(
|
35
|
+
RMuh::RPT::Log::Util::UnitedOperationsLog::GUID
|
36
|
+
).to be_an_instance_of Regexp
|
34
37
|
end
|
35
38
|
|
36
39
|
it 'should match an example line' do
|
37
40
|
l = ' 4:01:02 BattlEye Server: Verified GUID ' \
|
38
41
|
'(04de012b0f882b9ff2e43564c8c09361) of player #0 nametag47'
|
39
42
|
m = RMuh::RPT::Log::Util::UnitedOperationsLog::GUID.match(l)
|
40
|
-
m.
|
41
|
-
m['hour'].
|
42
|
-
m['min'].
|
43
|
-
m['sec'].
|
44
|
-
m['player_beguid'].
|
45
|
-
m['player'].
|
43
|
+
expect(m).to_not be_nil
|
44
|
+
expect(m['hour']).to eql '4'
|
45
|
+
expect(m['min']).to eql '01'
|
46
|
+
expect(m['sec']).to eql '02'
|
47
|
+
expect(m['player_beguid']).to eql '04de012b0f882b9ff2e43564c8c09361'
|
48
|
+
expect(m['player']).to eql 'nametag47'
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
49
52
|
context '::CHAT' do
|
50
53
|
it 'should be an instance of Regexp' do
|
51
|
-
|
52
|
-
|
54
|
+
expect(
|
55
|
+
RMuh::RPT::Log::Util::UnitedOperationsLog::CHAT
|
56
|
+
).to be_an_instance_of Regexp
|
53
57
|
end
|
54
58
|
|
55
59
|
it 'should match an example line' do
|
56
60
|
l = ' 5:48:01 BattlEye Server: (Side) Xcenocide: Admin back'
|
57
61
|
m = RMuh::RPT::Log::Util::UnitedOperationsLog::CHAT.match(l)
|
58
|
-
m['hour'].
|
59
|
-
m['min'].
|
60
|
-
m['sec'].
|
61
|
-
m['channel'].
|
62
|
-
m['player'].
|
63
|
-
m['message'].
|
62
|
+
expect(m['hour']).to eql '5'
|
63
|
+
expect(m['min']).to eql '48'
|
64
|
+
expect(m['sec']).to eql '01'
|
65
|
+
expect(m['channel']).to eql 'Side'
|
66
|
+
expect(m['player']).to eql 'Xcenocide'
|
67
|
+
expect(m['message']).to eql 'Admin back'
|
64
68
|
end
|
65
69
|
end
|
66
70
|
end
|
@@ -6,15 +6,17 @@ require File.join(repo_root, 'lib/rmuh/rpt/log/util/unitedoperationsrpt')
|
|
6
6
|
describe RMuh::RPT::Log::Util::UnitedOperationsRPT do
|
7
7
|
context '::DTR' do
|
8
8
|
it 'should be an instance of String' do
|
9
|
-
|
10
|
-
|
9
|
+
expect(
|
10
|
+
RMuh::RPT::Log::Util::UnitedOperationsRPT::DTR
|
11
|
+
).to be_an_instance_of String
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
15
|
context '::KILLED' do
|
15
16
|
it 'should be an instance of Regexp' do
|
16
|
-
|
17
|
-
|
17
|
+
expect(
|
18
|
+
RMuh::RPT::Log::Util::UnitedOperationsRPT::KILLED
|
19
|
+
).to be_an_instance_of Regexp
|
18
20
|
end
|
19
21
|
|
20
22
|
it 'should match an example line' do
|
@@ -24,31 +26,32 @@ describe RMuh::RPT::Log::Util::UnitedOperationsRPT do
|
|
24
26
|
'[6498.62,6916.71,0.0204163] (GRID 0649806916). Distance between: ' \
|
25
27
|
'71.1653 meters. Near players (100m): None."'
|
26
28
|
m = RMuh::RPT::Log::Util::UnitedOperationsRPT::KILLED.match(l)
|
27
|
-
m.
|
28
|
-
m['year'].
|
29
|
-
m['month'].
|
30
|
-
m['day'].
|
31
|
-
m['hour'].
|
32
|
-
m['min'].
|
33
|
-
m['sec'].
|
34
|
-
m['server_time'].
|
35
|
-
m['victim'].
|
36
|
-
m['victim_team'].
|
37
|
-
m['offender'].
|
38
|
-
m['offender_team'].
|
39
|
-
m['victim_position'].
|
40
|
-
m['victim_grid'].
|
41
|
-
m['offender_position'].
|
42
|
-
m['offender_grid'].
|
43
|
-
m['distance'].
|
44
|
-
m['nearby_players'].
|
29
|
+
expect(m).to_not be_nil
|
30
|
+
expect(m['year']).to eql '2014'
|
31
|
+
expect(m['month']).to eql '02'
|
32
|
+
expect(m['day']).to eql '16'
|
33
|
+
expect(m['hour']).to eql '4'
|
34
|
+
expect(m['min']).to eql '11'
|
35
|
+
expect(m['sec']).to eql '42'
|
36
|
+
expect(m['server_time']).to eql '69.85'
|
37
|
+
expect(m['victim']).to eql 'Olli'
|
38
|
+
expect(m['victim_team']).to eql 'CIV'
|
39
|
+
expect(m['offender']).to eql 'Yevgeniy Nikolayev'
|
40
|
+
expect(m['offender_team']).to eql 'EAST'
|
41
|
+
expect(m['victim_position']).to eql '6553.55,6961.92,0.0015564'
|
42
|
+
expect(m['victim_grid']).to eql '0655306961'
|
43
|
+
expect(m['offender_position']).to eql '6498.62,6916.71,0.0204163'
|
44
|
+
expect(m['offender_grid']).to eql '0649806916'
|
45
|
+
expect(m['distance']).to eql '71.1653'
|
46
|
+
expect(m['nearby_players']).to eql 'None.'
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
50
|
context '::DIED' do
|
49
51
|
it 'should be an instance of Regexp' do
|
50
|
-
|
51
|
-
|
52
|
+
expect(
|
53
|
+
RMuh::RPT::Log::Util::UnitedOperationsRPT::DIED
|
54
|
+
).to be_an_instance_of Regexp
|
52
55
|
end
|
53
56
|
|
54
57
|
it 'should match an example line' do
|
@@ -56,67 +59,69 @@ describe RMuh::RPT::Log::Util::UnitedOperationsRPT do
|
|
56
59
|
'[4602.18,7490.26,2.2435] (GRID 0460207490). Near players (100m): ' \
|
57
60
|
'["Olli","nametag47","Villanyi"]"'
|
58
61
|
m = RMuh::RPT::Log::Util::UnitedOperationsRPT::DIED.match(l)
|
59
|
-
m.
|
60
|
-
m['year'].
|
61
|
-
m['month'].
|
62
|
-
m['day'].
|
63
|
-
m['hour'].
|
64
|
-
m['min'].
|
65
|
-
m['sec'].
|
66
|
-
m['server_time'].
|
67
|
-
m['victim'].
|
68
|
-
m['victim_position'].
|
69
|
-
m['victim_grid'].
|
70
|
-
m['nearby_players'].
|
62
|
+
expect(m).to_not be_nil
|
63
|
+
expect(m['year']).to eql '2014'
|
64
|
+
expect(m['month']).to eql '02'
|
65
|
+
expect(m['day']).to eql '16'
|
66
|
+
expect(m['hour']).to eql '5'
|
67
|
+
expect(m['min']).to eql '15'
|
68
|
+
expect(m['sec']).to eql '06'
|
69
|
+
expect(m['server_time']).to eql '3683.58'
|
70
|
+
expect(m['victim']).to eql 'Appe96'
|
71
|
+
expect(m['victim_position']).to eql '4602.18,7490.26,2.2435'
|
72
|
+
expect(m['victim_grid']).to eql '0460207490'
|
73
|
+
expect(m['nearby_players']).to eql '["Olli","nametag47","Villanyi"]'
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
74
77
|
context '::WOUNDED' do
|
75
78
|
it 'should be an instance of Regexp' do
|
76
|
-
|
77
|
-
|
79
|
+
expect(
|
80
|
+
RMuh::RPT::Log::Util::UnitedOperationsRPT::WOUNDED
|
81
|
+
).to be_an_instance_of Regexp
|
78
82
|
end
|
79
83
|
|
80
84
|
it 'should match an example line' do
|
81
85
|
l = '2014/02/16, 5:22:55 "4152.41 seconds: Sherminator (CIV) has ' \
|
82
86
|
'been team wounded by Xcenocide (WEST) for 1.50828 damage."'
|
83
87
|
m = RMuh::RPT::Log::Util::UnitedOperationsRPT::WOUNDED.match(l)
|
84
|
-
m.
|
85
|
-
m['year'].
|
86
|
-
m['month'].
|
87
|
-
m['day'].
|
88
|
-
m['hour'].
|
89
|
-
m['min'].
|
90
|
-
m['sec'].
|
91
|
-
m['server_time'].
|
92
|
-
m['victim'].
|
93
|
-
m['victim_team'].
|
94
|
-
m['offender'].
|
95
|
-
m['offender_team'].
|
96
|
-
m['damage'].
|
88
|
+
expect(m).to_not be_nil
|
89
|
+
expect(m['year']).to eql '2014'
|
90
|
+
expect(m['month']).to eql '02'
|
91
|
+
expect(m['day']).to eql '16'
|
92
|
+
expect(m['hour']).to eql '5'
|
93
|
+
expect(m['min']).to eql '22'
|
94
|
+
expect(m['sec']).to eql '55'
|
95
|
+
expect(m['server_time']).to eql '4152.41'
|
96
|
+
expect(m['victim']).to eql 'Sherminator'
|
97
|
+
expect(m['victim_team']).to eql 'CIV'
|
98
|
+
expect(m['offender']).to eql 'Xcenocide'
|
99
|
+
expect(m['offender_team']).to eql 'WEST'
|
100
|
+
expect(m['damage']).to eql '1.50828'
|
97
101
|
end
|
98
102
|
end
|
99
103
|
|
100
104
|
context '::ANNOUNCEMENT' do
|
101
105
|
it 'should be an instance of Regexp' do
|
102
|
-
|
103
|
-
|
106
|
+
expect(
|
107
|
+
RMuh::RPT::Log::Util::UnitedOperationsRPT::ANNOUNCEMENT
|
108
|
+
).to be_an_instance_of Regexp
|
104
109
|
end
|
105
110
|
|
106
111
|
it 'should match an example line' do
|
107
112
|
l = '2014/02/16, 4:13:10 "############################# Start ' \
|
108
113
|
'CO08_Escape_Chernarus_V1 #############################"'
|
109
114
|
m = RMuh::RPT::Log::Util::UnitedOperationsRPT::ANNOUNCEMENT.match(l)
|
110
|
-
m.
|
111
|
-
m['year'].
|
112
|
-
m['month'].
|
113
|
-
m['day'].
|
114
|
-
m['hour'].
|
115
|
-
m['min'].
|
116
|
-
m['sec'].
|
117
|
-
m['head'].
|
118
|
-
m['message'].
|
119
|
-
m['tail'].
|
115
|
+
expect(m).to_not be_nil
|
116
|
+
expect(m['year']).to eql '2014'
|
117
|
+
expect(m['month']).to eql '02'
|
118
|
+
expect(m['day']).to eql '16'
|
119
|
+
expect(m['hour']).to eql '4'
|
120
|
+
expect(m['min']).to eql '13'
|
121
|
+
expect(m['sec']).to eql '10'
|
122
|
+
expect(m['head']).to eql '#############################'
|
123
|
+
expect(m['message']).to eql 'Start CO08_Escape_Chernarus_V1'
|
124
|
+
expect(m['tail']).to eql '#############################'
|
120
125
|
end
|
121
126
|
end
|
122
127
|
end
|
data/spec/rmuh_rpt_spec.rb
CHANGED
@@ -5,41 +5,41 @@ require File.join(File.expand_path('../..', __FILE__), 'lib/rmuh/version')
|
|
5
5
|
describe RMuh do
|
6
6
|
context '::VERSION_MAJ' do
|
7
7
|
it 'should have a major version that is an integer' do
|
8
|
-
RMuh::VERSION_MAJ.is_a?(Integer).
|
8
|
+
expect(RMuh::VERSION_MAJ.is_a?(Integer)).to be_true
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should have a major version that is a positive number' do
|
12
|
-
(RMuh::VERSION_MAJ > -1).
|
12
|
+
expect(RMuh::VERSION_MAJ > -1).to be_true
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
context '::VERSION_MIN' do
|
17
17
|
it 'should have a minor version that is an integer' do
|
18
|
-
RMuh::VERSION_MIN.is_a?(Integer).
|
18
|
+
expect(RMuh::VERSION_MIN.is_a?(Integer)).to be_true
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'should have a minor version that is a positive integer' do
|
22
|
-
(RMuh::VERSION_MIN > -1).
|
22
|
+
expect(RMuh::VERSION_MIN > -1).to be_true
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
context '::VERSION_REV' do
|
27
27
|
it 'should have a revision number that is an integer' do
|
28
|
-
RMuh::VERSION_REV.is_a?(Integer).
|
28
|
+
expect(RMuh::VERSION_REV.is_a?(Integer)).to be_true
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should have a revision number that is a positive integer' do
|
32
|
-
(RMuh::VERSION_REV > -1).
|
32
|
+
expect(RMuh::VERSION_REV > -1).to be_true
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context '::VERSION' do
|
37
37
|
it 'should have a version that is a string' do
|
38
|
-
RMuh::VERSION.
|
38
|
+
expect(RMuh::VERSION).to be_an_instance_of String
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'should match the following format N.N.N' do
|
42
|
-
/\A(?:\d+?\.){2}\d+?/.match(RMuh::VERSION).
|
42
|
+
expect(/\A(?:\d+?\.){2}\d+?/.match(RMuh::VERSION)).to_not be_nil
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -10,15 +10,17 @@ describe RMuh::ServerStats::Base do
|
|
10
10
|
let(:port) { RMuh::ServerStats::Base::DEFAULT_PORT }
|
11
11
|
|
12
12
|
it 'should be an instance of Fixnum' do
|
13
|
-
port.
|
13
|
+
expect(port).to be_an_instance_of Fixnum
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'should be the default ArmA 2 port' do
|
17
|
-
port.
|
17
|
+
expect(port).to eql 2_302
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
context '::validate_opts' do
|
22
|
+
let(:srv_hash) { { host: '127.0.0.1' } }
|
23
|
+
|
22
24
|
it 'should take no more than one arg' do
|
23
25
|
expect do
|
24
26
|
RMuh::ServerStats::Base.validate_opts(nil, nil)
|
@@ -37,9 +39,23 @@ describe RMuh::ServerStats::Base do
|
|
37
39
|
end.to raise_error ArgumentError
|
38
40
|
end
|
39
41
|
|
42
|
+
it 'should set the default port if not provided' do
|
43
|
+
h = srv_hash.dup
|
44
|
+
RMuh::ServerStats::Base.validate_opts(h)
|
45
|
+
expect(h.key?(:port)).to be_true
|
46
|
+
expect(h[:port]).to eql RMuh::ServerStats::Base::DEFAULT_PORT
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should set the auto_cache key to true if not provided' do
|
50
|
+
h = srv_hash.dup
|
51
|
+
RMuh::ServerStats::Base.validate_opts(h)
|
52
|
+
expect(h.key?(:auto_cache)).to be_true
|
53
|
+
expect(h[:auto_cache]).to be_true
|
54
|
+
end
|
55
|
+
|
40
56
|
it 'should return nil' do
|
41
57
|
x = RMuh::ServerStats::Base.validate_opts(host: '127.0.0.1')
|
42
|
-
x.
|
58
|
+
expect(x).to be_nil
|
43
59
|
end
|
44
60
|
end
|
45
61
|
|
@@ -60,13 +76,13 @@ describe RMuh::ServerStats::Base do
|
|
60
76
|
|
61
77
|
it 'should convert each key to an instance variable' do
|
62
78
|
h = { one: 1, two: '2', three: :three }
|
63
|
-
b.instance_variable_get(:@one).
|
64
|
-
b.instance_variable_get(:@two).
|
65
|
-
b.instance_variable_get(:@three).
|
79
|
+
expect(b.instance_variable_get(:@one)).to be_nil
|
80
|
+
expect(b.instance_variable_get(:@two)).to be_nil
|
81
|
+
expect(b.instance_variable_get(:@three)).to be_nil
|
66
82
|
b.send(:opts_to_instance, h)
|
67
|
-
b.instance_variable_get(:@one).
|
68
|
-
b.instance_variable_get(:@two).
|
69
|
-
b.instance_variable_get(:@three).
|
83
|
+
expect(b.instance_variable_get(:@one)).to eql h[:one]
|
84
|
+
expect(b.instance_variable_get(:@two)).to eql h[:two]
|
85
|
+
expect(b.instance_variable_get(:@three)).to eql h[:three]
|
70
86
|
end
|
71
87
|
end
|
72
88
|
|
@@ -79,7 +95,7 @@ describe RMuh::ServerStats::Base do
|
|
79
95
|
|
80
96
|
it 'should return an instance of itself if arg 1 is a Hash' do
|
81
97
|
s = RMuh::ServerStats::Base.new(host: '127.0.0.1')
|
82
|
-
s.
|
98
|
+
expect(s).to be_an_instance_of RMuh::ServerStats::Base
|
83
99
|
end
|
84
100
|
|
85
101
|
it 'should require the host attribute' do
|
@@ -91,21 +107,21 @@ describe RMuh::ServerStats::Base do
|
|
91
107
|
it 'should set an instance variable for each thing in Hash' do
|
92
108
|
h = { host: '1.2.3.4', port: 2_303, cache: false }
|
93
109
|
s = RMuh::ServerStats::Base.new(h)
|
94
|
-
s.instance_variable_get(:@host).
|
95
|
-
s.instance_variable_get(:@port).
|
96
|
-
s.instance_variable_get(:@cache).
|
110
|
+
expect(s.instance_variable_get(:@host)).to eql h[:host]
|
111
|
+
expect(s.instance_variable_get(:@port)).to eql h[:port]
|
112
|
+
expect(s.instance_variable_get(:@cache)).to eql h[:cache]
|
97
113
|
end
|
98
114
|
|
99
115
|
it 'should create an instance of GamespyQuery::Socket' do
|
100
116
|
s = RMuh::ServerStats::Base.new(host: '127.0.0.1')
|
101
117
|
x = s.instance_variable_get(:@gsq)
|
102
|
-
x.
|
118
|
+
expect(x).to be_an_instance_of GamespyQuery::Socket
|
103
119
|
end
|
104
120
|
|
105
121
|
it 'should specify default values for @port and @cache' do
|
106
122
|
s = RMuh::ServerStats::Base.new(host: '127.0.0.1')
|
107
|
-
s.instance_variable_get(:@cache).
|
108
|
-
s.instance_variable_get(:@port).
|
123
|
+
expect(s.instance_variable_get(:@cache)).to be true
|
124
|
+
expect(s.instance_variable_get(:@port)).to eql 2_302
|
109
125
|
end
|
110
126
|
end
|
111
127
|
|
@@ -120,7 +136,7 @@ describe RMuh::ServerStats::Base do
|
|
120
136
|
end
|
121
137
|
|
122
138
|
it 'should return a Hash' do
|
123
|
-
b.send(:sync).
|
139
|
+
expect(b.send(:sync)).to be_an_instance_of Hash
|
124
140
|
end
|
125
141
|
end
|
126
142
|
|
@@ -133,13 +149,13 @@ describe RMuh::ServerStats::Base do
|
|
133
149
|
|
134
150
|
it 'should return the content of @servicestats if cache == true' do
|
135
151
|
b.instance_variable_set(:@serverstats, one: 'two')
|
136
|
-
b.send(:remote_stats).
|
152
|
+
expect(b.send(:remote_stats)).to eql(one: 'two')
|
137
153
|
end
|
138
154
|
|
139
155
|
it 'should return the return value from the #sync method if cache true' do
|
140
156
|
n = RMuh::ServerStats::Base.new(host: '127.0.0.1', cache: false)
|
141
157
|
n.stub(:sync).and_return(one: 'two')
|
142
|
-
n.send(:remote_stats).
|
158
|
+
expect(n.send(:remote_stats)).to eql(one: 'two')
|
143
159
|
end
|
144
160
|
end
|
145
161
|
|
@@ -157,12 +173,12 @@ describe RMuh::ServerStats::Base do
|
|
157
173
|
|
158
174
|
it 'should set the contents of @serverstats if caching' do
|
159
175
|
@b.update_cache
|
160
|
-
@b.instance_variable_get(:@serverstats).
|
176
|
+
expect(@b.instance_variable_get(:@serverstats)).to eql(one: 'two')
|
161
177
|
end
|
162
178
|
|
163
179
|
it 'should not set the contents of @serverstats if no caching' do
|
164
180
|
@bf.update_cache
|
165
|
-
@bf.instance_variable_get(:@serverstats).
|
181
|
+
expect(@bf.instance_variable_get(:@serverstats)).to be_nil
|
166
182
|
end
|
167
183
|
end
|
168
184
|
|
@@ -180,11 +196,11 @@ describe RMuh::ServerStats::Base do
|
|
180
196
|
end
|
181
197
|
|
182
198
|
it 'should return the contents of @serverstats if caching enabled' do
|
183
|
-
@b.stats.
|
199
|
+
expect(@b.stats).to eql @b.instance_variable_get(:@serverstats)
|
184
200
|
end
|
185
201
|
|
186
202
|
it 'should return the contents of sync if caching is disabled' do
|
187
|
-
@bf.stats.
|
203
|
+
expect(@bf.stats).to eql(one: 'two')
|
188
204
|
end
|
189
205
|
end
|
190
206
|
end
|